![]() |
![]() |
Collaboration diagram for DSPF_dp_lud_solver_cmplx:
|
| int | DSPF_dp_lud_solver_cmplx (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_cmplx | ( | 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.
| Nrows | = number of rows in square complex matrix A | |
| P | = pointer to permutation matrix P[Nrows*Nrows] | |
| L | = pointer to lower triangular matrix complex L[2*Nrows*Nrows] | |
| U | = pointer to upper triangular matrix complex U[2*Nrows*Nrows] | |
| b | = pointer to complex vector b[2*Nrows] | |
| b_mod | = pointer to modified complex vector b_mod[2*Nrows] | |
| y | = pointer to temporary complex vector y[2*Nrows] | |
| x | = pointer to final solver output complex vector x[2*Nrows] |