MatrixCategory(R, Row, Col)¶
matcat.spad line 63 [edit on github]
Row: FiniteLinearAggregate R
Col: FiniteLinearAggregate R
MatrixCategory is a general matrix category which allows different representations and indexing schemes. Rows and columns may be extracted with rows returned as objects of type Row and columns returned as objects of type Col. A domain belonging to this category will be shallowly mutable. The index of the ‘first’ row may be obtained by calling the function minRowIndex. The index of the ‘first’ column may be obtained by calling the function minColIndex. The index of the first element of a Row is the same as the index of the first column in a matrix and vice versa.
- #: % -> NonNegativeInteger
from Aggregate
- *: (%, %) -> % if R has SemiRng
x * y
is the product of the matricesx
andy
. Error: if the dimensions are incompatible.
- *: (%, Col) -> Col if R has SemiRng
x * c
is the product of the matrixx
and the column vectorc
. Error: if the dimensions are incompatible.
- *: (%, R) -> % if R has SemiRng
x * r
is the right scalar multiple of the scalarr
and the matrixx
.
- *: (Integer, %) -> % if R has AbelianGroup
n * x
is an integer multiple.
- *: (R, %) -> % if R has SemiRng
r*x
is the left scalar multiple of the scalarr
and the matrixx
.
- *: (Row, %) -> Row if R has SemiRng
r * x
is the product of the row vectorr
and the matrixx
. Error: if the dimensions are incompatible.
- +: (%, %) -> %
x + y
is the sum of the matricesx
andy
. Error: if the dimensions are incompatible.
- -: % -> % if R has AbelianGroup
-x
returns the negative of the matrixx
.
- -: (%, %) -> % if R has AbelianGroup
x - y
is the difference of the matricesx
andy
. Error: if the dimensions are incompatible.
- /: (%, R) -> % if R has Field
m/r
divides the elements ofm
byr
. Error: ifr = 0
.
- ^: (%, Integer) -> % if R has Field
m^n
computes an integral power of the matrixm
. Error: if matrix is not square or if the matrix is square but not invertible.
- ^: (%, NonNegativeInteger) -> % if R has Monoid and R has SemiRng
x ^ n
computes a non-negative integral power of the matrixx
. Error: if the matrix is not square.
- antisymmetric?: % -> Boolean if R has AbelianGroup
antisymmetric?(m)
returnstrue
if the matrixm
is square and antisymmetric (i.e.m[i, j] = -m[j, i]
for alli
andj
) andfalse
otherwise.
- any?: (R -> Boolean, %) -> Boolean
from HomogeneousAggregate R
- array2: List List R -> %
from TwoDimensionalArrayCategory(R, Row, Col)
- blockConcat: List List % -> %
from TwoDimensionalArrayCategory(R, Row, Col)
- blockSplit: (%, List NonNegativeInteger, List NonNegativeInteger) -> List List %
from TwoDimensionalArrayCategory(R, Row, Col)
- blockSplit: (%, PositiveInteger, PositiveInteger) -> List List %
from TwoDimensionalArrayCategory(R, Row, Col)
- coerce: % -> OutputForm
from CoercibleTo OutputForm
- coerce: Col -> %
coerce(col)
converts the columncol
to a column matrix.
- colSlice: % -> Segment Integer
from TwoDimensionalArrayCategory(R, Row, Col)
- column: (%, Integer) -> Col
from TwoDimensionalArrayCategory(R, Row, Col)
- columnSpace: % -> List Col if R has EuclideanDomain
columnSpace(m)
returns a sublist of columns of the matrixm
forming a basis of its column space
- count: (R -> Boolean, %) -> NonNegativeInteger
from HomogeneousAggregate R
- count: (R, %) -> NonNegativeInteger
from HomogeneousAggregate R
- determinant: % -> R if R has CommutativeRing
determinant(m)
returns the determinant of the matrixm
. Error: if the matrix is not square.
- diagonal?: % -> Boolean
diagonal?(m)
returnstrue
if the matrixm
is square and diagonal (i.e. all entries ofm
not on the diagonal are zero) andfalse
otherwise.
- diagonalMatrix: List % -> %
diagonalMatrix([m1, ..., mk])
creates a block diagonal matrixM
with block matrices m1, …, mk down the diagonal, with 0 block matrices elsewhere. More precisely: ifri := nrows mi
,ci := ncols mi
, thenm
is an (r1+
..+rk
) by (c1+
..+ck
) - matrix with entriesm.i.j = ml.(i-r1-..-r(l-1)).(j-n1-..-n(l-1))
, if(r1+..+r(l-1)) < i <= r1+..+rl
and(c1+..+c(l-1)) < i <= c1+..+cl
,m.i.j
= 0 otherwise.
- diagonalMatrix: List R -> %
diagonalMatrix(l)
returns a diagonal matrix with the elements ofl
on the diagonal.
- elt: (%, Integer, Integer) -> R
from TwoDimensionalArrayCategory(R, Row, Col)
- elt: (%, Integer, Integer, R) -> R
from TwoDimensionalArrayCategory(R, Row, Col)
- elt: (%, Integer, List Integer) -> %
from TwoDimensionalArrayCategory(R, Row, Col)
- elt: (%, Integer, List Segment Integer) -> %
from TwoDimensionalArrayCategory(R, Row, Col)
- elt: (%, List Integer, Integer) -> %
from TwoDimensionalArrayCategory(R, Row, Col)
- elt: (%, List Integer, List Integer) -> %
from TwoDimensionalArrayCategory(R, Row, Col)
- elt: (%, List Integer, Segment Integer) -> %
from TwoDimensionalArrayCategory(R, Row, Col)
- elt: (%, List Segment Integer, Integer) -> %
from TwoDimensionalArrayCategory(R, Row, Col)
- elt: (%, List Segment Integer, List Segment Integer) -> %
from TwoDimensionalArrayCategory(R, Row, Col)
- elt: (%, List Segment Integer, Segment Integer) -> %
from TwoDimensionalArrayCategory(R, Row, Col)
- elt: (%, Segment Integer, List Integer) -> %
from TwoDimensionalArrayCategory(R, Row, Col)
- elt: (%, Segment Integer, List Segment Integer) -> %
from TwoDimensionalArrayCategory(R, Row, Col)
- elt: (%, Segment Integer, Segment Integer) -> %
from TwoDimensionalArrayCategory(R, Row, Col)
- eval: (%, Equation R) -> % if R has Evalable R
from Evalable R
- eval: (%, List Equation R) -> % if R has Evalable R
from Evalable R
- eval: (%, List R, List R) -> % if R has Evalable R
from InnerEvalable(R, R)
- eval: (%, R, R) -> % if R has Evalable R
from InnerEvalable(R, R)
- every?: (R -> Boolean, %) -> Boolean
from HomogeneousAggregate R
- exquo: (%, R) -> Union(%, failed) if R has IntegralDomain
exquo(m, r)
computes the exact quotient of the elements ofm
byr
, returning"failed"
if this is not possible.
- fill!: (%, R) -> %
from TwoDimensionalArrayCategory(R, Row, Col)
- hash: % -> SingleInteger if R has Hashable
from Hashable
- hashUpdate!: (HashState, %) -> HashState if R has Hashable
from Hashable
- horizConcat: (%, %) -> %
from TwoDimensionalArrayCategory(R, Row, Col)
- horizConcat: List % -> %
from TwoDimensionalArrayCategory(R, Row, Col)
- horizSplit: (%, List NonNegativeInteger) -> List %
from TwoDimensionalArrayCategory(R, Row, Col)
- horizSplit: (%, PositiveInteger) -> List %
from TwoDimensionalArrayCategory(R, Row, Col)
- inverse: % -> Union(%, failed) if R has Field
inverse(m)
returns the inverse of the matrixm
. If the matrix is not invertible, “failed” is returned. Error: if the matrix is not square.
- kronecker_prod1: (%, Integer, List List NonNegativeInteger, List %, NonNegativeInteger, NonNegativeInteger, Union(R, one)) -> Void
Should be local but conditional.
- kroneckerProduct: (%, %) -> % if R has SemiRng
kroneckerProduct(a, b)
calculates the Kronecker product of the matrices a andb
. This corresponds to tensor product of corresponding operators.
- kroneckerProduct: List % -> % if R has SemiRng
kroneckerProduct([a1, a2, ..., an])
calculates the Kronecker product of the matricesa1
,a2
, …, an. This corresponds to tensor product of corresponding operators.
- kroneckerSum: (%, %) -> %
kroneckerSum(a, b)
calculates the Kronecker sum of the matrices a andb
.
- kroneckerSum: List % -> %
kroneckerSum([a1, a2, ..., an])
calculates the Kronecker sum of the matricesa1
,a2
, …, an.
- latex: % -> String
from SetCategory
- less?: (%, NonNegativeInteger) -> Boolean
from Aggregate
- listOfLists: % -> List List R
from TwoDimensionalArrayCategory(R, Row, Col)
- map!: (R -> R, %) -> %
from TwoDimensionalArrayCategory(R, Row, Col)
- map: ((R, R) -> R, %, %) -> %
from TwoDimensionalArrayCategory(R, Row, Col)
- map: ((R, R) -> R, %, %, R) -> %
from TwoDimensionalArrayCategory(R, Row, Col)
- map: (R -> R, %) -> %
from TwoDimensionalArrayCategory(R, Row, Col)
- matrix: (NonNegativeInteger, NonNegativeInteger, (Integer, Integer) -> R) -> %
matrix(n,m,f)
constructs ann * m
matrix with the(i,j)
entry equal tof(i,j)
.
- matrix: List List R -> %
matrix(l)
converts the list of listsl
to a matrix, where the list of lists is viewed as a list of the rows of the matrix.
- max: % -> R if R has OrderedSet
from HomogeneousAggregate R
- max: ((R, R) -> Boolean, %) -> R
from HomogeneousAggregate R
- maxColIndex: % -> Integer
from TwoDimensionalArrayCategory(R, Row, Col)
- maxRowIndex: % -> Integer
from TwoDimensionalArrayCategory(R, Row, Col)
- member?: (R, %) -> Boolean
from HomogeneousAggregate R
- members: % -> List R
from HomogeneousAggregate R
- min: % -> R if R has OrderedSet
from HomogeneousAggregate R
- minColIndex: % -> Integer
from TwoDimensionalArrayCategory(R, Row, Col)
- minordet: % -> R if R has CommutativeRing
minordet(m)
computes the determinant of the matrixm
using minors. Error: if the matrix is not square.
- minRowIndex: % -> Integer
from TwoDimensionalArrayCategory(R, Row, Col)
- more?: (%, NonNegativeInteger) -> Boolean
from Aggregate
- ncols: % -> NonNegativeInteger
from TwoDimensionalArrayCategory(R, Row, Col)
- new: (NonNegativeInteger, NonNegativeInteger, R) -> %
from TwoDimensionalArrayCategory(R, Row, Col)
- nrows: % -> NonNegativeInteger
from TwoDimensionalArrayCategory(R, Row, Col)
- nullity: % -> NonNegativeInteger if R has IntegralDomain
nullity(m)
returns the nullity of the matrixm
. This is the dimension of the null space of the matrixm
.
- nullSpace: % -> List Col if R has IntegralDomain
nullSpace(m)
returns a basis for the null space of the matrixm
.
- parts: % -> List R
from TwoDimensionalArrayCategory(R, Row, Col)
- Pfaffian: % -> R if R has CommutativeRing
Pfaffian(m)
returns the Pfaffian of the matrixm
. Error: if the matrix is not antisymmetric.
- positivePower: (%, Integer) -> % if R has SemiRng
positivePower(x, n)
computes a positive integral power of the matrixx
. Error: if the matrix is not square.
- qelt: (%, Integer, Integer) -> R
from TwoDimensionalArrayCategory(R, Row, Col)
- qnew: (NonNegativeInteger, NonNegativeInteger) -> %
from TwoDimensionalArrayCategory(R, Row, Col)
- qsetelt!: (%, Integer, Integer, R) -> R
from TwoDimensionalArrayCategory(R, Row, Col)
- rank: % -> NonNegativeInteger if R has IntegralDomain
rank(m)
returns the rank of the matrixm
.
- row: (%, Integer) -> Row
from TwoDimensionalArrayCategory(R, Row, Col)
- rowEchelon: % -> % if R has EuclideanDomain
rowEchelon(m)
returns the row echelon form of the matrixm
.
- rowSlice: % -> Segment Integer
from TwoDimensionalArrayCategory(R, Row, Col)
- scalarMatrix: (NonNegativeInteger, R) -> %
scalarMatrix(n, r)
returns ann
-by-n
matrix withr
's
on the diagonal and zeroes elsewhere.
- setColumn!: (%, Integer, Col) -> %
from TwoDimensionalArrayCategory(R, Row, Col)
- setelt!: (%, Integer, Integer, R) -> R
from TwoDimensionalArrayCategory(R, Row, Col)
- setelt!: (%, Integer, List Integer, %) -> %
from TwoDimensionalArrayCategory(R, Row, Col)
- setelt!: (%, Integer, List Segment Integer, %) -> %
from TwoDimensionalArrayCategory(R, Row, Col)
- setelt!: (%, List Integer, Integer, %) -> %
from TwoDimensionalArrayCategory(R, Row, Col)
- setelt!: (%, List Integer, List Integer, %) -> %
from TwoDimensionalArrayCategory(R, Row, Col)
- setelt!: (%, List Integer, Segment Integer, %) -> %
from TwoDimensionalArrayCategory(R, Row, Col)
- setelt!: (%, List Segment Integer, Integer, %) -> %
from TwoDimensionalArrayCategory(R, Row, Col)
- setelt!: (%, List Segment Integer, List Segment Integer, %) -> %
from TwoDimensionalArrayCategory(R, Row, Col)
- setelt!: (%, List Segment Integer, Segment Integer, %) -> %
from TwoDimensionalArrayCategory(R, Row, Col)
- setelt!: (%, Segment Integer, List Integer, %) -> %
from TwoDimensionalArrayCategory(R, Row, Col)
- setelt!: (%, Segment Integer, List Segment Integer, %) -> %
from TwoDimensionalArrayCategory(R, Row, Col)
- setelt!: (%, Segment Integer, Segment Integer, %) -> %
from TwoDimensionalArrayCategory(R, Row, Col)
- setRow!: (%, Integer, Row) -> %
from TwoDimensionalArrayCategory(R, Row, Col)
- setsubMatrix!: (%, Integer, Integer, %) -> %
from TwoDimensionalArrayCategory(R, Row, Col)
- size?: (%, NonNegativeInteger) -> Boolean
from Aggregate
- smaller?: (%, %) -> Boolean if R has Comparable
from Comparable
- square?: % -> Boolean
square?(m)
returnstrue
ifm
is a square matrix (i.e. ifm
has the same number of rows as columns) andfalse
otherwise.
- squareTop: % -> %
from TwoDimensionalArrayCategory(R, Row, Col)
- subMatrix: (%, Integer, Integer, Integer, Integer) -> %
from TwoDimensionalArrayCategory(R, Row, Col)
- swapColumns!: (%, Integer, Integer) -> %
from TwoDimensionalArrayCategory(R, Row, Col)
- swapRows!: (%, Integer, Integer) -> %
from TwoDimensionalArrayCategory(R, Row, Col)
- symmetric?: % -> Boolean
symmetric?(m)
returnstrue
if the matrixm
is square and symmetric (i.e.m[i, j] = m[j, i]
for alli
andj
) andfalse
otherwise.
- transpose: % -> %
from TwoDimensionalArrayCategory(R, Row, Col)
- transpose: Row -> %
transpose(r)
converts the rowr
to a row matrix.
- vertConcat: (%, %) -> %
from TwoDimensionalArrayCategory(R, Row, Col)
- vertConcat: List % -> %
from TwoDimensionalArrayCategory(R, Row, Col)
- vertSplit: (%, List NonNegativeInteger) -> List %
from TwoDimensionalArrayCategory(R, Row, Col)
- vertSplit: (%, PositiveInteger) -> List %
from TwoDimensionalArrayCategory(R, Row, Col)
- zero?: % -> Boolean
zero?(m)
returnstrue
ifm
is a zero matrix andfalse
otherwise.
- zero: (NonNegativeInteger, NonNegativeInteger) -> %
zero(m, n)
returns anm
-by-n
zero matrix.
Comparable if R has Comparable
Evalable R if R has Evalable R
InnerEvalable(R, R) if R has Evalable R
TwoDimensionalArrayCategory(R, Row, Col)