* (Matrix)

Multiplies a matrix by a number.

Arguments

matrix0
is the Matrix to multiply.
Real
number
to multiply by.

Return values

matrix1
is the resulting Matrix.

Complexity

O(dimension)

Example

"sl/algebra" useFile m: ((6.0 -3.0 1.0 0.0) (-1.0 1.0 8.0 5.0) (0.0 2.0 -8.0 1.0)) makeMatrix; mr: m 0.5 *; mr.rows [i mr.rowRange [print "," print] each LF print] times
Output:
3.000000,-1.500000,0.500000,0.000000, -0.500000,0.500000,4.000000,2.500000, 0.000000,1.000000,-4.000000,0.500000,