41 CARL_LOG_ERROR(
"carl.sign",
"Invalid sign " << std::underlying_type_t<Sign>(sign));
42 assert(
false &&
"Invalid sign");
53 template<
typename Number>
68 template<
typename InputIterator>
70 while ((*begin ==
Sign::ZERO) && (begin != end))
73 std::size_t changes = 0;
74 for (
Sign last = *begin; begin != end; ++begin) {
76 if (*begin != last) ++changes;
94 template<
typename InputIterator,
typename Function>
95 std::size_t
sign_variations(InputIterator begin, InputIterator end,
const Function& f) {
96 while ((begin != end) && (f(*begin) ==
Sign::ZERO))
98 if (begin == end)
return 0;
100 std::size_t changes = 0;
101 for (
Sign last = f(*begin); begin != end; ++begin) {
103 if (f(*begin) != last) ++changes;
A small wrapper that configures logging for carl.
#define CARL_LOG_ERROR(channel, msg)
carl is the main namespace for the library.
std::ostream & operator<<(std::ostream &os, const BasicConstraint< Poly > &c)
Prints the given constraint on the given stream.
std::size_t sign_variations(InputIterator begin, InputIterator end)
Counts the number of sign variations in the given object range.
Sign
This class represents the sign of a number .
@ NEGATIVE
Indicates that .
@ POSITIVE
Indicates that .
Sign sgn(const Number &n)
Obtain the sign of the given number.