17 template<
typename Number>
22 "\n****************************\n"
24 <<
"****************************\n"
25 <<
"p = " << p <<
"\n"
26 <<
"m = " << m <<
"\n"
27 <<
"****************************\n");
28 for(
const auto& entry : m) {
29 assert(entry.second.isThom());
30 assert(entry.first == entry.second.getThomEncoding().main_var());
34 std::map<Variable, RealAlgebraicNumber<Number>>& m_prime(m);
35 auto it = m_prime.begin();
36 while(it != m_prime.end()) {
37 if(!p.
has(it->first)) {
39 it = m_prime.erase(it);
47 std::map<Variable, ThomEncoding<Number>> mTE;
48 for(
const auto& entry : m_prime) {
49 mTE.insert(std::make_pair(entry.first, entry.second.getThomEncoding()));
55 int sgn = int(mTE.begin()->second.signOnPolynomial(p));
56 CARL_LOG_TRACE(
"carl.thom.evaluation",
"sign of evaluated polynomial is " <<
sgn);
#define CARL_LOG_TRACE(channel, msg)
#define CARL_LOG_ASSERT(channel, condition, msg)
#define CARL_LOG_INFO(channel, msg)
carl is the main namespace for the library.
RealAlgebraicNumber< Number > evaluateTE(const MultivariatePolynomial< Number > &p, std::map< Variable, RealAlgebraicNumber< Number >> &m)
Sign sgn(const Number &n)
Obtain the sign of the given number.
void variables(const BasicConstraint< Pol > &c, carlVariables &vars)
A Variable represents an algebraic variable that can be used throughout carl.
bool has(Variable v) const
Sign signOnPolynomial(const Polynomial &p) const
static ThomEncoding< Number > analyzeTEMap(const std::map< Variable, ThomEncoding< Number >> &m)