int vsip_lusol_f(const vsip_lu_f* lud, const vsip_vview_f* b, const vsip_vview_f* x); int vsip_clusol_f(const vsip_clu_f* lud, const vsip_cvview_f* b, const vsip_cvview_f* x);
This function solves a system a linear square system int the forms of:



Where the matrix
has previously been decomposed using the function vsip_dlud_p . Whether the matrix A is transposed
depends on the given argument provided.
const vsip_dlu_f* lud: Pointer to the LU decomposition object containing the decomposed factors of matrix
.
vsip_mat_op OpA: Operand for the input matrix
.
VSIP_MAT_NTRANS - Do not transpose.
VSIP_MAT_TRANS - Transpose.
VSIP_MAT_HERM - Hermitian (Complex only).
const vsip_dmview_f* xb: Pointer to the right-hand side matrix
of order
by
. On exit result matrix
.
Returns 0 on success.
Returns a non-zero value on error (e.g., if dimensions are incompatible or the matrix is singular).
vsip_lu_f *lu_obj; vsip_mview_f *a, *xb; // Assuming all objects have been properly initialized // First perform LU decomposition result = vsip_lud_f(lu_obj, a); if (result != 0) { // Handle decomposition error } // Then solve the linear system result = vsip_lusol_f(lu_obj, VSIP_MAT_NTRANS, xb); if (result != 0) { // Handle solve error }
The LU decomposition object must have been previously created and used to decompose a matrix.