Reformat. Merge improved solvers.

This commit is contained in:
2023-11-21 05:27:11 +01:00
parent acc831e0b0
commit 2fad29b925
11 changed files with 655 additions and 176 deletions

View File

@@ -39,10 +39,14 @@ int main(int argc, char** argv)
}
readParameter(&params, argv[1]);
printParameter(&params);
// printParameter(&params);
if (argc == 3) {
variant = atoi(argv[2]);
}
if (argc == 4) {
sscanf("%lf", argv[2], &params.omg);
sscanf("%lf", argv[2], &params.rho);
}
initSolver(&solver, &params, 2);
switch (variant) {
@@ -59,8 +63,8 @@ int main(int argc, char** argv)
LIKWID_PROFILE("RBA", solveRBA);
break;
}
printf("Solution took %.2fs\n", endTime - startTime);
writeResult(&solver);
printf(" %.2fs\n", endTime - startTime);
// writeResult(&solver);
LIKWID_MARKER_CLOSE;
return EXIT_SUCCESS;

View File

@@ -108,7 +108,8 @@ void solve(Solver* solver)
it++;
}
printf("Solver took %d iterations to reach %f\n", it, sqrt(res));
// printf("Solver took %d iterations to reach %f\n", it, sqrt(res));
printf("%d, %f\n", it, solver->omega);
}
void solveRB(Solver* solver)
@@ -168,7 +169,8 @@ void solveRB(Solver* solver)
it++;
}
printf("Solver took %d iterations to reach %f\n", it, sqrt(res));
// printf("Solver took %d iterations to reach %f\n", it, sqrt(res));
printf("%d, %f\n", it, solver->omega);
}
void solveRBA(Solver* solver)
@@ -232,8 +234,9 @@ void solveRBA(Solver* solver)
it++;
}
printf("Final omega: %f\n", omega);
printf("Solver took %d iterations to reach %f\n", it, sqrt(res));
// printf("Final omega: %f\n", omega);
// printf("Solver took %d iterations to reach %f\n", it, sqrt(res));
printf("%d, %f\n", it, omega);
}
void writeResult(Solver* solver)