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 to solve 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 to solve 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\), \(A * X = B\).

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);

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

This function is beneficial over 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 to solve a system of equations.

The options parameter currently must be AF_MAT_NONE.

Parameters
[out]xmatrix of unknown variables
[in]apacked LU decomposition of the coefficient matrix
[in]pivpivot array from the packed LU decomposition of the coefficient matrix
[in]bmeasured values
[in]optionsdetermines various properties of matrix a
Returns
AF_SUCCESS, if function returns successfully, else an af_err code is given

◆ solveLU()

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

C++ Interface to solve a system of equations.

The options parameter currently must be AF_MAT_NONE.

This function is not supported in GFOR.

Parameters
[in]apacked LU decomposition of the coefficient matrix
[in]pivpivot array from the packed LU decomposition of the coefficient matrix
[in]bmeasured values
[in]optionsdetermines various properties of matrix a
Returns
x, the matrix of unknown variables