PARALUTION  1.0.0
PARALUTION
host_matrix_bcsr.hpp
Go to the documentation of this file.
1 #ifndef PARALUTION_HOST_MATRIX_BCSR_HPP_
2 #define PARALUTION_HOST_MATRIX_BCSR_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 HostMatrixBCSR : public HostMatrix<ValueType> {
12 
13 public:
14 
16  HostMatrixBCSR(const Paralution_Backend_Descriptor local_backend);
17  virtual ~HostMatrixBCSR();
18 
19  virtual void info(void) const;
20  virtual unsigned int get_mat_format(void) const { return BCSR; }
21 
22  virtual void Clear(void);
23  virtual void AllocateBCSR(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 void Apply(const BaseVector<ValueType> &in, BaseVector<ValueType> *out) const;
31  virtual void ApplyAdd(const BaseVector<ValueType> &in, const ValueType scalar,
32  BaseVector<ValueType> *out) const;
33 
34 private:
35 
37 
38  friend class BaseVector<ValueType>;
39  friend class HostVector<ValueType>;
40  friend class HostMatrixCSR<ValueType>;
41  friend class HostMatrixCOO<ValueType>;
42  friend class HostMatrixHYB<ValueType>;
43  friend class HostMatrixDENSE<ValueType>;
44 
45  friend class GPUAcceleratorMatrixBCSR<ValueType>;
46  friend class OCLAcceleratorMatrixBCSR<ValueType>;
47  friend class MICAcceleratorMatrixBCSR<ValueType>;
48 
49 };
50 
51 
52 }
53 
54 #endif // PARALUTION_HOST_MATRIX_BCSR_HPP_
virtual void Clear(void)
Clear (free) the matrix.
Definition: host_matrix_bcsr.cpp:59
Definition: base_matrix.hpp:24
Definition: base_matrix.hpp:59
virtual void Apply(const BaseVector< ValueType > &in, BaseVector< ValueType > *out) const
Apply the matrix to vector, out = this*in;.
Definition: host_matrix_bcsr.cpp:170
Definition: base_matrix.hpp:14
MatrixBCSR< ValueType, int > mat_
Definition: host_matrix_bcsr.hpp:36
virtual void AllocateBCSR(const int nnz, const int nrow, const int ncol)
Definition: host_matrix_bcsr.cpp:72
virtual void info(void) const
Shows simple info about the object.
Definition: host_matrix_bcsr.cpp:51
virtual bool ConvertFrom(const BaseMatrix< ValueType > &mat)
Convert the matrix from another matrix (with different structure)
Definition: host_matrix_bcsr.cpp:132
nnz
Definition: pcg_example.m:8
const IndexType const IndexType const IndexType const ValueType const ValueType scalar
Definition: cuda_kernels_coo.hpp:91
Definition: base_matrix.hpp:78
Definition: base_vector.hpp:10
virtual ~HostMatrixBCSR()
Definition: host_matrix_bcsr.cpp:41
HostMatrixBCSR()
Definition: host_matrix_bcsr.cpp:20
virtual void CopyFrom(const BaseMatrix< ValueType > &mat)
Copy from another matrix.
Definition: host_matrix_bcsr.cpp:92
Definition: base_matrix.hpp:22
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_bcsr.cpp:195
Base class for all host/accelerator matrices.
Definition: base_matrix.hpp:92
Definition: matrix_formats.hpp:23
Definition: base_matrix.hpp:16
Definition: backend_manager.cpp:43
Definition: base_matrix.hpp:40
Base class for all host/accelerator vectors.
Definition: base_vector.hpp:26
virtual void CopyTo(BaseMatrix< ValueType > *mat) const
Copy to another matrix.
Definition: host_matrix_bcsr.cpp:125
virtual unsigned int get_mat_format(void) const
Return the matrix format id (see matrix_formats.hpp)
Definition: host_matrix_bcsr.hpp:20