SymEngine::Dummy Class Reference
+ Inheritance diagram for SymEngine::Dummy:
+ Collaboration diagram for SymEngine::Dummy:

Public Member Functions

virtual void accept (Visitor &v) const
 
virtual void accept (EvalRealDoubleVisitorFinal &v) const
 
 Dummy ()
 Dummy Constructors.
 
 Dummy (const std::string &name)
 
virtual hash_t __hash__ () const
 
virtual bool __eq__ (const Basic &o) const
 
virtual int compare (const Basic &o) const
 
size_t get_index () const
 
- Public Member Functions inherited from SymEngine::Symbol
 Symbol (const std::string &name)
 Symbol Constructor.
 
const std::stringget_name () const
 
virtual vec_basic get_args () const
 Returns the list of arguments.
 
RCP< const Symbolas_dummy () const
 
- Public Member Functions inherited from SymEngine::Basic
TypeID get_type_code () const
 
 Basic ()
 Constructor.
 
 Basic (const Basic &)=delete
 Delete the copy constructor and assignment.
 
Basicoperator= (const Basic &)=delete
 Assignment operator in continuation with above.
 
 Basic (Basic &&)=delete
 Delete the move constructor and assignment.
 
Basicoperator= (Basic &&)=delete
 Assignment operator in continuation with above.
 
hash_t hash () const
 
bool __neq__ (const Basic &o) const
 true if this is not equal to o. More...
 
int __cmp__ (const Basic &o) const
 Comparison operator.
 
std::string __str__ () const
 
RCP< const Basicsubs (const map_basic_basic &subs_dict) const
 Substitutes 'subs_dict' into 'self'.
 
RCP< const Basicxreplace (const map_basic_basic &subs_dict) const
 
virtual RCP< const Basicexpand_as_exp () const
 expands the special function in terms of exp function
 
RCP< const Basicdiff (const RCP< const Symbol > &x, bool cache=true) const
 
- Public Member Functions inherited from SymEngine::EnableRCPFromThis< Basic >
RCP< Basicrcp_from_this ()
 Get RCP<T> pointer to self (it will cast the pointer to T)
 
RCP< const Basicrcp_from_this () const
 Get RCP<const T> pointer to self (it will cast the pointer to const T)
 
RCP< const T2 > rcp_from_this_cast () const
 Get RCP<T2> pointer to self (it will cast the pointer to T2)
 
unsigned int use_count () const
 

Static Public Attributes

static const TypeID type_code_id = SYMENGINE_DUMMY
 
- Static Public Attributes inherited from SymEngine::Symbol
static const TypeID type_code_id = SYMENGINE_SYMBOL
 

Private Attributes

size_t dummy_index
 Dummy index.
 

Static Private Attributes

static size_t count_ = 0
 Dummy count.
 

Additional Inherited Members

- Data Fields inherited from SymEngine::Basic
TypeID type_code_
 

Detailed Description

Definition at line 50 of file symbol.h.

Member Function Documentation

◆ __eq__()

bool SymEngine::Dummy::__eq__ ( const Basic o) const
virtual

Equality comparator

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

Reimplemented from SymEngine::Symbol.

Definition at line 62 of file symbol.cpp.

63 {
64  if (is_a<Dummy>(o))
65  return ((get_name() == down_cast<const Dummy &>(o).get_name())
66  and (dummy_index == down_cast<const Dummy &>(o).get_index()));
67  return false;
68 }
size_t dummy_index
Dummy index.
Definition: symbol.h:56
const std::string & get_name() const
Definition: symbol.h:38

◆ __hash__()

hash_t SymEngine::Dummy::__hash__ ( ) const
virtual
Returns
Size of the hash

Reimplemented from SymEngine::Symbol.

Definition at line 54 of file symbol.cpp.

55 {
56  hash_t seed = 0;
57  hash_combine(seed, get_name());
59  return seed;
60 }
void hash_combine(hash_t &seed, const T &v)
Definition: basic-inl.h:137

◆ compare()

int SymEngine::Dummy::compare ( const Basic o) const
virtual

Comparison operator

Parameters
o- Object to be compared with
Returns
0 if equal, -1 , 1 according to string compare

Reimplemented from SymEngine::Symbol.

Definition at line 70 of file symbol.cpp.

71 {
72  SYMENGINE_ASSERT(is_a<Dummy>(o))
73  const Dummy &s = down_cast<const Dummy &>(o);
74  if (get_name() == s.get_name()) {
75  if (dummy_index == s.get_index())
76  return 0;
77  return dummy_index < s.get_index() ? -1 : 1;
78  }
79  return get_name() < s.get_name() ? -1 : 1;
80 }
Dummy()
Dummy Constructors.
Definition: symbol.cpp:40

Field Documentation

◆ type_code_id

const TypeID SymEngine::Dummy::type_code_id = SYMENGINE_DUMMY
static

Type_code_id shared by all instances

Definition at line 59 of file symbol.h.


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