+ (Matrix)

Returns the sum of two matrixes with the same dimension.

Arguments

matrix0
and
matrix1
are the Matrixes to add. If their dimensions are different, an error will occur.

Return values

matrix2
is the sum Matrix.

Complexity

O(dimension)

Example

"sl/algebra" useFile m1: ((1.0 3.0 2.0) (1.0 2.0 -3.0) (4.0 -6.0 6.0)) makeMatrix; m2: ((6.0 -3.0 1.0) (-1.0 1.0 8.0) (0.0 2.0 -8.0)) makeMatrix; m: m1 m2 +; m.rows [i m.rowRange [print "," print] each LF print] times
Output:
7.000000,0.000000,3.000000, 0.000000,3.000000,5.000000, 4.000000,-4.000000,-2.000000,