Documentation
|
|
Modules | |
| norm | |
| Calculate the norm of a vector. | |
Functions | |
| array | inverse (const array &in) |
| Matrix inversion. More... | |
| array | matpow (const array &base, double exponent) |
| Matrix power. More... | |
| unsigned | rank (const array &in, double tolerance=1e-5) |
| Rank of matrix. More... | |
| template<typename T > | |
| T | det (const array &in) |
| Matrix determinant. More... | |
| array af::inverse | ( | const array & | in | ) |
Matrix inversion.
For a square matrix A, this function returns the regular inverse IA of the same size as A, such that the following relationship is valid:
matmul(A, IA) = I
where I is an identity matrix of the same dimensions as A and IA.
If the input matrix is not square, the inverse operation swaps the rows and columns of the matrix and calculates what is sometimes called the pseudo-inverse.
| matrix | rows | columns |
|---|---|---|
| input matrix | m | n |
| inverse matrix | n | m |
Further, for non-square input matrices, it is always a multiplication of the flat matrix (m < n) and the tall matrix (m > n) that gives the identity matrix, as illustrated below for a flat matrix A of size 2 x 6 and a tall matrix B of size 6 x 2. The size of the (square) identity matrix is the minimum of m and n, which in the figure below is 2.
So depending on the orientation (tall or flat) of the input matrix, we either pre-multiply or post-multiply the (pseudo) inverse matrix to get the identity matrix.
Double-precision or complex input requires ArrayFire Pro.
| [in] | in | square system matrix |
| array af::matpow | ( | const array & | base, |
| double | exponent | ||
| ) |
Matrix power.
Calculates the input array (typically a 2D matrix) raised to the specified exponent.
Double-precision or complex input requires ArrayFire Pro.
| [in] | base | square |
| [in] | exponent |
base raised to exponent | unsigned af::rank | ( | const array & | in, |
| double | tolerance = 1e-5 |
||
| ) |
Double-precision or complex input requires ArrayFire Pro.
| [in] | in | |
| [in] | tolerance | only consider singular values greater than this |
| T af::det | ( | const array & | in | ) |
Double-precision or complex input requires ArrayFire Pro.
| [in] | in | square |