GRASS Programmer's Manual
6.5.svn(2014)-r66266
|
#include <stdlib.h>
#include <math.h>
#include <grass/gmath.h>
#include <grass/gis.h>
Go to the source code of this file.
Functions | |
int | G_math_add_spvector (G_math_spvector **Asp, G_math_spvector *spvector, int row) |
Adds a sparse vector to a sparse linear equation system at position row. More... | |
G_math_spvector ** | G_math_alloc_spmatrix (int rows) |
Allocate memory for a sparse matrix. More... | |
G_math_spvector * | G_math_alloc_spvector (int cols) |
Allocate memory for a sparse vector. More... | |
void | G_math_free_spvector (G_math_spvector *spvector) |
Release the memory of the sparse vector. More... | |
void | G_math_free_spmatrix (G_math_spvector **spmatrix, int rows) |
Release the memory of the sparse matrix. More... | |
void | G_math_print_spmatrix (G_math_spvector **Asp, int rows) |
print the sparse matrix Asp to stdout More... | |
double ** | G_math_Asp_to_A (G_math_spvector **Asp, int rows) |
Convert a sparse matrix into a quadratic matrix. More... | |
G_math_spvector ** | G_math_A_to_Asp (double **A, int rows, double epsilon) |
Convert a quadratic matrix into a sparse matrix. More... | |
G_math_spvector** G_math_A_to_Asp | ( | double ** | A, |
int | rows, | ||
double | epsilon | ||
) |
Convert a quadratic matrix into a sparse matrix.
This function is multi-threaded with OpenMP. It creates its own parallel OpenMP region.
A | (double **) |
rows | (int) |
epsilon | (double) – non-zero values are greater then epsilon |
Definition at line 207 of file sparse_matrix.c.
References count, G_math_add_spvector(), G_math_alloc_spmatrix(), G_math_alloc_spvector(), and NULL.
Adds a sparse vector to a sparse linear equation system at position row.
Return 1 for success and -1 for failure
spmatrix | G_math_spvector ** |
spvector | G_math_spvector * |
row | int |
Definition at line 35 of file sparse_matrix.c.
References G_debug(), and NULL.
Referenced by G_math_A_to_Asp(), N_assemble_les_2d_param(), and N_assemble_les_3d_param().
G_math_spvector** G_math_alloc_spmatrix | ( | int | rows | ) |
Allocate memory for a sparse matrix.
rows | int |
Definition at line 58 of file sparse_matrix.c.
References G_debug().
Referenced by G_math_A_to_Asp(), and N_alloc_les_param().
G_math_spvector* G_math_alloc_spvector | ( | int | cols | ) |
Allocate memory for a sparse vector.
cols | int |
Definition at line 76 of file sparse_matrix.c.
References dialogs::cols, and G_debug().
Referenced by G_math_A_to_Asp(), N_assemble_les_2d_param(), and N_assemble_les_3d_param().
double** G_math_Asp_to_A | ( | G_math_spvector ** | Asp, |
int | rows | ||
) |
Convert a sparse matrix into a quadratic matrix.
This function is multi-threaded with OpenMP. It creates its own parallel OpenMP region.
Asp | (G_math_spvector **) |
rows | (int) |
Definition at line 179 of file sparse_matrix.c.
References G_alloc_matrix(), and NULL.
void G_math_free_spmatrix | ( | G_math_spvector ** | spmatrix, |
int | rows | ||
) |
Release the memory of the sparse matrix.
spvector | G_math_spvector ** |
rows | int |
Definition at line 121 of file sparse_matrix.c.
References G_free(), G_math_free_spvector(), and NULL.
Referenced by N_free_les().
void G_math_free_spvector | ( | G_math_spvector * | spvector | ) |
Release the memory of the sparse vector.
spvector | G_math_spvector * |
Definition at line 98 of file sparse_matrix.c.
References G_free(), and NULL.
Referenced by G_math_free_spmatrix().
void G_math_print_spmatrix | ( | G_math_spvector ** | Asp, |
int | rows | ||
) |
print the sparse matrix Asp to stdout
Asp | (G_math_spvector **) |
rows | (int) |
Definition at line 146 of file sparse_matrix.c.