Skip to content

Commit dc2eddd

Browse files
StephenWamplerJafaral
authored andcommitted
Add simple write matrix to stdout
Signed-off-by: Steve Wampler <[email protected]>
1 parent 05c50f9 commit dc2eddd

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

uni/lib/matrix_util.icn

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,3 +358,15 @@ procedure m_write(args[]) # Matrices and output files
358358
}
359359
::write(outfile)
360360
end
361+
362+
#<p>
363+
# A simplification of m_write() that (a) only writes a single matrix to stdout
364+
# and (b) allows column width specifiction for pretty-printing the matrix.
365+
# <[param m matrix to output]>
366+
# <[param w width of each column (default: 5)]>
367+
#</p>
368+
procedure writem(m,w)
369+
local i
370+
/w := 5
371+
every i := !m do every ::writes(::right(!i,3)|"\n")
372+
end

0 commit comments

Comments
 (0)