1 #ifndef SYMENGINE_TEST_VISITORS_H
2 #define SYMENGINE_TEST_VISITORS_H
20 void bvisit(
const Basic &x);
21 void bvisit(
const Symbol &x);
22 void bvisit(
const Number &x);
23 void bvisit(
const Set &x);
27 void bvisit(
const Abs &x);
29 void bvisit(
const Sign &x);
32 tribool apply(
const Basic &b);
45 : assumptions_(assumptions){};
46 void bvisit(
const Symbol &x);
47 void bvisit(
const Number &x);
49 void bvisit(
const Add &x);
50 void bvisit(
const Basic &x);
51 void bvisit(
const Set &x);
55 tribool apply(
const Basic &b);
61 tribool is_nonpositive_;
68 : assumptions_(assumptions){};
69 void bvisit(
const Symbol &x);
70 void bvisit(
const Number &x);
72 void bvisit(
const Basic &x);
73 void bvisit(
const Set &x);
77 tribool apply(
const Basic &b);
90 : assumptions_(assumptions){};
91 void bvisit(
const Basic &x);
92 void bvisit(
const Symbol &x);
93 void bvisit(
const Number &x);
94 void bvisit(
const Set &x);
99 tribool apply(
const Basic &b);
105 tribool is_nonnegative_;
112 : assumptions_(assumptions){};
113 void bvisit(
const Basic &x);
114 void bvisit(
const Symbol &x);
115 void bvisit(
const Number &x);
116 void bvisit(
const Set &x);
121 tribool apply(
const Basic &b);
132 : assumptions_(assumptions){};
133 void bvisit(
const Basic &x)
135 is_integer_ = tribool::indeterminate;
137 void bvisit(
const Symbol &x);
140 is_integer_ = tribool::tritrue;
142 void bvisit(
const Number &x)
144 is_integer_ = tribool::trifalse;
146 void bvisit(
const Set &x)
148 is_integer_ = tribool::trifalse;
152 is_integer_ = tribool::trifalse;
156 is_integer_ = tribool::trifalse;
159 void bvisit(
const Add &x);
160 void bvisit(
const Mul &x);
167 is_integer_ = tribool::tritrue;
170 tribool apply(
const Basic &b);
179 void check_power(
const RCP<const Basic> &base,
const RCP<const Basic> &
exp);
183 void bvisit(
const Basic &x)
185 is_real_ = tribool::indeterminate;
187 void bvisit(
const Symbol &x);
188 void bvisit(
const Number &x);
189 void bvisit(
const Set &x)
191 is_real_ = tribool::trifalse;
195 is_real_ = tribool::trifalse;
199 is_real_ = tribool::trifalse;
202 void bvisit(
const Add &x);
203 void bvisit(
const Mul &x);
204 void bvisit(
const Pow &x);
206 tribool apply(
const Basic &b);
221 : assumptions_(assumptions){};
222 void bvisit(
const Basic &x)
224 is_complex_ = tribool::indeterminate;
226 void bvisit(
const Symbol &x);
227 void bvisit(
const Number &x);
230 is_complex_ = tribool::tritrue;
234 is_complex_ = tribool::tritrue;
236 void bvisit(
const Set &x)
238 is_complex_ = tribool::trifalse;
242 is_complex_ = tribool::trifalse;
246 is_complex_ = tribool::trifalse;
250 is_complex_ = tribool::tritrue;
252 void bvisit(
const Add &x);
253 void bvisit(
const Mul &x);
254 void bvisit(
const Pow &x);
255 void bvisit(
const Cos &x)
259 void bvisit(
const Sin &x)
263 void bvisit(
const ASin &x)
267 void bvisit(
const ACos &x)
271 void bvisit(
const ATan &x);
272 void bvisit(
const ATanh &x);
273 void bvisit(
const ACot &x);
274 void bvisit(
const ACoth &x);
275 void bvisit(
const Sinh &x)
279 void bvisit(
const Cosh &x)
283 void bvisit(
const Tan &x);
284 void bvisit(
const Cot &x);
285 void bvisit(
const Sec &x);
286 void bvisit(
const ASec &x);
287 void bvisit(
const ASech &x);
288 void bvisit(
const Csc &x);
289 void bvisit(
const ACsc &x);
290 void bvisit(
const ACsch &x);
291 void bvisit(
const Log &x);
292 void bvisit(
const Sign &x)
296 void bvisit(
const Floor &x)
304 void bvisit(
const Abs &x)
314 is_complex_ = tribool::tritrue;
317 tribool apply(
const Basic &b);
323 bool is_polynomial_ =
true;
324 bool variables_allowed_ =
true;
331 void bvisit(
const Basic &x);
332 void bvisit(
const Number &x){};
334 void bvisit(
const Symbol &x);
335 void bvisit(
const Add &x);
336 void bvisit(
const Mul &x);
337 void bvisit(
const Pow &x);
338 void bvisit(
const Set &x)
340 is_polynomial_ =
false;
344 is_polynomial_ =
false;
347 bool apply(
const Basic &b);
366 tribool is_rational_;
367 bool neither_ =
false;
371 void bvisit(
const Basic &x)
373 is_rational_ = tribool::indeterminate;
375 void bvisit(
const Symbol &x)
377 is_rational_ = tribool::indeterminate;
381 is_rational_ = tribool::tritrue;
385 is_rational_ = tribool::tritrue;
387 void bvisit(
const Number &x);
388 void bvisit(
const Set &x)
390 is_rational_ = tribool::trifalse;
395 is_rational_ = tribool::trifalse;
400 is_rational_ = tribool::trifalse;
404 void bvisit(
const Add &x);
406 tribool apply(
const Basic &b);
420 void bvisit(
const Basic &x);
421 void bvisit(
const Symbol &x);
422 void bvisit(
const Infty &x);
423 void bvisit(
const NaN &x);
424 void bvisit(
const Number &x);
425 void bvisit(
const Set &x);
430 tribool apply(
const Basic &b);
436 tribool is_algebraic_;
439 void trans_nonzero_and_algebraic(
const Basic &b);
447 void bvisit(
const Basic &x);
448 void bvisit(
const Add &x);
449 void bvisit(
const Symbol &x);
452 void bvisit(
const Set &x);
460 tribool apply(
const Basic &b);
The base class for representing addition in symbolic expressions.
The lowest unit of symbolic representation.
RCP< const Basic > get_arg() const
Main namespace for SymEngine package.
RCP< const Basic > exp(const RCP< const Basic > &x)
Returns the natural exponential function E**x = pow(E, x)
bool is_polynomial(const Basic &b, const set_basic &variables)
Check if expression is a polynomial.
RCP< const Number > rational(long n, long d)
convenience creator from two longs