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

Public Member Functions

template<typename T , typename = enable_if_t<std::is_base_of<TrigBase, T>::value or std::is_base_of<HyperbolicBase, T>::value>>
void bvisit (const T &f)
 
void bvisit (const Pow &pow)
 
void bvisit (const Log &f)
 
void bvisit (const LambertW &x)
 
void bvisit (const Basic &x)
 
bool apply (const Basic &b, const RCP< const Symbol > &x)
 

Protected Attributes

RCP< const Symbolx_
 
bool needs_
 

Additional Inherited Members

- Data Fields inherited from SymEngine::StopVisitor
bool stop_
 

Detailed Description

Definition at line 291 of file series_visitor.h.

Member Function Documentation

◆ apply()

bool SymEngine::NeedsSymbolicExpansionVisitor::apply ( const Basic b,
const RCP< const Symbol > &  x 
)
inline

Definition at line 346 of file series_visitor.h.

347 {
348 x_ = x;
349 needs_ = false;
350 stop_ = false;
351 postorder_traversal_stop(b, *this);
352 return needs_;
353 }

◆ bvisit() [1/5]

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

Definition at line 344 of file series_visitor.h.

344{}

◆ bvisit() [2/5]

void SymEngine::NeedsSymbolicExpansionVisitor::bvisit ( const LambertW x)
inline

Definition at line 338 of file series_visitor.h.

339 {
340 needs_ = true;
341 stop_ = true;
342 }

◆ bvisit() [3/5]

void SymEngine::NeedsSymbolicExpansionVisitor::bvisit ( const Log f)
inline

Definition at line 328 of file series_visitor.h.

329 {
330 auto arg = f.get_arg();
331 map_basic_basic subsx0{{x_, integer(0)}};
332 if (arg->subs(subsx0)->__eq__(*integer(0))) {
333 needs_ = true;
334 stop_ = true;
335 }
336 }
std::enable_if< std::is_integral< T >::value, RCP< constInteger > >::type integer(T i)
Definition: integer.h:200

◆ bvisit() [4/5]

void SymEngine::NeedsSymbolicExpansionVisitor::bvisit ( const Pow pow)
inline

Definition at line 313 of file series_visitor.h.

314 {
315 auto base = pow.get_base();
316 auto exp = pow.get_exp();
317 map_basic_basic subsx0{{x_, integer(0)}};
318 // exp(const) or x^-1
319 if ((base->__eq__(*E) and exp->subs(subsx0)->__neq__(*integer(0)))
320 or (is_a_Number(*exp)
321 and down_cast<const Number &>(*exp).is_negative()
322 and base->subs(subsx0)->__eq__(*integer(0)))) {
323 needs_ = true;
324 stop_ = true;
325 }
326 }
bool is_a_Number(const Basic &b)
Definition: number.h:130
RCP< const Basic > exp(const RCP< const Basic > &x)
Returns the natural exponential function E**x = pow(E, x)
Definition: pow.cpp:271
T pow(T... args)

◆ bvisit() [5/5]

template<typename T , typename = enable_if_t<std::is_base_of<TrigBase, T>::value or std::is_base_of<HyperbolicBase, T>::value>>
void SymEngine::NeedsSymbolicExpansionVisitor::bvisit ( const T &  f)
inline

Definition at line 303 of file series_visitor.h.

304 {
305 auto arg = f.get_arg();
306 map_basic_basic subsx0{{x_, integer(0)}};
307 if (arg->subs(subsx0)->__neq__(*integer(0))) {
308 needs_ = true;
309 stop_ = true;
310 }
311 }

Field Documentation

◆ needs_

bool SymEngine::NeedsSymbolicExpansionVisitor::needs_
protected

Definition at line 296 of file series_visitor.h.

◆ x_

RCP<const Symbol> SymEngine::NeedsSymbolicExpansionVisitor::x_
protected

Definition at line 295 of file series_visitor.h.


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