ArrayFire: inverse (original) (raw)
Invert a matrix. More...
| Functions | |
|---|---|
| AFAPI array | inverse (const array &in, const matProp options=AF_MAT_NONE) |
| C++ Interface to invert a matrix. More... | |
| AFAPI af_err | af_inverse (af_array *out, const af_array in, const af_mat_prop options) |
| C Interface to invert a matrix. More... | |
Invert a matrix.
This function inverts a square matrix \(A\). The code snippet to demonstrate this can be seen below.
array IA = inverse(A);
array I = matmul(A, IA);
The sample output can be seen below.
A [3 3 1 1]
0.0100 3.0100 6.0100
1.0100 4.0100 7.0000
2.0000 5.0000 8.0000
IA [3 3 1 1]
48.9076 -99.9927 50.7518
-99.1552 199.9852 -100.4968
49.7451 -99.9926 50.2475
I [3 3 1 1]
1.0000 0.0001 -0.0000
0.0000 1.0000 0.0000
0.0000 0.0000 1.0000
◆ af_inverse()
C Interface to invert a matrix.
The options parameter currently must be AF_MAT_NONE.
Parameters
| [out] | out | inverse matrix |
|---|---|---|
| [in] | in | input matrix |
| [in] | options | determines various properties of matrix in |
Returns
AF_SUCCESS, if function returns successfully, else an af_err code is given
C++ Interface to invert a matrix.
The options parameter currently must be AF_MAT_NONE.
This function is not supported in GFOR.
Parameters
| [in] | in | input matrix |
|---|---|---|
| [in] | options | determines various properties of matrix in |
Returns
inverse matrix