Loading...
Searching...
No Matches
SymEngine::EvalRealDoubleVisitor< C > Class Template Reference
+ Inheritance diagram for SymEngine::EvalRealDoubleVisitor< C >:
+ Collaboration diagram for SymEngine::EvalRealDoubleVisitor< C >:

Public Member Functions

void bvisit (const ATan2 &x)
 
void bvisit (const Gamma &x)
 
void bvisit (const LogGamma &x)
 
void bvisit (const Erf &x)
 
void bvisit (const Erfc &x)
 
void bvisit (const Equality &x)
 
void bvisit (const Unequality &x)
 
void bvisit (const LessThan &x)
 
void bvisit (const StrictLessThan &x)
 
void bvisit (const Max &x)
 
void bvisit (const Min &x)
 
void bvisit (const BooleanAtom &ba)
 
void bvisit (const Piecewise &pw)
 
- Public Member Functions inherited from SymEngine::EvalDoubleVisitor< double, C >
double apply (const Basic &b)
 
void bvisit (const Integer &x)
 
void bvisit (const Rational &x)
 
void bvisit (const RealDouble &x)
 
void bvisit (const Add &x)
 
void bvisit (const Mul &x)
 
void bvisit (const Pow &x)
 
void bvisit (const Sin &x)
 
void bvisit (const Cos &x)
 
void bvisit (const Tan &x)
 
void bvisit (const Symbol &)
 
void bvisit (const Log &x)
 
void bvisit (const Cot &x)
 
void bvisit (const Csc &x)
 
void bvisit (const Sec &x)
 
void bvisit (const ASin &x)
 
void bvisit (const ACos &x)
 
void bvisit (const ASec &x)
 
void bvisit (const ACsc &x)
 
void bvisit (const ATan &x)
 
void bvisit (const ACot &x)
 
void bvisit (const Sinh &x)
 
void bvisit (const Csch &x)
 
void bvisit (const Cosh &x)
 
void bvisit (const Sech &x)
 
void bvisit (const Tanh &x)
 
void bvisit (const Coth &x)
 
void bvisit (const ASinh &x)
 
void bvisit (const ACsch &x)
 
void bvisit (const ACosh &x)
 
void bvisit (const ATanh &x)
 
void bvisit (const ACoth &x)
 
void bvisit (const ASech &x)
 
void bvisit (const Constant &x)
 
void bvisit (const Abs &x)
 
void bvisit (const Basic &)
 
void bvisit (const NumberWrapper &x)
 
void bvisit (const FunctionWrapper &x)
 
void bvisit (const UnevaluatedExpr &x)
 

Additional Inherited Members

- Protected Attributes inherited from SymEngine::EvalDoubleVisitor< double, C >
double result_
 

Detailed Description

template<typename C>
class SymEngine::EvalRealDoubleVisitor< C >

Definition at line 281 of file eval_double.cpp.

Member Function Documentation

◆ bvisit() [1/13]

template<typename C >
void SymEngine::EvalRealDoubleVisitor< C >::bvisit ( const ATan2 x)
inline

Definition at line 293 of file eval_double.cpp.

294 {
295 double num = apply(*(x.get_num()));
296 double den = apply(*(x.get_den()));
297 result_ = std::atan2(num, den);
298 };
T atan2(T... args)

◆ bvisit() [2/13]

template<typename C >
void SymEngine::EvalRealDoubleVisitor< C >::bvisit ( const BooleanAtom ba)
inline

Definition at line 380 of file eval_double.cpp.

381 {
382 result_ = ba.get_val();
383 }

◆ bvisit() [3/13]

template<typename C >
void SymEngine::EvalRealDoubleVisitor< C >::bvisit ( const Equality x)
inline

Definition at line 324 of file eval_double.cpp.

325 {
326 double lhs_ = apply(*(x.get_arg1()));
327 double rhs_ = apply(*(x.get_arg2()));
328 result_ = (lhs_ == rhs_);
329 }

◆ bvisit() [4/13]

template<typename C >
void SymEngine::EvalRealDoubleVisitor< C >::bvisit ( const Erf x)
inline

Definition at line 312 of file eval_double.cpp.

313 {
314 double tmp = apply(*(x.get_args()[0]));
315 result_ = std::erf(tmp);
316 }
T erf(T... args)

◆ bvisit() [5/13]

template<typename C >
void SymEngine::EvalRealDoubleVisitor< C >::bvisit ( const Erfc x)
inline

Definition at line 318 of file eval_double.cpp.

319 {
320 double tmp = apply(*(x.get_args()[0]));
321 result_ = std::erfc(tmp);
322 }
T erfc(T... args)

◆ bvisit() [6/13]

template<typename C >
void SymEngine::EvalRealDoubleVisitor< C >::bvisit ( const Gamma x)
inline

Definition at line 300 of file eval_double.cpp.

301 {
302 double tmp = apply(*(x.get_args()[0]));
303 result_ = std::tgamma(tmp);
304 };
T tgamma(T... args)

◆ bvisit() [7/13]

template<typename C >
void SymEngine::EvalRealDoubleVisitor< C >::bvisit ( const LessThan x)
inline

Definition at line 338 of file eval_double.cpp.

339 {
340 double lhs_ = apply(*(x.get_arg1()));
341 double rhs_ = apply(*(x.get_arg2()));
342 result_ = (lhs_ <= rhs_);
343 }

◆ bvisit() [8/13]

template<typename C >
void SymEngine::EvalRealDoubleVisitor< C >::bvisit ( const LogGamma x)
inline

Definition at line 306 of file eval_double.cpp.

307 {
308 double tmp = apply(*(x.get_args()[0]));
309 result_ = std::lgamma(tmp);
310 }
T lgamma(T... args)

◆ bvisit() [9/13]

template<typename C >
void SymEngine::EvalRealDoubleVisitor< C >::bvisit ( const Max x)
inline

Definition at line 352 of file eval_double.cpp.

353 {
354 auto d = x.get_args();
355 auto p = d.begin();
356 double result = apply(*(*p));
357 p++;
358
359 for (; p != d.end(); p++) {
360 double tmp = apply(*(*p));
361 result = std::max(result, tmp);
362 }
363 result_ = result;
364 };
T max(T... args)

◆ bvisit() [10/13]

template<typename C >
void SymEngine::EvalRealDoubleVisitor< C >::bvisit ( const Min x)
inline

Definition at line 366 of file eval_double.cpp.

367 {
368 auto d = x.get_args();
369 auto p = d.begin();
370 double result = apply(*(*p));
371 p++;
372
373 for (; p != d.end(); p++) {
374 double tmp = apply(*(*p));
375 result = std::min(result, tmp);
376 }
377 result_ = result;
378 };
T min(T... args)

◆ bvisit() [11/13]

template<typename C >
void SymEngine::EvalRealDoubleVisitor< C >::bvisit ( const Piecewise pw)
inline

Definition at line 385 of file eval_double.cpp.

386 {
387 SYMENGINE_ASSERT_MSG(
388 eq(*pw.get_vec().back().second, *boolTrue),
389 "EvalDouble requires a (Expr, True) at the end of Piecewise");
390
391 for (const auto &expr_pred : pw.get_vec()) {
392 if (apply(*expr_pred.second) == 1.0) {
393 result_ = apply(*expr_pred.first);
394 return;
395 }
396 }
397 throw SymEngineException(
398 "Unexpectedly reached end of Piecewise function.");
399 }
bool eq(const Basic &a, const Basic &b)
Checks equality for a and b
Definition: basic-inl.h:21

◆ bvisit() [12/13]

template<typename C >
void SymEngine::EvalRealDoubleVisitor< C >::bvisit ( const StrictLessThan x)
inline

Definition at line 345 of file eval_double.cpp.

346 {
347 double lhs_ = apply(*(x.get_arg1()));
348 double rhs_ = apply(*(x.get_arg2()));
349 result_ = (lhs_ < rhs_);
350 }

◆ bvisit() [13/13]

template<typename C >
void SymEngine::EvalRealDoubleVisitor< C >::bvisit ( const Unequality x)
inline

Definition at line 331 of file eval_double.cpp.

332 {
333 double lhs_ = apply(*(x.get_arg1()));
334 double rhs_ = apply(*(x.get_arg2()));
335 result_ = (lhs_ != rhs_);
336 }

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