makeMatrix (Matrix)

Creates a matrix from an enumerable of enumerables of the same size.

Arguments

enumerableOfEnumerables
, with each inner enumerable representing one row of a matrix.

Return values

Resulting

matrix
(see Matrix).

Complexity

O(dimension)

Example

"sl/algebra" useFile "sl/array" useFile "sl/linkedList" useFile m1: ((1.0 3.0 2.0) (1.0 2.0 3.0) (4.0 6.0 6.0 7.0) makeArray .makeRange r:; 1 4 r.subRange) makeMatrix; m2: ((1.0 3.0 2.0) makeList (4.0 6.0 6.0) makeArray) makeMatrix; m1.rows [i m1.rowRange [print "," print] each LF print] times LF print m2.rows [i m2.rowRange [print "," print] each LF print] times
Output:
1.000000,3.000000,2.000000, 1.000000,2.000000,3.000000, 6.000000,6.000000,7.000000, 1.000000,3.000000,2.000000, 4.000000,6.000000,6.000000,