Collaboration diagram for DSPF_dp_lud_solver:
int | DSPF_dp_lud_solver (const int order, unsigned short *restrict P, double *restrict L, double *restrict U, double *restrict b, double *restrict b_mod, double *restrict y, double *restrict x) |
int DSPF_dp_lud_solver | ( | const int | order, | |
unsigned short *restrict | P, | |||
double *restrict | L, | |||
double *restrict | U, | |||
double *restrict | b, | |||
double *restrict | b_mod, | |||
double *restrict | y, | |||
double *restrict | x | |||
) |
This function solves the system of linear equations A*x=b for x using the inputs produced by DSPF_dp_lud where A*x=transpose(P)*L*U*x=b. The following procedure is performed.
1. Modify b using permutation matrix: b_mod = L*U*x = P*b
2. Use forward substitution to solve for y: y = U*x = inv(L)*b_mod
3. Use backward substitution for solve for x: x = inv(U)*y
The values stored in the matrices are assumed to be double precision floating point values. This code is suitable for dense matrices. No optimizations are made for sparse matrices.
order | = order of matrix A | |
P | = pointer to permutation matrix P[order*order] | |
L | = pointer to lower triangular matrix L[order*order] | |
U | = pointer to upper triangular matrix U[order*order] | |
b | = pointer to vector b[order] | |
b_mod | = pointer to modified vector b_mod[order] | |
y | = pointer to temporary vector y[order] | |
x | = pointer to final solver output vector x[order] |