7.5 Entrywise Operations and Arithmetic
procedure
M : (Matrix Number) N : (Matrix Number)
procedure
M : (Matrix Number) N : (Matrix Number)
procedure
M : (Matrix Number) N : (Matrix Number)
Matrix addition, subtraction and products respectively.
For matrix addition and subtraction all matrices must have the same shape.
For matrix product the number of columns of one matrix must equal the number of rows in the following matrix.
Examples: | |||||||||||||||||||||
|
Computes (matrix* M ...) with n arguments, but more efficiently.
M must be a square-matrix? and n must be nonnegative.
Examples: | ||||||
|
Computes the matrix zM, a matrix of the same shape as M
where each entry in M is multiplied with z.
Example: | ||
|
procedure
(matrix-map f M) → (Matrix R)
f : (A -> R) M : (Matrix A) (matrix-map f M0 M1 N ...) → (Matrix R) f : (A B Ts ... -> R) M0 : (Matrix A) M1 : (Matrix B) N : (Matrix Ts)
Like array-map, but requires at least one matrix argument and never broadcasts.
Examples: | ||||||
|
Returns #t when its arguments are the same size and are equal entrywise.
See matrix-relative-error and matrix-absolute-error for equality testing that is tolerant to floating-point error.