Definition at line 357 of file solve.cpp.
◆ InvertComplexVisitor()
SymEngine::InvertComplexVisitor::InvertComplexVisitor |
( |
RCP< const Set > |
gY, |
|
|
RCP< const Dummy > |
nD, |
|
|
RCP< const Symbol > |
sym, |
|
|
RCP< const Set > |
domain |
|
) |
| |
|
inline |
Definition at line 367 of file solve.cpp.
369 : gY_(gY), nD_(nD), sym_(sym), domain_(domain)
370 {
371 }
◆ apply()
RCP< const Set > SymEngine::InvertComplexVisitor::apply |
( |
const Basic & |
b | ) |
|
|
inline |
Definition at line 448 of file solve.cpp.
449 {
450 result_ = gY_;
451 b.accept(*this);
453 }
T set_intersection(T... args)
◆ bvisit() [1/4]
void SymEngine::InvertComplexVisitor::bvisit |
( |
const Add & |
x | ) |
|
|
inline |
Definition at line 378 of file solve.cpp.
379 {
380 vec_basic f1X, f2X;
381 for (auto &elem : x.get_args()) {
382 if (has_symbol(*elem, *sym_)) {
384 } else {
385 f2X.push_back(elem);
386 }
387 }
388 auto depX =
add(f1X), indepX =
add(f2X);
389 if (not
eq(*indepX, *zero)) {
390 gY_ = imageset(nD_,
sub(nD_, indepX), gY_);
391 result_ = apply(*depX);
392 } else {
393 result_ = gY_;
394 }
395 }
bool eq(const Basic &a, const Basic &b)
Checks equality for a and b
RCP< const Basic > sub(const RCP< const Basic > &a, const RCP< const Basic > &b)
Substracts b from a.
RCP< const Basic > add(const RCP< const Basic > &a, const RCP< const Basic > &b)
Adds two objects (safely).
◆ bvisit() [2/4]
void SymEngine::InvertComplexVisitor::bvisit |
( |
const Basic & |
x | ) |
|
|
inline |
Definition at line 373 of file solve.cpp.
374 {
375 result_ = gY_;
376 }
◆ bvisit() [3/4]
void SymEngine::InvertComplexVisitor::bvisit |
( |
const Mul & |
x | ) |
|
|
inline |
Definition at line 397 of file solve.cpp.
398 {
399 vec_basic f1X, f2X;
400 for (auto &elem : x.get_args()) {
401 if (has_symbol(*elem, *sym_)) {
403 } else {
404 f2X.push_back(elem);
405 }
406 }
407 auto depX =
mul(f1X), indepX =
mul(f2X);
408 if (not
eq(*indepX, *one)) {
409 if (
eq(*indepX, *NegInf) or
eq(*indepX, *Inf)
410 or
eq(*indepX, *ComplexInf)) {
412 } else {
413 gY_ = imageset(nD_,
div(nD_, indepX), gY_);
414 result_ = apply(*depX);
415 }
416 } else {
417 result_ = gY_;
418 }
419 }
RCP< const Basic > div(const RCP< const Basic > &a, const RCP< const Basic > &b)
Division.
RCP< const EmptySet > emptyset()
RCP< const Basic > mul(const RCP< const Basic > &a, const RCP< const Basic > &b)
Multiplication.
◆ bvisit() [4/4]
void SymEngine::InvertComplexVisitor::bvisit |
( |
const Pow & |
x | ) |
|
|
inline |
Definition at line 421 of file solve.cpp.
422 {
423 if (
eq(*x.get_base(), *E) and is_a<FiniteSet>(*gY_)) {
424 set_set inv;
425 for (const auto &elem :
426 down_cast<const FiniteSet &>(*gY_).get_container()) {
427 if (
eq(*elem, *zero))
428 continue;
429 RCP<const Basic> re, im;
430 as_real_imag(elem, outArg(re), outArg(im));
432 auto logarg =
atan2(im, re);
433 inv.insert(imageset(
434 nD_,
438 true)));
439
440 }
442 apply(*x.get_exp());
443 return;
444 }
445 result_ = gY_;
446 }
RCP< const Basic > atan2(const RCP< const Basic > &num, const RCP< const Basic > &den)
Canonicalize ATan2:
RCP< const Basic > log(const RCP< const Basic > &arg)
Returns the Natural Logarithm from argument arg
std::enable_if< std::is_integral< T >::value, RCP< constInteger > >::type integer(T i)
RCP< const Set > interval(const RCP< const Number > &start, const RCP< const Number > &end, const bool left_open=false, const bool right_open=false)
◆ domain_
RCP<const Set> SymEngine::InvertComplexVisitor::domain_ |
|
protected |
◆ gY_
RCP<const Set> SymEngine::InvertComplexVisitor::gY_ |
|
protected |
◆ nD_
RCP<const Dummy> SymEngine::InvertComplexVisitor::nD_ |
|
protected |
◆ result_
RCP<const Set> SymEngine::InvertComplexVisitor::result_ |
|
protected |
◆ sym_
RCP<const Symbol> SymEngine::InvertComplexVisitor::sym_ |
|
protected |
The documentation for this class was generated from the following file:
- /home/runner/work/symengine/symengine/symengine/solve.cpp