85 for (
int i = 0; i < m; i++) {
94 for (
int j = 0; j <
n; j++) {
98 for (
int i = 0; i < m; i++) {
99 LUcolj[i] = LU_[i][j];
104 for (
int i = 0; i < m; i++) {
109 int kmax = std::min(i,j);
111 for (
int k = 0; k < kmax; k++) {
112 s += LUrowi[k]*LUcolj[k];
115 LUrowi[j] = LUcolj[i] -= s;
121 for (
int i = j+1; i < m; i++) {
122 if (abs(LUcolj[i]) > abs(LUcolj[p])) {
128 for (k = 0; k <
n; k++) {
129 double t = LU_[p][k];
130 LU_[p][k] = LU_[j][k];
141 if ((j < m) && (LU_[j][j] != 0.0)) {
142 for (
int i = j+1; i < m; i++) {
143 LU_[i][j] /= LU_[j][j];