You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (r < m) {
FORD (i, r - 1, -1) {
int f_cnt = 0, k = -1;
FOR (j, 0, m)
if (sgn(a[i][j]) && free_x[j]) {
++f_cnt;
k = j;
}
if(f_cnt > 0) continue;
LD s = a[i][m];
FOR (j, 0, m)
if (j != k) s -= a[i][j] * x[j];
x[k] = s / a[i][k];
free_x[k] = 0;
}
return m - r;
}
链接:数学--高斯消元
代码最后部分
k没有用,因为如果不满足
f_cnt > 0
,k必为-1所以,
if(f_cnt > 0) continue;
这一行之后的代码没有任何意义The text was updated successfully, but these errors were encountered: