Definition at line 9 of file test_visitors.h.
◆ ZeroVisitor()
SymEngine::ZeroVisitor::ZeroVisitor |
( |
const Assumptions * |
assumptions | ) |
|
|
inline |
◆ apply()
tribool SymEngine::ZeroVisitor::apply |
( |
const Basic & |
b | ) |
|
Definition at line 76 of file test_visitors.cpp.
77{
78 b.accept(*this);
79 return is_zero_;
80}
◆ bvisit() [1/11]
void SymEngine::ZeroVisitor::bvisit |
( |
const Abs & |
x | ) |
|
◆ bvisit() [2/11]
void SymEngine::ZeroVisitor::bvisit |
( |
const Basic & |
x | ) |
|
◆ bvisit() [3/11]
void SymEngine::ZeroVisitor::bvisit |
( |
const Boolean & |
x | ) |
|
◆ bvisit() [4/11]
void SymEngine::ZeroVisitor::bvisit |
( |
const Conjugate & |
x | ) |
|
◆ bvisit() [5/11]
void SymEngine::ZeroVisitor::bvisit |
( |
const Constant & |
x | ) |
|
◆ bvisit() [6/11]
void SymEngine::ZeroVisitor::bvisit |
( |
const Number & |
x | ) |
|
Definition at line 58 of file test_visitors.cpp.
59{
60 if (bool(x.is_zero())) {
61 is_zero_ = tribool::tritrue;
62 } else {
63 is_zero_ = tribool::trifalse;
64 }
65}
◆ bvisit() [7/11]
void SymEngine::ZeroVisitor::bvisit |
( |
const PrimePi & |
x | ) |
|
Definition at line 52 of file test_visitors.cpp.
53{
54
55 is_zero_ = is_negative(*
sub(x.get_arg(),
integer(2)));
56}
RCP< const Basic > sub(const RCP< const Basic > &a, const RCP< const Basic > &b)
Substracts b from a.
std::enable_if< std::is_integral< T >::value, RCP< constInteger > >::type integer(T i)
◆ bvisit() [8/11]
void SymEngine::ZeroVisitor::bvisit |
( |
const Relational & |
x | ) |
|
◆ bvisit() [9/11]
void SymEngine::ZeroVisitor::bvisit |
( |
const Set & |
x | ) |
|
◆ bvisit() [10/11]
void SymEngine::ZeroVisitor::bvisit |
( |
const Sign & |
x | ) |
|
◆ bvisit() [11/11]
void SymEngine::ZeroVisitor::bvisit |
( |
const Symbol & |
x | ) |
|
Definition at line 67 of file test_visitors.cpp.
68{
69 if (assumptions_) {
70 is_zero_ = assumptions_->is_zero(x.rcp_from_this());
71 } else {
72 is_zero_ = tribool::indeterminate;
73 }
74}
◆ error()
void SymEngine::ZeroVisitor::error |
( |
| ) |
|
|
private |
Definition at line 6 of file test_visitors.cpp.
7{
8 throw SymEngineException(
9 "Only numeric types allowed for is_zero/is_nonzero");
10}
◆ assumptions_
const Assumptions* SymEngine::ZeroVisitor::assumptions_ |
|
private |
◆ is_zero_
tribool SymEngine::ZeroVisitor::is_zero_ |
|
private |
The documentation for this class was generated from the following files: