A high-performance general-purpose compute library

Solve a system of equations. More...

Functions

AFAPI array solveLU (const array &a, const array &piv, const array &b, const matProp options=AF_MAT_NONE)
 C++ Interface for solving a system of equations.
 
AFAPI af_err af_solve_lu (af_array *x, const af_array a, const af_array piv, const af_array b, const af_mat_prop options)
 C Interface for solving a system of equations.
 

Detailed Description

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

 \f$A * X = B\f$

This operation can be done in ArrayFire using the following code snippet.

af::array A_lu, pivot;
af::lu(A_lu, pivot, A);
af::array X1 = af::solveLU(A_lu, pivot, B0);
A multi dimensional data container.
Definition: array.h:37
AFAPI void lu(array &out, array &pivot, const array &in, const bool is_lapack_piv=true)
C++ Interface for LU decomposition in packed format.
AFAPI array solveLU(const array &a, const array &piv, const array &b, const matProp options=AF_MAT_NONE)
C++ Interface for solving a system of equations.

This function along with af::lu split up the task af::solve performs for square matrices.

Note
This function is beneficial over af::solve only in long running application where the coefficient matrix A stays the same, but the observed variables keep changing.

Function Documentation

◆ af_solve_lu()

AFAPI af_err af_solve_lu ( af_array x,
const af_array  a,
const af_array  piv,
const af_array  b,
const af_mat_prop  options 
)

C Interface for solving a system of equations.

Parameters
[out]xwill contain the matrix of unknown variables
[in]ais the output matrix from packed LU decomposition of the coefficient matrix
[in]pivis the pivot array from packed LU decomposition of the coefficient matrix
[in]bis the matrix of measured values
[in]optionsdetermining various properties of matrix a
Note
options currently needs to be AF_MAT_NONE
This function is not supported in GFOR

◆ solveLU()

AFAPI array solveLU ( const array a,
const array piv,
const array b,
const matProp  options = AF_MAT_NONE 
)

C++ Interface for solving a system of equations.

Parameters
[in]ais the output matrix from packed LU decomposition of the coefficient matrix
[in]pivis the pivot array from packed LU decomposition of the coefficient matrix
[in]bis the matrix of measured values
[in]optionsdetermining various properties of matrix a
Returns
x, the matrix of unknown variables
Note
options currently needs to be AF_MAT_NONE
This function is not supported in GFOR