-
Notifications
You must be signed in to change notification settings - Fork 2
/
Matrix.h
30 lines (25 loc) · 929 Bytes
/
Matrix.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#ifndef MATRIX_H
#define MATRIX_H
#include <vector>
#include "util.h"
class Matrix_t
{
public:
std::vector < double > val; // val[] holds the entries of matrix
std::vector < int > rowptr; // rowptr[i] holds the starting index in col[] where row "i" starts
std::vector < int > col; // column value of sparse matrix entry
int nrow;
int ncol;
bool is_dense; // Is the matrix sparse / dense
// note for dense matrix storage, then size(val) is nrow * ncol
// consider using Fortran indexing A(i,j) at val[ (i) + (j)*nrow ]
// to be compatible with BLAS
int nnz();
void kron_mult( const char transA,
const char transB,
const Matrix_t A,
const Matrix_t B,
const double yin[],
double xout[]) ;
};
#endif