double StressMajorizationSmoother_smooth(StressMajorizationSmoother sm, int dim, double *x, int maxit_sm, double tol) {
SparseMatrix Lw = sm->Lw, Lwd = sm->Lwd, Lwdd = NULL;
- int i, j, k, m, *id, *jd, *iw, *jw, idiag, flag = 0, iter = 0;
+ int i, j, k, m, *id, *jd, *iw, *jw, idiag, iter = 0;
double *w, *dd, *d, *y = NULL, *x0 = NULL, *x00 = NULL, diag, diff = 1, *lambda = sm->lambda, alpha = 0., M = 0.;
SparseMatrix Lc = NULL;
double dij, dist;
if (sm->scheme == SM_SCHEME_UNIFORM_STRESS){
uniform_stress_solve(Lw, alpha, dim, x, y, sm->tol_cg, sm->maxit_cg);
} else {
- SparseMatrix_solve(Lw, dim, x, y, sm->tol_cg, sm->maxit_cg, &flag);
+ SparseMatrix_solve(Lw, dim, x, y, sm->tol_cg, sm->maxit_cg);
}
- if (flag) goto RETURN;
#ifdef DEBUG_PRINT
if (Verbose) fprintf(stderr, "stress2 = %g\n",get_stress(m, dim, iw, jw, w, d, y, sm->scaling));
#endif
return res;
}
-double SparseMatrix_solve(SparseMatrix A, int dim, double *x0, double *rhs, double tol, int maxit, int *flag){
+double SparseMatrix_solve(SparseMatrix A, int dim, double *x0, double *rhs, double tol, int maxit){
Operator Ax, precond;
int n = A->m;
double res = 0;
- *flag = 0;
Ax = Operator_matmul_new(A);
precond = Operator_diag_precon_new(A);
double cg(Operator Ax, Operator precond, int n, int dim, double *x0, double *rhs, double tol, int maxit);
-double SparseMatrix_solve(SparseMatrix A, int dim, double *x0, double *rhs, double tol, int maxit, int *flag);
+double SparseMatrix_solve(SparseMatrix A, int dim, double *x0, double *rhs, double tol, int maxit);
Operator Operator_uniform_stress_matmul(SparseMatrix A, double alpha);