StorageEfficientMatrixOperations RΒΆ
matstor.spad line 1 [edit on github]
R: Ring
This package provides standard arithmetic operations on matrices. The functions in this package store the results of computations in existing matrices, rather than creating new matrices. This package works only for matrices of type Matrix and uses the internal representation of this type.
- ^: (Matrix R, NonNegativeInteger) -> Matrix R
x ^ ncomputes then-th power of a square matrix. The powernis assumed greater than 1.
- copy!: (Matrix R, Matrix R) -> Matrix R
copy!(c, a)copies the matrixainto the matrixc. Error: ifaandcdo not have the same dimensions.
- leftScalarTimes!: (Matrix R, R, Matrix R) -> Matrix R
leftScalarTimes!(c, r, a)computes the scalar productr * aand stores the result in the matrixc. Error: ifaandcdo not have the same dimensions.
- minus!: (Matrix R, Matrix R) -> Matrix R
minus!(c, a)computes-aand stores the result in the matrixc. Error: if a andcdo not have the same dimensions.
- minus!: (Matrix R, Matrix R, Matrix R) -> Matrix R
!minus!(c, a, b)computes the matrix differencea - band stores the result in the matrixc. Error: ifa,b, andcdo not have the same dimensions.
- plus!: (Matrix R, Matrix R, Matrix R) -> Matrix R
plus!(c, a, b)computes the matrix suma + band stores the result in the matrixc. Error: ifa,b, andcdo not have the same dimensions.
- power!: (Matrix R, Matrix R, Matrix R, Matrix R, NonNegativeInteger) -> Matrix R
power!(a, b, c, m, n)computesm^nand stores the result ina. The matricesbandcare used to store intermediate results. Error: ifa,b,c, andmare not square and of the same dimensions.