PARALUTION  1.0.0
PARALUTION
operator.hpp
Go to the documentation of this file.
1 #ifndef PARALUTION_OPERATOR_HPP_
2 #define PARALUTION_OPERATOR_HPP_
3 
4 #include "base_paralution.hpp"
5 
6 #include <iostream>
7 #include <string>
8 #include <cstdlib>
9 
10 namespace paralution {
11 
12 template <typename ValueType>
13 class LocalVector;
14 
18 template <typename ValueType>
19 class Operator : public BaseParalution<ValueType> {
20 
21 public:
22 
23  Operator();
24  virtual ~Operator();
25 
27  virtual int get_nrow(void) const = 0;
29  virtual int get_ncol(void) const = 0;
31  virtual int get_nnz(void) const = 0;
32 
34  virtual int get_local_nrow(void) const;
36  virtual int get_local_ncol(void) const;
38  virtual int get_local_nnz(void) const;
39 
41  virtual int get_ghost_nrow(void) const;
43  virtual int get_ghost_ncol(void) const;
45  virtual int get_ghost_nnz(void) const;
46 
47 
49  virtual void Apply(const LocalVector<ValueType> &in, LocalVector<ValueType> *out) const;
50 
52  virtual void ApplyAdd(const LocalVector<ValueType> &in, const ValueType scalar,
53  LocalVector<ValueType> *out) const;
54 
55 };
56 
57 
58 }
59 
60 #endif // PARALUTION_OPERTOR_HPP_
virtual void Apply(const LocalVector< ValueType > &in, LocalVector< ValueType > *out) const
Apply the operator, out = Operator(in), where in, out are local vectors.
Definition: operator.cpp:66
virtual int get_ghost_ncol(void) const
Return the number of columns in the ghost matrix/stencil.
Definition: operator.cpp:54
virtual void ApplyAdd(const LocalVector< ValueType > &in, const ValueType scalar, LocalVector< ValueType > *out) const
Apply and add the operator, out = out + scalar*Operator(in), where in, out are local vectors...
Definition: operator.cpp:78
virtual int get_local_ncol(void) const
Return the number of columns in the local matrix/stencil.
Definition: operator.cpp:36
const IndexType const IndexType const IndexType const ValueType const ValueType scalar
Definition: cuda_kernels_coo.hpp:91
virtual int get_ghost_nnz(void) const
Return the number of non-zeros in the ghost matrix/stencil.
Definition: operator.cpp:60
virtual int get_ncol(void) const =0
Return the number of columns in the matrix/stencil.
virtual ~Operator()
Definition: operator.cpp:22
virtual int get_nnz(void) const =0
Return the number of non-zeros in the matrix/stencil.
virtual int get_local_nnz(void) const
Return the number of non-zeros in the local matrix/stencil.
Definition: operator.cpp:42
virtual int get_local_nrow(void) const
Return the number of rows in the local matrix/stencil.
Definition: operator.cpp:30
Base class for operator and vector (i.e. global/local matrix/stencil/vector) classes, all the backend-related interface and data are defined here.
Definition: base_paralution.hpp:41
Operator class defines the generic interface for applying an operator (e.g. matrix, stencil) from/to global and local vectors.
Definition: operator.hpp:19
Definition: backend_manager.cpp:43
virtual int get_ghost_nrow(void) const
Return the number of rows in the ghost matrix/stencil.
Definition: operator.cpp:48
Operator()
Definition: operator.cpp:12
virtual int get_nrow(void) const =0
Return the number of rows in the matrix/stencil.
Definition: host_vector.hpp:13