grass  7.8.6
About: GRASS (Geographic Resources Analysis Support System) is a raster- and vector-based GIS, image processing system, graphics production system and spatial modeling system.
  Fossies Dox: grass-7.8.6.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

solvers_classic_iter.c File Reference
#include <math.h>
#include <unistd.h>
#include <stdio.h>
#include <string.h>
#include <grass/gis.h>
#include <grass/glocale.h>
#include <grass/gmath.h>
Include dependency graph for solvers_classic_iter.c:

Go to the source code of this file.

Functions

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. More...
 
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. More...
 
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. More...
 
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. More...
 

Function Documentation

◆ G_math_solver_gs()

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 Jacobi solver solves the linear equation system Ax = b The result is written to the vector x.

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 x. The parameter err defines the error break criteria for the solver.

Parameters
Adouble ** – the dense matrix
xdouble * – the vector of unknowns
bdouble * – the right side vector
rowsint – number of rows
maxitint – the maximum number of iterations
sordouble – defines the successive overrelaxion parameter [0:2]
errordouble – defines the error break criteria
Returns
int – 1=success, -1=could not solve the les

Definition at line 247 of file solvers_classic_iter.c.

References _, A, b, err(), G_alloc_vector(), G_message(), and x.

◆ G_math_solver_jacobi()

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.

The Jacobi solver solves the linear equation system Ax = b The result is written to the vector x.

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 x. The parameter err defines the error break criteria for the solver.

Parameters
Adouble ** – the dense matrix
xdouble * – the vector of unknowns
bdouble * – the right side vector
rowsint – number of rows
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 190 of file solvers_classic_iter.c.

References _, A, b, err(), G_alloc_vector(), G_message(), and x.

◆ G_math_solver_sparse_gs()

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.

The Jacobi solver solves the linear equation system Ax = b The result is written to the vector x.

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 x. The parameter err defines the error break criteria for the solver.

Parameters
AspG_math_spvector ** – the sparse matrix
xdouble * – the vector of unknowns
bdouble * – the right side vector
rowsint – number of rows
maxitint – the maximum number of iterations
sordouble – defines the successive overrelaxion parameter [0:2]
errordouble – defines the error break criteria
Returns
int – 1=success, -1=could not solve the les

Definition at line 118 of file solvers_classic_iter.c.

References _, b, G_math_spvector::cols, err(), G_alloc_vector(), G_free(), G_message(), G_math_spvector::index, G_math_spvector::values, and x.

◆ G_math_solver_sparse_jacobi()

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.

MODULE: Grass numerical math interface AUTHOR(S): Soeren Gebbert, Berlin (GER) Dec 2006 soerengebbert <at> googlemail <dot> com

PURPOSE: linear equation system solvers part of the gmath library

COPYRIGHT: (C) 2010 by the GRASS Development Team

          This program is free software under the GNU General Public
          License (>=v2). Read the file COPYING that comes with GRASS
          for details.

The Jacobi solver solves the linear equation system Ax = b The result is written to the vector x.

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 x. The parameter err defines the error break criteria for the solver.

Parameters
AspG_math_spvector ** – the sparse matrix
xdouble * – the vector of unknowns
bdouble * – the right side vector
rowsint – number of rows
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 48 of file solvers_classic_iter.c.

References _, b, G_math_spvector::cols, err(), G_alloc_vector(), G_free(), G_message(), G_math_spvector::index, G_math_spvector::values, and x.