The fundamental tools of linear algebra are vectors and matrices, which are addressed in the chapter, Mathematical Objects. This chapter deals with the operations that can be carried out on vectors and matrices and other functions that take them as arguments.
Arithmetic operations with vectors and matrices (addition, subtraction and multiplication) are denoted by the usual symbols of wiris.
plus: command +
Vector or matrix addition. Operands must be of the same type and have the same dimensions.
|
subtraction: command -
Vector or matrix addition.
Operands must be of the same type and have the same dimensions.
|
times: command * or ·
Product of matrices or scalar product of vectors.
The number of columns in the first operand must be the same as the number of rows in the second. In wiris,
all vectors are row vectors, but this is not a restriction. In order to multiply a matrix by a row vector, the vector is considered as a column vector as long as this permits multiplying.
The symbol * always appears as · in accordance with typographical convention.
|
multiplication by scalars: command * or ·
Product of a vector or matrix by a scalar.
The symbol, * , always appears as · in accordance with typographical convention.
|
scalar product: Icon
, command * or ·
Scalar product of two vectors of the same length.
The symbol * always appears as · in accordance with typographical convention.
|
inverse: Icon
, command inverse
Inverse matrix.
If the matrix can be inverted, its inverse is returned.. If the matrix cannot be inverted, an error is returned.
|
exponentiation: Icon
, command ^
A square matrix can be raised to a whole number power. If we raise it to a negative power and the matrix can be inverted, the inverse of the matrix is raised to the absolute value of the exponent. If the matrix cannot be inverted, an error is returned.
|
length: command length
If applied to a vector, the number of components is obtained; if applied to a matrix, the number of rows is obtained.
|
dimensions: command dimensions
wiris returns the sequence formed by the number of rows and the number of columns in a matrix, respectively.
|
rank: command rank
Calculates the rank of a matrix.
|
minor: command minor
Given a square matrix, A and two integers i and j, this calculates the minor corresponding to the position Aij
of the matrix. This minor is the determinant of the matrix obtained by eliminating, from A the row i and the column j.
|
|