31 #ifndef TOON_INC_GAUSS_JORDAN_H
32 #define TOON_INC_GAUSS_JORDAN_H
55 for(
int col=0; col < m.num_rows(); col++)
69 double pivotval =
abs(m[pivotpos][col]);
70 for(
int p=col+1; p <m.num_rows(); p++)
71 if(
abs(m[p][col]) > pivotval)
74 pivotval =
abs(m[pivotpos][col]);
78 for(
int c=0; c < m.num_cols(); c++)
79 swap(m[col][c], m[pivotpos][c]);
84 for(
int row = 0; row < m.num_rows(); row++)
88 double multiple = m[row][col] / m[col][col];
97 for(
int c=col+1; c < m.num_cols(); c++)
98 m[row][c] = m[row][c] - m[col][c] * multiple;
106 for(
int row=0;row < m.num_rows(); row++)
108 double mul = 1/m[row][row];
112 for(
int col=m.num_rows(); col < m.num_cols(); col++)
Everything lives inside this namespace.
void gauss_jordan(Matrix< R, C, Precision, Base > &m)