Loading...
Searching...
No Matches
SymEngine::Dummy Class Reference
+ Inheritance diagram for SymEngine::Dummy:
+ Collaboration diagram for SymEngine::Dummy:

Public Member Functions

void accept (Visitor &v) const override
 
void accept (EvalRealDoubleVisitorFinal &v) const override
 
 Dummy ()
 Dummy Constructors.
 
 Dummy (const std::string &name)
 
hash_t __hash__ () const override
 
bool __eq__ (const Basic &o) const override
 
int compare (const Basic &o) const override
 
size_t get_index () const
 
- Public Member Functions inherited from SymEngine::Symbol
void accept (Visitor &v) const override
 
void accept (EvalRealDoubleVisitorFinal &v) const override
 
 Symbol (const std::string &name)
 Symbol Constructor.
 
hash_t __hash__ () const override
 
bool __eq__ (const Basic &o) const override
 
int compare (const Basic &o) const override
 
const std::stringget_name () const
 
vec_basic get_args () const override
 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.
 
int __cmp__ (const Basic &o) const
 Comparison operator.
 
std::string __str__ () const
 
std::string dumps () const
 Returns a string of the instance serialized.
 
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

- Static Public Member Functions inherited from SymEngine::Basic
static RCP< const Basicloads (const std::string &)
 Creates an instance of a serialized string.
 
- Data Fields inherited from SymEngine::Basic
TypeID type_code_
 

Detailed Description

Definition at line 50 of file symbol.h.

Constructor & Destructor Documentation

◆ Dummy() [1/2]

SymEngine::Dummy::Dummy ( )
explicit

Dummy Constructors.

Definition at line 40 of file symbol.cpp.

40 : Symbol("_Dummy_" + to_string(count_))
41{
42 SYMENGINE_ASSIGN_TYPEID()
43 count_ += 1;
45}
size_t dummy_index
Dummy index.
Definition symbol.h:56
static size_t count_
Dummy count.
Definition symbol.h:54
Symbol(const std::string &name)
Symbol Constructor.
Definition symbol.cpp:7
std::string to_string(const T &value)
workaround for MinGW bug
Definition basic-inl.h:111

◆ Dummy() [2/2]

SymEngine::Dummy::Dummy ( const std::string name)
explicit

Definition at line 47 of file symbol.cpp.

47 : Symbol("_" + name)
48{
49 SYMENGINE_ASSIGN_TYPEID()
50 count_ += 1;
52}

Member Function Documentation

◆ __eq__()

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

Equality comparator

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

Implements SymEngine::Basic.

Definition at line 62 of file symbol.cpp.

63{
64 if (is_a<Dummy>(o))
66 and (dummy_index == down_cast<const Dummy &>(o).get_index()));
67 return false;
68}
const std::string & get_name() const
Definition symbol.h:38
void hash_combine(hash_t &seed, const T &v)
Definition basic-inl.h:95

◆ __hash__()

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

Implements SymEngine::Basic.

Definition at line 54 of file symbol.cpp.

55{
56 hash_t seed = 0;
57 hash_combine(seed, get_name());
59 return seed;
60}

◆ accept() [1/2]

void SymEngine::Dummy::accept ( EvalRealDoubleVisitorFinal v) const
overridevirtual

Implements SymEngine::Basic.

◆ accept() [2/2]

void SymEngine::Dummy::accept ( Visitor v) const
overridevirtual

Implements SymEngine::Basic.

◆ compare()

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

Comparison operator

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

Implements SymEngine::Basic.

Definition at line 70 of file symbol.cpp.

71{
72 SYMENGINE_ASSERT(is_a<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

◆ get_index()

size_t SymEngine::Dummy::get_index ( ) const
inline

Definition at line 75 of file symbol.h.

76 {
77 return dummy_index;
78 }

Field Documentation

◆ count_

size_t SymEngine::Dummy::count_ = 0
staticprivate

Dummy count.

Definition at line 54 of file symbol.h.

◆ dummy_index

size_t SymEngine::Dummy::dummy_index
private

Dummy index.

Definition at line 56 of file symbol.h.

◆ 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: