LADEL main
Sparse LDL factorization package with rank 1 and rowadd/rowdel updates
ladel_matvec.c
Go to the documentation of this file.
1#include "ladel_global.h"
2#include "ladel_types.h"
3#include "ladel_matvec.h"
4
6{
7 ladel_int index, col;
8
9 if (reset) for (index = 0; index < M->nrow; index++) y[index] = 0;
10
11 for (col = 0; col < M->ncol; col++)
12 LADEL_FOR(index, M, col)
13 y[M->i[index]] += M->x[index] * x[col];
14}
15
17{
18 ladel_int index, col;
19
20 if (reset) for (index = 0; index < M->ncol; index++) y[index] = 0;
21
22 for (col = 0; col < M->ncol; col++)
23 LADEL_FOR(index, M, col)
24 y[col] += M->x[index] * x[M->i[index]];
25}
26
28{
29 ladel_int index, col;
30
31 if (reset) for (index = 0; index < M->ncol; index++) y[index] = 0;
32
33 for (col = 0; col < M->ncol; col++)
34 LADEL_FOR(index, M, col)
35 y[M->i[index]] += (M->i[index] == col) ? 0.0 : M->x[index] * x[col];
36
37 ladel_tpose_matvec(M, x, y, FALSE);
38}
#define FALSE
For booleans.
#define LADEL_FOR(index, M, col)
Loop through a column of a sparse matrix.
Memory allocation routines.
void ladel_tpose_matvec(const ladel_sparse_matrix *M, const ladel_double *x, ladel_double *y, ladel_int reset)
Computes or (for reset==TRUE of FALSE respectively).
Definition: ladel_matvec.c:16
void ladel_symmetric_matvec(const ladel_sparse_matrix *M, const ladel_double *x, ladel_double *y, ladel_int reset)
Computes (for a symmetric matrix M) or (for reset==TRUE of FALSE respectively).
Definition: ladel_matvec.c:27
void ladel_matvec(const ladel_sparse_matrix *M, const ladel_double *x, ladel_double *y, ladel_int reset)
Computes or (for reset==TRUE of FALSE respectively).
Definition: ladel_matvec.c:5
Routines to compute matrix vector products.
Structures and types used in LADEL routines.
int64_t ladel_int
Type for integer numbers (default: int64_t)
Definition: ladel_types.h:24
double ladel_double
Type for floating point numbers (default: double)
Definition: ladel_types.h:20
Sparse matrix in compressed column storage.
Definition: ladel_types.h:35
ladel_int ncol
number of columns
Definition: ladel_types.h:38
ladel_double * x
numerical values (size nzmax)
Definition: ladel_types.h:42
ladel_int nrow
number of rows
Definition: ladel_types.h:37
ladel_int * i
row pointers (size nzmax)
Definition: ladel_types.h:41