37 "Add sparse vector %p to the sparse linear equation system at "
60 G_debug(4,
"Allocate memory for a sparse matrix with %i rows\n", rows);
78 G_debug(4,
"Allocate memory for a sparse vector with %i cols\n", cols);
124 for (i = 0; i < rows; i++)
149 for (i = 0; i < rows; i++) {
150 for (
j = 0;
j < rows;
j++) {
152 for (k = 0; k < Asp[i]->
cols; k++) {
153 if (Asp[i]->index[k] == (
unsigned int)
j) {
187#pragma omp parallel for schedule(static) private(i, j)
188 for (i = 0; i < rows; i++) {
189 for (
j = 0;
j < Asp[i]->
cols;
j++) {
232 for (i = 0; i < (
unsigned int)rows; i++) {
233 for (
j = 0;
j < Asp[i]->
cols;
j++) {
234 if (Asp[i]->index[
j] == i) {
237 else if (Asp[i]->index[
j] > i) {
261 int nonull,
count = 0;
267#pragma omp parallel for schedule(static) private(i, j, nonull, count)
268 for (i = 0; i < rows; i++) {
271 for (
j = 0;
j < rows;
j++) {
272 if (A[i][
j] > epsilon)
279 for (
j = 0;
j < rows;
j++) {
280 if (A[i][
j] > epsilon) {
311 int nonull,
count = 0;
317 for (i = 0; i < rows; i++) {
321 if (A[i][
j] > epsilon)
330 if (A[i][0] > epsilon) {
337 if (A[i][
j] > epsilon && i +
j < rows) {
373#pragma omp for schedule(static) private(i, j, tmp)
374 for (i = 0; i < rows; i++) {
376 for (
j = 0;
j < Asp[i]->
cols;
j++) {
void G_free(void *)
Free allocated memory.
int G_debug(int, const char *,...) __attribute__((format(printf
double ** G_alloc_matrix(int, int)
Matrix memory allocation.
#define assert(condition)
void G_math_Ax_sparse(G_math_spvector **Asp, double *x, double *y, int rows)
Compute the matrix - vector product of sparse matrix **Asp and vector x.
double ** G_math_Asp_to_sband_matrix(G_math_spvector **Asp, int rows, int bandwidth)
Convert a symmetric sparse matrix into a symmetric band matrix.
void G_math_print_spmatrix(G_math_spvector **Asp, int rows)
print the sparse matrix Asp to stdout
double ** G_math_Asp_to_A(G_math_spvector **Asp, int rows)
Convert a sparse matrix into a quadratic matrix.
G_math_spvector * G_math_alloc_spvector(int cols)
Allocate memory for a sparse vector.
void G_math_free_spvector(G_math_spvector *spvector)
Release the memory of the sparse vector.
void G_math_free_spmatrix(G_math_spvector **Asp, int rows)
Release the memory of the sparse matrix.
int G_math_add_spvector(G_math_spvector **Asp, G_math_spvector *spvector, int row)
Adds a sparse vector to a sparse matrix at position row.
G_math_spvector ** G_math_sband_matrix_to_Asp(double **A, int rows, int bandwidth, double epsilon)
Convert a symmetric band matrix into a sparse matrix.
G_math_spvector ** G_math_A_to_Asp(double **A, int rows, double epsilon)
Convert a quadratic matrix into a sparse matrix.
G_math_spvector ** G_math_alloc_spmatrix(int rows)
Allocate memory for a sparse matrix.
The row vector of the sparse matrix.