hadamard_product.h
1 #ifndef SYMENGINE_MATRICES_HADAMARD_PRODUCT_H
2 #define SYMENGINE_MATRICES_HADAMARD_PRODUCT_H
3 
4 #include <symengine/basic.h>
5 #include <symengine/matrices/matrix_expr.h>
6 
7 namespace SymEngine
8 {
9 
11 {
12 private:
13  vec_basic factors_;
14 
15 public:
16  HadamardProduct(const vec_basic &factors) : factors_(factors)
17  {
18  SYMENGINE_ASSIGN_TYPEID();
19  SYMENGINE_ASSERT(is_canonical(factors));
20  }
21 
22  IMPLEMENT_TYPEID(SYMENGINE_HADAMARDPRODUCT)
23  hash_t __hash__() const override;
24  bool __eq__(const Basic &o) const override;
25  int compare(const Basic &o) const override;
26  bool is_canonical(const vec_basic &factors) const;
27  vec_basic get_args() const override
28  {
29  return vec_basic(factors_.begin(), factors_.end());
30  }
31  inline const vec_basic &get_factors() const
32  {
33  return factors_;
34  }
35 };
36 
37 RCP<const MatrixExpr> hadamard_product(const vec_basic &factors);
38 
39 } // namespace SymEngine
40 
41 #endif
The base class for SymEngine.
#define IMPLEMENT_TYPEID(SYMENGINE_ID)
Inline members and functions.
Definition: basic.h:340
T begin(T... args)
The lowest unit of symbolic representation.
Definition: basic.h:97
hash_t __hash__() const override
vec_basic get_args() const override
Returns the list of arguments.
int compare(const Basic &o) const override
bool __eq__(const Basic &o) const override
Test equality.
T end(T... args)
Main namespace for SymEngine package.
Definition: add.cpp:19