GRASS Programmer's Manual  6.4.4(2014)-r
N_solvers.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.c:

Go to the source code of this file.

Functions

int N_solver_gauss (N_les *les)
 The gauss elimination solver for quardatic matrices. More...
 
int N_solver_lu (N_les *les)
 The LU solver for quardatic matrices. More...
 
int N_solver_cholesky (N_les *les)
 The choleksy decomposition solver for quardatic, symmetric positiv definite matrices. More...
 
void thomalg (double **M, double *V, int rows)
 
double * vectmem (int rows)
 Allocate vector memory. More...
 

Function Documentation

int N_solver_cholesky ( N_les les)

The choleksy decomposition solver for quardatic, symmetric positiv definite matrices.

This solver does not support sparse matrices The matrix A will be overwritten. The result is written to the vector x in the N_les structure

Parameters
lesN_les *
Returns
int – 1 success, 0 solver does not work with sprase matrices, -1 matrix is not quadratic, -2 unable to solve the les, -3 matrix is not symmetric

Definition at line 152 of file N_solvers.c.

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

int N_solver_gauss ( N_les les)

The gauss elimination solver for quardatic matrices.

This solver does not support sparse matrices The matrix A will be overwritten. The result is written to the vector x in the N_les structure

Parameters
lesN_les *
Returns
int – 1 success, 0 solver does not work with sprase matrices, -1 matrix is not quadratic, -2 unable to solve the les

Definition at line 46 of file N_solvers.c.

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

int N_solver_lu ( N_les les)

The LU solver for quardatic matrices.

This solver does not support sparse matrices The matrix A will be overwritten. The result is written to the vector x in the N_les structure

Parameters
lesN_les *
Returns
int – 1 success, 0 solver does not work with sprase matrices, -1 matrix is not quadratic, -2 unable to solve the les

Definition at line 82 of file N_solvers.c.

References N_les::A, N_les::b, G_free(), G_message(), G_warning(), N_les_pivot_create(), N_NORMAL_LES, N_les::quad, N_les::rows, N_les::type, vectmem(), and N_les::x.

void thomalg ( double **  M,
double *  V,
int  rows 
)

Definition at line 379 of file N_solvers.c.

References b, g, G_free(), and vectmem().

double* vectmem ( int  rows)

Allocate vector memory.

Parameters
rowsint
Returns
double *

Definition at line 423 of file N_solvers.c.

Referenced by N_solver_bicgstab(), N_solver_cg(), N_solver_lu(), N_solver_pcg(), and thomalg().