Операции с матрицами

AppendElement
AppendElement (v,elt)

Append an element to a vector and return the vector. No expansion is done. Normally a row vector is built if starting from null or a 1-by-1 matrix, but if given a column vector it will properly build a column vector.

ApplyOverMatrix
ApplyOverMatrix (a,func)

Применяет функцию к каждому элементу матрицы и возвращает матрицу результатов.

ApplyOverMatrix2
ApplyOverMatrix2 (a,b,func)

Применяет функцию к каждому элементу двух матриц (или 1 значению и 1 матрице) и возвращает матрицу результатов.

ColumnsOf
ColumnsOf (M)

Возвращает столбцы матрицы в виде горизонтального вектора.

ComplementSubmatrix
ComplementSubmatrix (m,r,c)

Remove column(s) and row(s) from a matrix.

CompoundMatrix
CompoundMatrix (k,A)

Calculate the kth compound matrix of A.

CountZeroColumns
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
DeleteColumn (M,столбец)

Удаляет столбец матрицы.

DeleteRow
DeleteRow (M,строка)

Удаляет строку матрицы.

DiagonalOf
DiagonalOf (M)

Gets the diagonal entries of a matrix as a column vector.

See Wikipedia for more information.

DotProduct
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; This is the bilinear scalar product not the sesquilinear scalar product. See HermitianProduct for the standard sesquilinear inner product.

See Wikipedia or Planetmath for more information.

ExpandMatrix
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
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 Wikipedia or Mathworld for more information.

I
I (n)

Aliases: eye

Return an identity matrix of a given size, that is n by n. If n is zero, returns null.

See Wikipedia or Planetmath for more information.

IndexComplement
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
IsDiagonal (M)

Является ли матрица диагональной.

See Wikipedia or Planetmath for more information.

IsIdentity
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
IsLowerTriangular (M)

Является ли матрица нижнетреугольной, то есть все её элементы над диагональю равны нулю.

IsMatrixInteger
IsMatrixInteger (M)

Check if a matrix is a matrix of integers (non-complex).

IsMatrixNonnegative
IsMatrixNonnegative (M)

Check if a matrix is non-negative, that is if each element is non-negative. Do not confuse positive matrices with positive semi-definite matrices.

See Wikipedia for more information.

IsMatrixPositive
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
IsMatrixRational (M)

Проверяет, является ли матрица матрицей из рациональных (не комплексных) чисел.

IsMatrixReal
IsMatrixReal (M)

Проверяет, является ли матрица матрицей из действительных (не комплексных) чисел.

IsMatrixSquare
IsMatrixSquare (M)

Проверяет, является ли матрица квадратной, то есть её ширина равна высоте.

IsUpperTriangular
IsUpperTriangular (M)

Is a matrix upper triangular? That is, a matrix is upper triangular if all the entries below the diagonal are zero.

IsValueOnly
IsValueOnly (M)

Проверяет, состоит ли матрица только из чисел. Многие встроенные функции делают эту проверку. Значения могут быть любыми числами, включая комплексные.

IsVector
IsVector (v)

Является ли аргумент горизонтальным или вертикальным вектором. Genius не делает различий между матрицей и вектором: вектор — это просто матрица 1 на n или n на 1.

IsZero
IsZero (x)

Проверяет, состоит ли матрица из одних нулей. Также работает с числами, в этом случае эквивалентна выражению x==0. Если переменная x равна null (можно представить это, как матрицу 0 на 0 элементов), ошибка не генерируется и возвращается true, так как условие является бессмысленным.

LowerTriangular
LowerTriangular (M)

Возвращает копию матрицы M, в которой все элементы под диагональю заменены нулями.

MakeDiagonal
MakeDiagonal (v,arg...)

Псевдоним: diag

Создаёт диагональную матрицу из вектора. Значения для диагонали также могут быть переданы в виде аргументов функции. Поэтому MakeDiagonal([1,2,3]) — то же самое, что и MakeDiagonal(1,2,3).

See Wikipedia or Planetmath for more information.

MakeVector
MakeVector (A)

Alias: MakeColumnVector

Make column vector out of matrix by putting columns above each other. Returns null when given null. Can be used to ensure a vector is a column vector.

MakeRowVector
MakeRowVector (A)

Make row vector out of matrix by putting rows one after another. Returns null when given null. Can be used to ensure a vector is a row vector.

MatrixProduct
MatrixProduct (A)

Вычисляет произведение всех элементов матрицы или вектора. То есть, умножает друг на друга все элементы и возвращает число, являющееся их произведением.

MatrixSum
MatrixSum (A)

Вычисляет сумму всех элементов матрицы или вектора. То есть, складывает все элементы и возвращает число, являющееся их суммой.

MatrixSumSquares
MatrixSumSquares (A)

Вычисляет сумму квадратов всех элементов матрицы или вектора.

NonzeroColumns
NonzeroColumns (M)

Returns a row vector of the indices of nonzero columns in the matrix M.

Version 1.0.18 onwards.

NonzeroElements
NonzeroElements (v)

Returns a row vector of the indices of nonzero elements in the vector v.

Version 1.0.18 onwards.

OuterProduct
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
ReverseVector (v)

Reverse elements in a vector. Return null if given null

RowSum
RowSum (m)

Вычисляет суммы элементов в каждой строке матрицы и возвращает вертикальный вектор с результатом.

RowSumSquares
RowSumSquares (m)

Вычисляет суммы квадратов элементов в каждой строке матрицы и возвращает вертикальный вектор с результатами.

RowsOf
RowsOf (M)

Gets the rows of a matrix as a vertical vector. Each element of the vector is a horizontal vector that 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
SetMatrixSize (M,строки,столбцы)

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.

ShuffleVector
ShuffleVector (v)

Shuffle elements in a vector. Return null if given null.

Version 1.0.13 onwards.

SortVector
SortVector (v)

Sort vector elements in an increasing order.

StripZeroColumns
StripZeroColumns (M)

Удаляет все состоящие только из нулей столбцы матрицы M.

StripZeroRows
StripZeroRows (M)

Удаляет все состоящие только из нулей строки матрицы M.

Submatrix
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
SwapRows (m,строка1,строка2)

Меняет местами две строки матрицы.

UpperTriangular
UpperTriangular (M)

Возвращает копию матрицы M, в которой все элементы под диагональю заменены нулями.

columns
columns (M)

Возвращает число столбцов в матрице.

elements
elements (M)

Возвращает общее число элементов в матрице. Это число столбцов, умноженное на число строк.

ones
ones (строки,столбцы...)

Создаёт матрицу, состоящую только из единиц (или строчный вектор, если задан только один аргумент). Возвращает null, если задано число строк или столбцов, равное нулю.

rows
rows (M)

Возвращает число строк в матрице.

zeros
zeros (строки,столбцы...)

Создаёт матрицу, состоящую только из единиц (или строчный вектор, если задан только один аргумент). Возвращает null, если задано число строк или столбцов, равное нулю.