Solve a system of equations. More...
|AFAPI array||solve (const array &a, const array &b, const matProp options=AF_MAT_NONE)|
|C++ Interface for solving a system of equations. More...|
|AFAPI af_err||af_solve (af_array *x, const af_array a, const af_array b, const af_mat_prop options)|
|C Interface for solving a system of equations. More...|
Solve a system of equations.
This function takes a co-efficient matrix A and an output matrix B as inputs to solve the following equation for X
\(A * X = B\)
This operation can be done in ArrayFire using the following code snippet.
The results can be verified by reconstructing the output matrix using af::matmul in the following manner.
The sample output can be seen below
The sample code snippets for solving a lower triangular matrix can be seen below.
Similarily, the code snippet for solving an upper triangular matrix can be seen below.
See also: af::solveLU
|AFAPI af_err af_solve||(||af_array *||x,|
C++ Interface for solving a system of equations.
|[in]||a||is the coefficient matrix|
|[in]||b||is the measured values|
|[in]||options||determining various properties of matrix |
x, the matrix of unknown variables