bsr.h
Go to the documentation of this file.
1#pragma once
2
3#ifdef __cplusplus
4extern "C" {
5#endif
6
10typedef
11struct bsr_matrix
12{
13 // number or rows
14 int nrows;
15 // number or columns
16 int ncols;
17 // number or non-zero blocks
18 int nnz;
19 // block-size
20 int b;
21
22 // pointer ot row offsets
23 int *rowptr;
24 // pointer to column indices
25 int *colidx;
26 // pointer to double-precision values
27 double *dbl;
28 // pointer to single-precision values
29 float *flt;
30
32
39
46
55void bsr_init(bsr_matrix *A, int nrows, int nnz, int b);
56
67void bsr_vmspmv3(bsr_matrix *A, const double *x, double *y);
68
79void bsr_vdspmv3(bsr_matrix *A, const double *x, double *y);
80
87
94
101void bsr_sparsity(const bsr_matrix *A, const char *name);
102
109void bsr_nonzeros(bsr_matrix *A, const char *name);
110
111#ifdef __cplusplus
112}
113#endif
void bsr_info(bsr_matrix *A)
Display matrix statistics.
struct bsr_matrix bsr_matrix
Mixed-precision bsr matrix.
void bsr_downcast(bsr_matrix *M)
Make single-precision copy of double-precision values.
void bsr_nonzeros(bsr_matrix *A, const char *name)
Display nonzero blocks of first few rows.
void bsr_vdspmv3(bsr_matrix *A, const double *x, double *y)
Sparse matrix-vector multiplication in double precision.
void bsr_sparsity(const bsr_matrix *A, const char *name)
Display spasity pattern of first few rows.
bsr_matrix * bsr_alloc()
Create empty bsr matrix.
void bsr_vmspmv3(bsr_matrix *A, const double *x, double *y)
Sparse matrix-vector multiplication in mixed precision.
void bsr_free(bsr_matrix *A)
Delete bsr matrix.
void bsr_init(bsr_matrix *A, int nrows, int nnz, int b)
Initialize bsr matrix.
Mixed-precision bsr matrix.
Definition: bsr.h:12
int b
Definition: bsr.h:20
float * flt
Definition: bsr.h:29
int * colidx
Definition: bsr.h:25
double * dbl
Definition: bsr.h:27
int ncols
Definition: bsr.h:16
int * rowptr
Definition: bsr.h:23
int nnz
Definition: bsr.h:18
int nrows
Definition: bsr.h:14