zero_matrix.h
1 #ifndef SYMENGINE_MATRICES_ZERO_MATRIX_H
2 #define SYMENGINE_MATRICES_ZERO_MATRIX_H
3 
4 #include <symengine/basic.h>
5 #include <symengine/matrices/matrix_expr.h>
6 
7 namespace SymEngine
8 {
9 
10 class ZeroMatrix : public MatrixExpr
11 {
12 private:
13  RCP<const Basic> m_, n_; // m >= 0, n >= 0
14 
15 public:
16  ZeroMatrix(const RCP<const Basic> &m, const RCP<const Basic> &n)
17  : m_(m), n_(n)
18  {
19  SYMENGINE_ASSIGN_TYPEID();
20  SYMENGINE_ASSERT(is_canonical(m, n));
21  }
22 
23  IMPLEMENT_TYPEID(SYMENGINE_ZEROMATRIX)
24  hash_t __hash__() const override;
25  bool __eq__(const Basic &o) const override;
26  int compare(const Basic &o) const override;
27  vec_basic get_args() const override;
28  bool is_canonical(const RCP<const Basic> &m,
29  const RCP<const Basic> &n) const;
30 
31  inline const RCP<const Basic> &nrows() const
32  {
33  return m_;
34  }
35 
36  inline const RCP<const Basic> &ncols() const
37  {
38  return n_;
39  }
40 };
41 
42 RCP<const MatrixExpr> zero_matrix(const RCP<const Basic> &m,
43  const RCP<const Basic> &n);
44 
45 } // namespace SymEngine
46 #endif
The base class for SymEngine.
#define IMPLEMENT_TYPEID(SYMENGINE_ID)
Inline members and functions.
Definition: basic.h:340
The lowest unit of symbolic representation.
Definition: basic.h:97
bool __eq__(const Basic &o) const override
Test equality.
Definition: zero_matrix.cpp:16
hash_t __hash__() const override
Definition: zero_matrix.cpp:8
int compare(const Basic &o) const override
Definition: zero_matrix.cpp:23
vec_basic get_args() const override
Returns the list of arguments.
Definition: zero_matrix.cpp:36
Main namespace for SymEngine package.
Definition: add.cpp:19