51 unsigned int i,
j,
center, finished = 0;
63 for (k = 0; k <
maxit; k++) {
67 for (
j = 0;
j < (
unsigned int)rows;
j++) {
71 for (i = 0; i < (
unsigned int)rows; i++) {
74 for (
j = 0;
j < Asp[i]->
cols;
j++) {
76 if (Asp[i]->index[
j] == i)
81 for (
j = 0;
j < (
unsigned int)rows;
j++) {
88 G_message(
_(
"sparse Jacobi -- iteration %5i error %g\n"), k,
err);
125 unsigned int i,
j, finished = 0;
139 for (k = 0; k <
maxit; k++) {
143 for (
j = 0;
j < (
unsigned int)rows;
j++) {
147 for (i = 0; i < (
unsigned int)rows; i++) {
150 for (
j = 0;
j < Asp[i]->
cols;
j++) {
152 if (Asp[i]->index[
j] == i)
157 for (
j = 0;
j < (
unsigned int)rows;
j++) {
164 G_message(
_(
"sparse SOR -- iteration %5i error %g\n"), k,
err);
209 for (
j = 0;
j < rows;
j++) {
213 for (k = 0; k <
maxit; k++) {
214 for (i = 0; i < rows; i++) {
216 for (
j = 0;
j < rows;
j++) {
219 Enew[i] =
x[i] -
sor * (E -
b[i]) / A[i][i];
222 for (
j = 0;
j < rows;
j++) {
268 for (
j = 0;
j < rows;
j++) {
272 for (k = 0; k <
maxit; k++) {
273 for (i = 0; i < rows; i++) {
275 for (
j = 0;
j < rows;
j++) {
278 Enew[i] =
x[i] -
sor * (E -
b[i]) / A[i][i];
281 for (
j = 0;
j < rows;
j++) {
void G_free(void *)
Free allocated memory.
void G_message(const char *,...) __attribute__((format(printf
double * G_alloc_vector(size_t)
Vector matrix memory allocation.
#define assert(condition)
int G_math_solver_sparse_jacobi(G_math_spvector **Asp, double *x, double *b, int rows, int maxit, double sor, double error)
The iterative jacobi solver for sparse matrices.
int G_math_solver_sparse_gs(G_math_spvector **Asp, double *x, double *b, int rows, int maxit, double sor, double error)
The iterative gauss seidel solver for sparse matrices.
int G_math_solver_jacobi(double **A, double *x, double *b, int rows, int maxit, double sor, double error)
The iterative jacobi solver for quadratic matrices.
int G_math_solver_gs(double **A, double *x, double *b, int rows, int maxit, double sor, double error)
The iterative gauss seidel solver for quadratic matrices.
The row vector of the sparse matrix.
SYMBOL * err(FILE *fp, SYMBOL *s, char *msg)