GRASS Programmer's Manual  6.4.2(2012)
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
N_solvers_classic_iter.c File Reference
#include <math.h>
#include <unistd.h>
#include <stdio.h>
#include <string.h>
#include "grass/N_pde.h"
#include "solvers_local_proto.h"
Include dependency graph for N_solvers_classic_iter.c:

Go to the source code of this file.

Functions

int N_solver_jacobi (N_les *L, int maxit, double sor, double error)
 The iterative jacobian solver for regular matrices.
int N_solver_SOR (N_les *L, int maxit, double sor, double error)
 The iterative overrelaxed gauss seidel solver for regular matrices.

Function Documentation

int N_solver_jacobi ( N_les L,
int  maxit,
double  sor,
double  error 
)

The iterative jacobian solver for regular matrices.

The result is written to the vector L->x of the les. This iterative solver works with sparse matrices and regular quadratic matrices.

The parameter maxit specifies the maximum number of iterations. If the maximum is reached, the solver will abort the calculation and writes the current result into the vector L->x. The parameter err defines the error break criteria for the solver.

Parameters
LN_les * – the linear equatuin system
maxitint – the maximum number of iterations
sordouble – defines the successive overrelaxion parameter [0:1]
errordouble – defines the error break criteria
Returns
int – 1=success, -1=could not solve the les

Definition at line 53 of file N_solvers_classic_iter.c.

References N_les::A, N_les::b, G_warning(), jacobi(), N_NORMAL_LES, N_SOLVER_ITERATIVE_JACOBI, N_les::quad, N_les::rows, N_les::type, and N_les::x.

int N_solver_SOR ( N_les L,
int  maxit,
double  sor,
double  error 
)

The iterative overrelaxed gauss seidel solver for regular matrices.

The result is written to the vector L->x of the les. This iterative solver works with sparse matrices and regular quadratic matrices.

The parameter maxit specifies the maximum number of iterations. If the maximum is reached, the solver will abort the calculation and writes the current result into the vector L->x. The parameter err defines the error break criteria for the solver.

Parameters
LN_les * – the linear equatuin system
maxitint – the maximum number of iterations
sordouble – defines the successive overrelaxion parameter [0:1]
errordouble – defines the error break criteria
Returns
int – 1=success, -1=could not solve the les

Definition at line 90 of file N_solvers_classic_iter.c.

References N_les::A, N_les::b, G_warning(), N_NORMAL_LES, N_SOLVER_ITERATIVE_SOR, N_les::quad, N_les::rows, N_les::type, and N_les::x.