20 template<
typename Pol,
bool AutoSimplify = false>
45 template<
typename P = Pol, DisableIf<needs_cache_type<P>> = dummy>
72 if (nom.is_constant() && denom.is_constant()) {
167 CARL_LOG_WARN(
"carl.core",
"Calling simplify on rational function with AutoSimplify");
218 std::set<Variable> vars;
266 std::string
toString(
bool infix =
true,
bool friendlyNames =
true)
const;
275 template<
bool byInverse = false>
278 template<
bool byInverse = false>
281 template<
bool byInverse = false,
typename P = Pol, DisableIf<needs_cache_type<P>> = dummy>
284 template<
bool byInverse = false>
296 return this->
template add<false>(rhs);
300 return this->
template add<false>(rhs);
305 return this->
template add<false>(tmp);
310 return this->
template add<false>(tmp);
313 template<
typename P = Pol, DisableIf<needs_cache_type<P>> = dummy>
315 return this->
template add<false>(rhs);
319 return this->
template add<false>(rhs);
331 return this->
template add<true>(rhs);
335 return this->
template add<true>(rhs);
339 return (*
this -=
Pol(rhs));
343 return (*
this -=
Pol(rhs));
346 template<
typename P = Pol, DisableIf<needs_cache_type<P>> = dummy>
348 return this->
template add<true>(rhs);
352 return this->
template add<true>(rhs);
366 return (*
this *=
Pol(rhs));
369 return (*
this *=
Pol(rhs));
371 template<
typename P = Pol, DisableIf<needs_cache_type<P>> = dummy>
387 return (*
this /=
Pol(rhs));
390 return (*
this /=
Pol(rhs));
392 template<
typename P = Pol, DisableIf<needs_cache_type<P>> = dummy>
398 template<
typename PolA,
bool ASA>
401 template<
typename PolA,
bool ASA>
404 template<
typename PolA,
bool ASA>
408 template<
typename Pol,
bool AS>
413 template<
typename Pol,
bool AS>
418 template<
typename Pol,
bool AS, DisableIf<needs_cache_type<Pol>> = dummy>
423 template<
typename Pol,
bool AS, DisableIf<needs_cache_type<Pol>> = dummy>
428 template<
typename Pol,
bool AS, DisableIf<needs_cache_type<Pol>> = dummy>
433 template<
typename Pol,
bool AS>
438 template<
typename Pol,
bool AS>
443 template<
typename Pol,
bool AS>
448 template<
typename Pol,
bool AS>
453 template<
typename Pol,
bool AS, DisableIf<needs_cache_type<Pol>> = dummy>
458 template<
typename Pol,
bool AS, DisableIf<needs_cache_type<Pol>> = dummy>
463 template<
typename Pol,
bool AS, DisableIf<needs_cache_type<Pol>> = dummy>
468 template<
typename Pol,
bool AS>
473 template<
typename Pol,
bool AS>
478 template<
typename Pol,
bool AS>
483 template<
typename Pol,
bool AS, DisableIf<needs_cache_type<Pol>> = dummy>
488 template<
typename Pol,
bool AS, DisableIf<needs_cache_type<Pol>> = dummy>
493 template<
typename Pol,
bool AS, DisableIf<needs_cache_type<Pol>> = dummy>
498 template<
typename Pol,
bool AS>
503 template<
typename Pol,
bool AS>
508 template<
typename Pol,
bool AS>
513 template<
typename Pol,
bool AS>
518 template<
typename Pol,
bool AS>
523 template<
typename Pol,
bool AS>
528 template<
typename Pol,
bool AS, DisableIf<needs_cache_type<Pol>> = dummy>
533 template<
typename Pol,
bool AS, DisableIf<needs_cache_type<Pol>> = dummy>
538 template<
typename Pol,
bool AS, DisableIf<needs_cache_type<Pol>> = dummy>
543 template<
typename Pol,
bool AS>
548 template<
typename Pol,
bool AS>
554 template<
typename Pol,
bool AS>
556 static_assert(!std::is_same<Pol, Pol>::value,
"Use carl::pow(rf, exp) instead. ");
558 for (
unsigned i =
exp; i > 0; --i) {
564 template<
typename Pol,
bool AS>
566 return !(lhs == rhs);
572 template<
typename Pol,
bool AS>
573 struct hash<
carl::RationalFunction<Pol, AS>> {
#define CARL_LOG_WARN(channel, msg)
MultivariatePolynomial< Rational > Pol
carl is the main namespace for the library.
Interval< Number > operator/(const Interval< Number > &lhs, const Number &rhs)
Operator for the division of an interval and a number.
Interval< Number > operator+(const Interval< Number > &lhs, const Interval< Number > &rhs)
Operator for the addition of two intervals.
Interval< Number > quotient(const Interval< Number > &_lhs, const Interval< Number > &_rhs)
Implements the division with remainder.
Interval< Number > exp(const Interval< Number > &i)
bool is_zero(const Interval< Number > &i)
Check if this interval is a point-interval containing 0.
Interval< Number > operator*(const Interval< Number > &lhs, const Interval< Number > &rhs)
Operator for the multiplication of two intervals.
bool evaluate(const BasicConstraint< Poly > &c, const Assignment< Number > &m)
cln::cl_I get_num(const cln::cl_RA &n)
Extract the numerator from a fraction.
Coeff substitute(const Monomial &m, const std::map< Variable, Coeff > &substitutions)
Applies the given substitutions to a monomial.
Interval< Number > operator-(const Interval< Number > &rhs)
Unary minus.
bool operator!=(const BasicConstraint< P > &lhs, const BasicConstraint< P > &rhs)
cln::cl_I get_denom(const cln::cl_RA &n)
Extract the denominator from a fraction.
std::size_t hash_all(Args &&... args)
Hashes an arbitrary number of values.
Interval< Number > pow(const Interval< Number > &i, Integer exp)
bool is_one(const Interval< Number > &i)
Check if this interval is a point-interval containing 1.
auto & get(const std::string &name)
A Variable represents an algebraic variable that can be used throughout carl.
std::shared_ptr< const Monomial > Arg
Represents a single term, that is a numeric coefficient and a monomial.
RationalFunction & operator-=(const CoeffType &rhs)
Subtract something from this rational function and return the changed rational function.
void eliminateCommonFactor(bool _justNormalize)
Helper function for simplify which eliminates the common factor.
CoeffType evaluate(const std::map< Variable, CoeffType > &substitutions) const
Evaluate the polynomial at the point described by substitutions.
RationalFunction & operator+=(const Monomial::Arg &rhs)
Add something to this rational function and return the changed rational function.
const Pol & nominatorAsPolynomial() const
friend std::ostream & operator<<(std::ostream &os, const RationalFunction< PolA, ASA > &rhs)
RationalFunction & operator*=(const Pol &rhs)
Multiply something with this rational function and return the changed rational function.
RationalFunction & operator*=(const CoeffType &rhs)
Multiply something with this rational function and return the changed rational function.
RationalFunction(std::optional< std::pair< Pol, Pol >> &"ient, const CoeffType &num, bool simplified)
RationalFunction & operator/=(const Monomial::Arg &rhs)
Divide this rational function by something and return the changed rational function.
RationalFunction & operator-=(const RationalFunction &rhs)
Subtract something from this rational function and return the changed rational function.
RationalFunction & operator-=(const Monomial::Arg &rhs)
Subtract something from this rational function and return the changed rational function.
RationalFunction(const RationalFunction &_rf)=default
typename Pol::CoeffType CoeffType
RationalFunction & operator/=(const CoeffType &rhs)
Divide this rational function by something and return the changed rational function.
RationalFunction(Pol &&nom, Pol &&denom)
RationalFunction & operator/=(const Term< CoeffType > &rhs)
Divide this rational function by something and return the changed rational function.
CoeffType constant_part() const
std::set< Variable > gatherVariables() const
Collect all occurring variables.
RationalFunction & add(const RationalFunction &rhs)
RationalFunction & operator*=(carl::sint rhs)
Multiply something with this rational function and return the changed rational function.
RationalFunction(Pol &&p)
RationalFunction derivative(const Variable &x, unsigned nth=1) const
Derivative of the rational function with respect to variable x.
RationalFunction & operator+=(const Term< CoeffType > &rhs)
Add something to this rational function and return the changed rational function.
bool isSimplified() const
Checks if this rational function has been simplified since it's last modification.
RationalFunction & add(const CoeffType &rhs)
std::optional< std::pair< Pol, Pol > > mPolynomialQuotient
typename Pol::NumberType NumberType
friend bool operator<(const RationalFunction< PolA, ASA > &lhs, const RationalFunction< PolA, ASA > &rhs)
RationalFunction & operator*=(const Monomial::Arg &rhs)
Multiply something with this rational function and return the changed rational function.
RationalFunction(const Pol &nom, const Pol &denom)
RationalFunction inverse() const
Returns the inverse of this rational function.
RationalFunction(RationalFunction &&_rf)=default
RationalFunction(Variable v)
RationalFunction & operator-=(Variable rhs)
Subtract something from this rational function and return the changed rational function.
friend bool operator==(const RationalFunction< PolA, ASA > &lhs, const RationalFunction< PolA, ASA > &rhs)
RationalFunction & operator*=(Variable rhs)
Multiply something with this rational function and return the changed rational function.
RationalFunction & operator/=(unsigned long rhs)
Divide this rational function by something and return the changed rational function.
RationalFunction & operator*=(const Term< CoeffType > &rhs)
Multiply something with this rational function and return the changed rational function.
RationalFunction & operator-=(const Term< CoeffType > &rhs)
Subtract something from this rational function and return the changed rational function.
RationalFunction & add(Variable rhs)
RationalFunction & operator-=(const Pol &rhs)
Subtract something from this rational function and return the changed rational function.
void gatherVariables(std::set< Variable > &vars) const
Add all occurring variables to the set vars.
RationalFunction & operator/=(const Pol &rhs)
Divide this rational function by something and return the changed rational function.
RationalFunction & add(const Pol &rhs)
RationalFunction & operator+=(const RationalFunction &rhs)
Add something to this rational function and return the changed rational function.
RationalFunction & operator+=(Variable rhs)
Add something to this rational function and return the changed rational function.
RationalFunction(const CoeffType &c)
RationalFunction & operator/=(Variable rhs)
Divide this rational function by something and return the changed rational function.
bool is_zero() const
Check whether the rational function is zero.
RationalFunction & operator+=(const CoeffType &rhs)
Add something to this rational function and return the changed rational function.
RationalFunction & operator+=(const Pol &rhs)
Add something to this rational function and return the changed rational function.
RationalFunction(const Pol &p)
const Pol & denominatorAsPolynomial() const
CoeffType nominatorAsNumber() const
RationalFunction substitute(const std::map< Variable, CoeffType > &substitutions) const
RationalFunction & operator/=(const RationalFunction &rhs)
Divide this rational function by something and return the changed rational function.
~RationalFunction() noexcept=default
CoeffType mNumberQuotient
CoeffType denominatorAsNumber() const
std::string toString(bool infix=true, bool friendlyNames=true) const
RationalFunction & operator*=(const RationalFunction &rhs)
Multiply something with this rational function and return the changed rational function.
std::size_t operator()(const carl::RationalFunction< Pol, AS > &r) const