8 #define CONSTRAINT_HASH(_lhs, _rel, _type) (size_t)((size_t)(std::hash<_type>()(_lhs) << 3) ^ (size_t)_rel)
14 template<
typename Pol>
69 if(
m_lhs.constant_part() == 0) {
71 }
else if(
m_lhs.constant_part() > 0) {
74 assert(
m_lhs.constant_part() < 0);
83 if(
m_lhs.constant_part() == 0) {
85 }
else if(
m_lhs.constant_part() > 0) {
88 assert(
m_lhs.constant_part() < 0);
113 return !(lhs == rhs);
124 return lhs == rhs || lhs < rhs;
138 template<
typename Pol>
149 template<
typename Poly>
151 return os << c.
lhs() <<
" " << c.
relation() <<
" 0";
160 template<
typename Pol>
161 struct hash<
carl::BasicConstraint<Pol>> {
167 return constraint.
hash();
174 template<
typename Pol>
175 struct hash<std::vector<carl::BasicConstraint<Pol>>> {
181 std::size_t seed = arg.size();
183 seed ^= std::hash<carl::BasicConstraint<Pol>>()(c) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
#define CONSTRAINT_HASH(_lhs, _rel, _type)
MultivariatePolynomial< Rational > Pol
carl is the main namespace for the library.
bool operator>(const BasicConstraint< P > &lhs, const BasicConstraint< P > &rhs)
bool operator<(const BasicConstraint< P > &lhs, const BasicConstraint< P > &rhs)
bool is_constant(const ContextPolynomial< Coeff, Ordering, Policies > &p)
std::ostream & operator<<(std::ostream &os, const BasicConstraint< Poly > &c)
Prints the given constraint on the given stream.
bool is_strict(Relation r)
bool operator!=(const BasicConstraint< P > &lhs, const BasicConstraint< P > &rhs)
bool operator<=(const BasicConstraint< P > &lhs, const BasicConstraint< P > &rhs)
Relation inverse(Relation r)
Inverts the given relation symbol.
bool operator==(const BasicConstraint< P > &lhs, const BasicConstraint< P > &rhs)
bool operator>=(const BasicConstraint< P > &lhs, const BasicConstraint< P > &rhs)
void variables(const BasicConstraint< Pol > &c, carlVariables &vars)
Represent a polynomial (in)equality against zero.
BasicConstraint(const Pol &lhs, const Relation rel)
void set_relation(Relation rel)
bool is_trivial_true() const
Pol m_lhs
The polynomial which is compared by this constraint to zero.
std::size_t m_hash
Cache for the hash.
Relation m_relation
The relation symbol comparing the polynomial considered by this constraint to zero.
BasicConstraint(bool is_true)
BasicConstraint< Pol > negation() const
BasicConstraint(Pol &&lhs, const Relation rel)
bool is_trivial_false() const
unsigned is_consistent() const
Relation relation() const
std::size_t operator()(const carl::BasicConstraint< Pol > &constraint) const
std::size_t operator()(const std::vector< carl::BasicConstraint< Pol >> &arg) const