39 int row, col, kdx, nrow;
47 for (row=1; row<BLOCK; row++) {
50 for (col=1; col<BLOCK; col++) {
54 for (kdx=0; kdx<col; kdx++)
55 val += A[nrow+kdx] * A[col + BLOCK*kdx];
56 A[nrow+col] = (A[nrow+col] - val)/A[(BLOCK+1)*col];
62 for (kdx=0; kdx<row; kdx++)
63 val += A[nrow+kdx]*A[BLOCK*kdx+col];
86 for (row=1; row<BLOCK; row++) {
89 for (col=0; col<row; col++)
90 val += LU[nrow+col]*b[col];
95 b[BLOCK-1] /= LU[BLOCK*BLOCK-1];
96 for (row=BLOCK-2; row>-1; row--) {
98 for (col=row+1; col<BLOCK; col++)
99 val += LU[nrow+col]*b[col];
100 b[row] = (b[row] - val)/LU[nrow+row];
116 for (scol=0; scol<BLOCK; scol++) B[scol*BLOCK] /= LU[0];
117 for (row=1; row<BLOCK; row++) {
118 for (scol=0; scol<BLOCK; scol++) {
120 for (col=0; col<row; col++)
121 val += B[scol*BLOCK+col] * LU[col*BLOCK+row];
122 B[scol*BLOCK+row] = (B[scol*BLOCK+row] - val)/LU[row*BLOCK+row];
127 for (row=BLOCK-2; row>-1; row--) {
128 for (scol=0; scol<BLOCK; scol++) {
130 for (col=row+1; col<BLOCK; col++)
131 val += B[scol*BLOCK+col] * LU[col*BLOCK+row];
132 B[scol*BLOCK+row] -= val;
void lusub(UCFD_FLOAT *LU, UCFD_FLOAT *b)
Forward/Backward substitution function.
void lusubmattrans(UCFD_FLOAT *LU, UCFD_FLOAT *B)
Forward/Backward substitution for transposed matrix.
void ludcmp(UCFD_FLOAT *A)
LU Decomposition function.