SymEngine::TwoArgBasic< BaseClass > Class Template Referenceabstract
+ Inheritance diagram for SymEngine::TwoArgBasic< BaseClass >:
+ Collaboration diagram for SymEngine::TwoArgBasic< BaseClass >:

Public Member Functions

 TwoArgBasic (const RCP< const Basic > &a, const RCP< const Basic > &b)
 b in TwoArgBasic(a, b) More...
 
hash_t __hash__ () const override
 
RCP< const Basicget_arg1 () const
 
RCP< const Basicget_arg2 () const
 
vec_basic get_args () const override
 
virtual RCP< const Basiccreate (const RCP< const Basic > &a, const RCP< const Basic > &b) const =0
 Method to construct classes with canonicalization.
 
RCP< const Basiccreate (const vec_basic &b) const
 
bool __eq__ (const Basic &o) const override
 
int compare (const Basic &o) const override
 Structural equality comparator.
 

Private Attributes

RCP< const Basica_
 
RCP< const Basicb_
 a in TwoArgBasic(a, b)
 

Detailed Description

template<class BaseClass>
class SymEngine::TwoArgBasic< BaseClass >

Definition at line 73 of file functions.h.

Constructor & Destructor Documentation

◆ TwoArgBasic()

template<class BaseClass >
SymEngine::TwoArgBasic< BaseClass >::TwoArgBasic ( const RCP< const Basic > &  a,
const RCP< const Basic > &  b 
)
inline

b in TwoArgBasic(a, b)

Constructor

Definition at line 80 of file functions.h.

81  : a_{a}, b_{b} {};
RCP< const Basic > b_
a in TwoArgBasic(a, b)
Definition: functions.h:77

Member Function Documentation

◆ __eq__()

template<class BaseClass >
bool SymEngine::TwoArgBasic< BaseClass >::__eq__ ( const Basic o) const
inlineoverride

Equality comparator

Parameters
o- Object to be compared with
Returns
whether the 2 objects are equal

Definition at line 118 of file functions.h.

119  {
120  return is_same_type(*this, o)
121  and eq(*get_arg1(),
122  *down_cast<const TwoArgBasic &>(o).get_arg1())
123  and eq(*get_arg2(),
124  *down_cast<const TwoArgBasic &>(o).get_arg2());
125  }
RCP< const Basic > get_arg1() const
Definition: functions.h:91
RCP< const Basic > get_arg2() const
Definition: functions.h:96
TwoArgBasic(const RCP< const Basic > &a, const RCP< const Basic > &b)
b in TwoArgBasic(a, b)
Definition: functions.h:80
bool eq(const Basic &a, const Basic &b)
Checks equality for a and b
Definition: basic-inl.h:21
bool is_same_type(const Basic &a, const Basic &b)
Returns true if a and b are exactly the same type T.
Definition: basic-inl.h:47

◆ __hash__()

template<class BaseClass >
hash_t SymEngine::TwoArgBasic< BaseClass >::__hash__ ( ) const
inlineoverride
Returns
the hash

Definition at line 83 of file functions.h.

84  {
85  hash_t seed = this->get_type_code();
86  hash_combine<Basic>(seed, *a_);
87  hash_combine<Basic>(seed, *b_);
88  return seed;
89  }

◆ get_arg1()

template<class BaseClass >
RCP<const Basic> SymEngine::TwoArgBasic< BaseClass >::get_arg1 ( ) const
inline
Returns
arg_

Definition at line 91 of file functions.h.

92  {
93  return a_;
94  }

◆ get_arg2()

template<class BaseClass >
RCP<const Basic> SymEngine::TwoArgBasic< BaseClass >::get_arg2 ( ) const
inline
Returns
arg_

Definition at line 96 of file functions.h.

97  {
98  return b_;
99  }

The documentation for this class was generated from the following file: