1 #ifndef CPPAD_CG_ORDERED_INCLUDED
2 #define CPPAD_CG_ORDERED_INCLUDED
23 throw cg::CGException(
"GreaterThanZero cannot be called for non-parameters");
32 throw cg::CGException(
"GreaterThanOrZero cannot be called for non-parameters");
35 return GreaterThanOrZero(x.
getValue());
39 bool LessThanZero(
const cg::CG<Base> &x) {
40 if (!x.isParameter()) {
41 throw cg::CGException(
"LessThanZero cannot be called for non-parameters");
44 return LessThanZero(x.getValue());
48 bool LessThanOrZero(
const cg::CG<Base> &x) {
49 if (!x.isParameter()) {
50 throw cg::CGException(
"LessThanOrZero cannot be called for non-parameters");
53 return LessThanOrZero(x.getValue());
57 bool abs_geq(
const cg::CG<Base>& x,
58 const cg::CG<Base>& y) {
59 if (!x.isParameter()) {
60 throw cg::CGException(
"abs_geq cannot be called for non-parameters (x)");
61 }
else if (!y.isParameter()) {
62 throw cg::CGException(
"abs_geq cannot be called for non-parameters (y)");
65 return abs_geq(x.getValue(), y.getValue());
const Base & getValue() const
bool GreaterThanZero(const cg::CG< Base > &x)