ApplyOverMatrix (a,func)
Apply a function over all entries of a matrix and return a matrix of the results.
ApplyOverMatrix2 (a,b,func)
Apply a function over all entries of 2 matrices (or 1 value and 1 matrix) and return a matrix of the results.
ColumnsOf (M)
Gets the columns of a matrix as a horizontal vector.
ComplementSubmatrix (m,r,c)
Remove column(s) and row(s) from a matrix.
CompoundMatrix (k,A)
Calculate the kth compund matrix of A.
CountZeroColumns (M)
Count the number of zero columns in a matrix. For example
Once you column reduce a matrix you can use this to find
the nullity. See cref
and Nullity
.
DeleteColumn (M,col)
Delete a column of a matrix.
DeleteRow (M,row)
Delete a row of a matrix.
DiagonalOf (M)
Gets the diagonal entries of a matrix as a column vector.
See Wikipedia for more information.
DotProduct (u,v)
Get the dot product of two vectors. The vectors must be of the same size. No conjugates are taken so this is a bilinear form even if working over the complex numbers.
See Planetmath for more information.
ExpandMatrix (M)
Expands a matrix just like we do on unquoted matrix input. That is we expand any internal matrices as blocks. This is a way to construct matrices out of smaller ones and this is normally done automatically on input unless the matrix is quoted.
HermitianProduct (u,v)
Aliases: InnerProduct
Get the hermitian product of two vectors. The vectors must be of the same size. This is a sesquilinear form using the identity matrix.
See Mathworld for more information.
I (n)
Aliases: eye
Return an identity matrix of a given size, that is n
by n
. If n
is zero, returns null.
See Planetmath for more information.
IndexComplement (vec,msize)
Return the index complement of a vector of indexes. Everything is one based. For example for vector [2,3] and size
5, we return [1,4,5]. If
msize
is 0, we always return null.
IsDiagonal (M)
Is a matrix diagonal.
See Wikipedia or Planetmath for more information.
IsIdentity (x)
Check if a matrix is the identity matrix. Automatically returns false
if the matrix is not square. Also works on numbers, in which
case it is equivalent to x==1. When x
is
null (we could think of that as a 0 by 0 matrix),
no error is generated and false
is returned.
IsLowerTriangular (M)
Is a matrix lower triangular. That is, are all the entries below the diagonal zero.
IsMatrixInteger (M)
Check if a matrix is a matrix of an integers (non-complex).
IsMatrixNonnegative (M)
Check if a matrix is nonnegative, that is if each element is nonnegative. Do not confuse positive matrices with positive semi-definite matrices.
See Wikipedia for more information.
IsMatrixPositive (M)
Check if a matrix is positive, that is if each element is positive (and hence real). In particular, no element is 0. Do not confuse positive matrices with positive definite matrices.
See Wikipedia for more information.
IsMatrixRational (M)
Check if a matrix is a matrix of rational (non-complex) numbers.
IsMatrixReal (M)
Check if a matrix is a matrix of real (non-complex) numbers.
IsMatrixSquare (M)
Check if a matrix is square, that is its width is equal to its height.
IsUpperTriangular (M)
Is a matrix upper triangular? That is, a matrix is upper triangular if all all the entries below the diagonal are zero.
IsValueOnly (M)
Check if a matrix is a matrix of numbers only. Many internal functions make this check. Values can be any number including complex numbers.
IsVector (v)
Is argument a horizontal or a vertical vector. Genius does
not distinguish between a matrix and a vector and a vector
is just a 1 by n
or n
by 1 matrix.
IsZero (x)
Check if a matrix is composed of all zeros. Also works on numbers, in which
case it is equivalent to x==0. When x
is
null (we could think of that as a 0 by 0 matrix),
no error is generated and true
is returned as the condition is
vacuous.
LowerTriangular (M)
Returns a copy of the matrix M
with all the entries above the diagonal set to zero.
MakeDiagonal (v,arg...)
Aliases: diag
Make diagonal matrix from a vector.
See Wikipedia or Planetmath for more information.
MakeVector (A)
Make column vector out of matrix by putting columns above each other. Returns null when given null.
MatrixProduct (A)
Calculate the product of all elements in a matrix or vector. That is we multiply all the elements and return a number that is the product of all the elements.
MatrixSum (A)
Calculate the sum of all elements in a matrix or vecgtor. That is we add all the elements and return a number that is the sum of all the elements.
MatrixSumSquares (A)
Calculate the sum of squares of all elements in a matrix or vector.
OuterProduct (u,v)
Get the outer product of two vectors. That is, suppose that
u
and v
are vertical vectors, then
the outer product is v * u.'.
ReverseVector (v)
Reverse elements in a vector.
RowSum (m)
Calculate sum of each row in a matrix and return a vertical vector with the result.
RowSumSquares (m)
Calculate sum of squares of each row in a matrix.
RowsOf (M)
Gets the rows of a matrix as a vertical vector. Each element
of the vector is a horizontal vector which is the corresponding row of
M
. This function is useful if you wish to loop over the
rows of a matrix. For example, as for r in RowsOf(M) do
something(r).
SetMatrixSize (M,rows,columns)
Make new matrix of given size from old one. That is, a new
matrix will be returned to which the old one is copied. Entries that
don't fit are clipped and extra space is filled with zeros.
if rows
or columns
are zero
then null is returned.
SortVector (v)
Sort vector elements in an increasing order.
StripZeroColumns (M)
Removes any all-zero columns of M
.
StripZeroRows (M)
Removes any all-zero rows of M
.
Submatrix (m,r,c)
Return column(s) and row(s) from a matrix. This is
just equivalent to m@(r,c). r
and c
should be vectors of rows and columns (or single numbers if only one row or column is needed).
SwapRows (m,row1,row2)
Swap two rows in a matrix.
UpperTriangular (M)
Returns a copy of the matrix M
with all the entries below the diagonal set to zero.
columns (M)
Get the number of columns of a matrix.
elements (M)
Get the total number of elements of a matrix. This is the number of columns times the number of rows.
ones (rows,columns...)
Make an matrix of all ones (or a row vector if only one argument is given). Returns null if either rows or columns are zero.
rows (M)
Get the number of rows of a matrix.
zeros (rows,columns...)
Make a matrix of all zeros (or a row vector if only one argument is given). Returns null if either rows or columns are zero.