GRASS GIS 8 Programmer's Manual
8.5.0dev(2024)-847944e18e
|
#include <math.h>
#include <unistd.h>
#include <stdio.h>
#include <string.h>
#include <grass/gis.h>
#include <grass/gmath.h>
#include <grass/glocale.h>
Go to the source code of this file.
Macros | |
#define | TINY 1.0e-20 |
#define | COMP_PIVOT 100 |
Functions | |
int | G_math_solver_gauss (double **A, double *x, double *b, int rows) |
The gauss elimination solver for quardatic matrices. More... | |
int | G_math_solver_lu (double **A, double *x, double *b, int rows) |
The LU solver for quardatic matrices. More... | |
int | G_math_solver_cholesky (double **A, double *x, double *b, int bandwidth, int rows) |
The choleksy decomposition solver for quardatic, symmetric positive definite matrices. More... | |
void | G_math_gauss_elimination (double **A, double *b, int rows) |
Gauss elimination. More... | |
void | G_math_lu_decomposition (double **A, double *b UNUSED, int rows) |
lu decomposition More... | |
int | G_math_cholesky_decomposition (double **A, int rows, int bandwidth) |
cholesky decomposition for symmetric, positive definite matrices with bandwidth optimization More... | |
void | G_math_backward_substitution (double **A, double *x, double *b, int rows) |
backward substitution More... | |
void | G_math_forward_substitution (double **A, double *x, double *b, int rows) |
forward substitution More... | |
#define COMP_PIVOT 100 |
Definition at line 27 of file solvers_direct.c.
#define TINY 1.0e-20 |
Definition at line 26 of file solvers_direct.c.
void G_math_backward_substitution | ( | double ** | A, |
double * | x, | ||
double * | b, | ||
int | rows | ||
) |
backward substitution
A | double ** |
x | double * |
b | double * |
rows | int |
Definition at line 286 of file solvers_direct.c.
int G_math_cholesky_decomposition | ( | double ** | A, |
int | rows, | ||
int | bandwidth | ||
) |
cholesky decomposition for symmetric, positive definite matrices with bandwidth optimization
The provided matrix will be overwritten with the lower and upper triangle matrix A = LL^T
A | double ** |
rows | int |
bandwidth | int – the bandwidth of the matrix (0 > bandwidth <= cols) |
Definition at line 217 of file solvers_direct.c.
void G_math_forward_substitution | ( | double ** | A, |
double * | x, | ||
double * | b, | ||
int | rows | ||
) |
forward substitution
A | double ** |
x | double * |
b | double * |
rows | int |
Definition at line 310 of file solvers_direct.c.
void G_math_gauss_elimination | ( | double ** | A, |
double * | b, | ||
int | rows | ||
) |
Gauss elimination.
To run this solver efficiently, no pivoting is supported. The matrix will be overwritten with the decomposite form
A | double ** |
b | double * |
rows | int |
Definition at line 153 of file solvers_direct.c.
void G_math_lu_decomposition | ( | double ** | A, |
double *b | UNUSED, | ||
int | rows | ||
) |
lu decomposition
To run this solver efficiently, no pivoting is supported. The matrix will be overwritten with the decomposite form
A | double ** |
b | double * – this vector is needed if its part of the linear equation system, otherwise set it to NULL |
rows | int |
Definition at line 186 of file solvers_direct.c.
int G_math_solver_cholesky | ( | double ** | A, |
double * | x, | ||
double * | b, | ||
int | bandwidth, | ||
int | rows | ||
) |
The choleksy decomposition solver for quardatic, symmetric positive definite matrices.
This solver does not support sparse matrices The matrix A will be overwritten. The result is written to the vector x
A | double ** |
x | double * |
b | double * |
bandwidth | int – the bandwidth of the band matrix, if unsure set to rows |
rows | int |
Definition at line 124 of file solvers_direct.c.
int G_math_solver_gauss | ( | double ** | A, |
double * | x, | ||
double * | b, | ||
int | rows | ||
) |
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
A | double ** |
x | double * |
b | double * |
rows | int |
Definition at line 42 of file solvers_direct.c.
int G_math_solver_lu | ( | double ** | A, |
double * | x, | ||
double * | b, | ||
int | rows | ||
) |
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 G_math_les structure
A | double ** |
x | double * |
b | double * |
rows | int |
Definition at line 66 of file solvers_direct.c.