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

Public Member Functions

 HasSymbolVisitor (Ptr< const Basic > x)
 
void bvisit (const Symbol &x)
 
void bvisit (const FunctionSymbol &x)
 
void bvisit (const Basic &x)
 
bool apply (const Basic &b)
 

Protected Attributes

Ptr< const Basicx_
 
bool has_
 

Additional Inherited Members

- Data Fields inherited from SymEngine::StopVisitor
bool stop_
 

Detailed Description

Definition at line 92 of file visitor.h.

Constructor & Destructor Documentation

◆ HasSymbolVisitor()

SymEngine::HasSymbolVisitor::HasSymbolVisitor ( Ptr< const Basic x)
inline

Definition at line 99 of file visitor.h.

99: x_(x) {}

Member Function Documentation

◆ apply()

bool SymEngine::HasSymbolVisitor::apply ( const Basic b)
inline

Definition at line 119 of file visitor.h.

120 {
121 has_ = false;
122 stop_ = false;
123 preorder_traversal_stop(b, *this);
124 return has_;
125 }

◆ bvisit() [1/3]

void SymEngine::HasSymbolVisitor::bvisit ( const Basic x)
inline

Definition at line 117 of file visitor.h.

117{};

◆ bvisit() [2/3]

void SymEngine::HasSymbolVisitor::bvisit ( const FunctionSymbol x)
inline

Definition at line 109 of file visitor.h.

110 {
111 if (eq(*x_, x)) {
112 has_ = true;
113 stop_ = true;
114 }
115 }
bool eq(const Basic &a, const Basic &b)
Checks equality for a and b
Definition: basic-inl.h:21

◆ bvisit() [3/3]

void SymEngine::HasSymbolVisitor::bvisit ( const Symbol x)
inline

Definition at line 101 of file visitor.h.

102 {
103 if (eq(*x_, x)) {
104 has_ = true;
105 stop_ = true;
106 }
107 }

Field Documentation

◆ has_

bool SymEngine::HasSymbolVisitor::has_
protected

Definition at line 96 of file visitor.h.

◆ x_

Ptr<const Basic> SymEngine::HasSymbolVisitor::x_
protected

Definition at line 95 of file visitor.h.


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