PARALUTION  1.0.0
PARALUTION
host_matrix_mcsr.hpp
Go to the documentation of this file.
1 #ifndef PARALUTION_HOST_MATRIX_MCSR_HPP_
2 #define PARALUTION_HOST_MATRIX_MCSR_HPP_
3 
4 #include "../base_vector.hpp"
5 #include "../base_matrix.hpp"
6 #include "../matrix_formats.hpp"
7 
8 namespace paralution {
9 
10 template <typename ValueType>
11 class HostMatrixMCSR : public HostMatrix<ValueType> {
12 
13 public:
14 
16  HostMatrixMCSR(const Paralution_Backend_Descriptor local_backend);
17  virtual ~HostMatrixMCSR();
18 
19  virtual void info(void) const;
20  virtual unsigned int get_mat_format(void) const { return MCSR; }
21 
22  virtual void Clear(void);
23  virtual void AllocateMCSR(const int nnz, const int nrow, const int ncol);
24 
25  virtual bool ConvertFrom(const BaseMatrix<ValueType> &mat);
26 
27  virtual void CopyFrom(const BaseMatrix<ValueType> &mat);
28  virtual void CopyTo(BaseMatrix<ValueType> *mat) const;
29 
30  virtual bool ILU0Factorize(void);
31 
32  virtual void LUAnalyse(void);
33  virtual void LUAnalyseClear(void);
34  virtual bool LUSolve(const BaseVector<ValueType> &in, BaseVector<ValueType> *out) const;
35 
36  virtual void Apply(const BaseVector<ValueType> &in, BaseVector<ValueType> *out) const;
37  virtual void ApplyAdd(const BaseVector<ValueType> &in, const ValueType scalar,
38  BaseVector<ValueType> *out) const;
39 
40 private:
41 
43 
44  friend class BaseVector<ValueType>;
45  friend class HostVector<ValueType>;
46  friend class HostMatrixCSR<ValueType>;
47  friend class HostMatrixCOO<ValueType>;
48  friend class HostMatrixHYB<ValueType>;
49  friend class HostMatrixDENSE<ValueType>;
50 
51  friend class GPUAcceleratorMatrixMCSR<ValueType>;
52  friend class OCLAcceleratorMatrixMCSR<ValueType>;
53  friend class MICAcceleratorMatrixMCSR<ValueType>;
54 
55 };
56 
57 
58 }
59 
60 #endif // PARALUTION_HOST_MATRIX_MCSR_HPP_
Definition: matrix_formats.hpp:22
MatrixMCSR< ValueType, int > mat_
Definition: host_matrix_mcsr.hpp:42
Definition: base_matrix.hpp:24
Definition: base_matrix.hpp:14
virtual void info(void) const
Shows simple info about the object.
Definition: host_matrix_mcsr.cpp:54
virtual unsigned int get_mat_format(void) const
Return the matrix format id (see matrix_formats.hpp)
Definition: host_matrix_mcsr.hpp:20
virtual void CopyTo(BaseMatrix< ValueType > *mat) const
Copy to another matrix.
Definition: host_matrix_mcsr.cpp:148
nnz
Definition: pcg_example.m:8
virtual bool ILU0Factorize(void)
Perform ILU(0) factorization.
Definition: host_matrix_mcsr.cpp:191
virtual void Clear(void)
Clear (free) the matrix.
Definition: host_matrix_mcsr.cpp:61
virtual void ApplyAdd(const BaseVector< ValueType > &in, const ValueType scalar, BaseVector< ValueType > *out) const
Apply and add the matrix to vector, out = out + scalar*this*in;.
Definition: host_matrix_mcsr.cpp:345
HostMatrixMCSR()
Definition: host_matrix_mcsr.cpp:21
const IndexType const IndexType const IndexType const ValueType const ValueType scalar
Definition: cuda_kernels_coo.hpp:91
virtual bool ConvertFrom(const BaseMatrix< ValueType > &mat)
Convert the matrix from another matrix (with different structure)
Definition: host_matrix_mcsr.cpp:155
virtual void CopyFrom(const BaseMatrix< ValueType > &mat)
Copy from another matrix.
Definition: host_matrix_mcsr.cpp:106
Definition: base_vector.hpp:10
virtual void Apply(const BaseVector< ValueType > &in, BaseVector< ValueType > *out) const
Apply the matrix to vector, out = this*in;.
Definition: host_matrix_mcsr.cpp:309
Definition: base_matrix.hpp:22
Definition: base_matrix.hpp:76
Base class for all host/accelerator matrices.
Definition: base_matrix.hpp:92
virtual bool LUSolve(const BaseVector< ValueType > &in, BaseVector< ValueType > *out) const
Solve LU out = in; if level-scheduling algorithm is provided then the graph traversing is performed i...
Definition: host_matrix_mcsr.cpp:261
Definition: base_matrix.hpp:16
Definition: backend_manager.cpp:43
virtual void AllocateMCSR(const int nnz, const int nrow, const int ncol)
Allocate MCSR Matrix.
Definition: host_matrix_mcsr.cpp:78
Definition: base_matrix.hpp:57
virtual ~HostMatrixMCSR()
Definition: host_matrix_mcsr.cpp:44
Base class for all host/accelerator vectors.
Definition: base_vector.hpp:26
Definition: base_matrix.hpp:38
virtual void LUAnalyseClear(void)
Delete the analysed data (see LUAnalyse)
Definition: host_matrix_mcsr.cpp:304
virtual void LUAnalyse(void)
Analyse the structure (level-scheduling)
Definition: host_matrix_mcsr.cpp:299