PARALUTION  1.0.0
PARALUTION
matrix_formats.hpp
Go to the documentation of this file.
1 #ifndef PARALUTION_MATRIX_FORMATS_HPP_
2 #define PARALUTION_MATRIX_FORMATS_HPP_
3 
4 #include <string>
5 
6 namespace paralution {
7 
9 const std::string _matrix_format_names [8] = {"DENSE",
10  "CSR",
11  "MCSR",
12  "BCSR",
13  "COO",
14  "DIA",
15  "ELL",
16  "HYB"
17 };
18 
20 enum _matrix_format {DENSE = 0,
21  CSR = 1,
22  MCSR = 2,
23  BCSR = 3,
24  COO = 4,
25  DIA = 5,
26  ELL = 6,
27  HYB = 7};
28 
29 
32 template <typename ValueType, typename IndexType>
33 struct MatrixCSR {
35  IndexType *row_offset;
36 
38  IndexType *col;
39 
41  ValueType *val;
42 };
43 
46 template <typename ValueType, typename IndexType>
47 struct MatrixMCSR {
49  IndexType *row_offset;
50 
52  IndexType *col;
53 
55  ValueType *val;
56 
58  ValueType *diag;
59 };
60 
61 template <typename ValueType, typename IndexType>
62 struct MatrixBCSR {
63 };
64 
67 template <typename ValueType, typename IndexType>
68 struct MatrixCOO {
70  IndexType *row;
71 
73  IndexType *col;
74 
75  // Values
76  ValueType *val;
77 };
78 
81 template <typename ValueType, typename IndexType, typename Index = IndexType>
82 struct MatrixDIA {
84  Index num_diag;
85 
87  IndexType *offset;
88 
90  ValueType *val;
91 };
92 
95 template <typename ValueType, typename IndexType, typename Index = IndexType>
96 struct MatrixELL {
98  Index max_row;
99 
101  IndexType *col;
102 
104  ValueType *val;
105 };
106 
109 template <typename ValueType, typename IndexType, typename Index = IndexType>
110 struct MatrixHYB {
113 };
114 
116 template <typename ValueType>
117 struct MatrixDENSE {
119  ValueType *val;
120 };
121 
122 
123 }
124 
125 #endif // PARALUTION_MATRIX_FORMATS_HPP_
Definition: matrix_formats.hpp:22
Definition: matrix_formats.hpp:25
Definition: matrix_formats.hpp:20
Definition: matrix_formats.hpp:27
ValueType * val
Values.
Definition: matrix_formats.hpp:119
Sparse Matrix - Coordinate Format.
Definition: matrix_formats.hpp:68
Sparse Matrix - Contains ELL and COO Matrices.
Definition: matrix_formats.hpp:110
IndexType * col
Column index.
Definition: matrix_formats.hpp:52
_matrix_format
Matrix Enumeration.
Definition: matrix_formats.hpp:20
ValueType * diag
Diagonal elements.
Definition: matrix_formats.hpp:58
Index max_row
Maximal elements per row.
Definition: matrix_formats.hpp:98
Index num_diag
Number of diagonal.
Definition: matrix_formats.hpp:84
IndexType * row
Row index.
Definition: matrix_formats.hpp:70
ValueType * val
Values.
Definition: matrix_formats.hpp:41
Dense Matrix (see DENSE_IND for indexing)
Definition: matrix_formats.hpp:117
Sparse Matrix - ELL Format (see ELL_IND for indexing)
Definition: matrix_formats.hpp:96
IndexType * col
Column index.
Definition: matrix_formats.hpp:73
IndexType * col
Column index.
Definition: matrix_formats.hpp:101
MatrixCOO< ValueType, IndexType > COO
Definition: matrix_formats.hpp:112
IndexType * offset
Offset with respect to the main diagonal.
Definition: matrix_formats.hpp:87
IndexType * row_offset
Row offsets (row ptr)
Definition: matrix_formats.hpp:35
ValueType * val
Values.
Definition: matrix_formats.hpp:90
ValueType * val
Values.
Definition: matrix_formats.hpp:104
Sparse Matrix - Modified Sparse Compressed Row Format.
Definition: matrix_formats.hpp:47
IndexType * col
Column index.
Definition: matrix_formats.hpp:38
Definition: matrix_formats.hpp:23
IndexType * row_offset
Row offsets (row ptr)
Definition: matrix_formats.hpp:49
ValueType * val
Values.
Definition: matrix_formats.hpp:55
Definition: backend_manager.cpp:43
Sparse Matrix - Diagonal Format (see DIA_IND for indexing)
Definition: matrix_formats.hpp:82
ValueType * val
Definition: matrix_formats.hpp:76
Definition: matrix_formats.hpp:21
Definition: matrix_formats.hpp:26
const std::string _matrix_format_names[8]
Matrix Names.
Definition: matrix_formats.hpp:9
MatrixELL< ValueType, IndexType, Index > ELL
Definition: matrix_formats.hpp:111
Definition: matrix_formats.hpp:24
Definition: matrix_formats.hpp:62
Sparse Matrix - Sparse Compressed Row Format.
Definition: matrix_formats.hpp:33