32 using namespace Couenne;
41 std::cerr <<
"*** Error: " << fname <<
" not implemented" << std::endl;
47 expression *CouenneProblem::nl2e (expr *
e,
const ASL *asl) {
51 case OPPLUS:
return new exprSum (nl2e (e ->
L.e, asl), nl2e (e -> R.e, asl));
52 case OPMINUS:
return new exprSub (nl2e (e ->
L.e, asl), nl2e (e -> R.e, asl));
53 case OPMULT:
return new exprMul (nl2e (e ->
L.e, asl), nl2e (e -> R.e, asl));
54 case OPDIV:
return new exprDiv (nl2e (e ->
L.e, asl), nl2e (e -> R.e, asl));
55 case OPREM:
notimpl (
"remainder");
56 case OPPOW:
return new exprPow (nl2e (e ->
L.e, asl), nl2e (e -> R.e, asl));
62 case ABS:
return new exprAbs (nl2e (e ->
L.e, asl));
63 case OPUMINUS:
return new exprOpp (nl2e (e ->
L.e, asl));
65 case OPIFnl: {
notimpl (
"ifnl");
70 case OP_tanh:
return new exprDiv
82 case OP_sin:
return new exprSin (nl2e (e ->
L.e, asl));
85 case OP_log:
return new exprLog (nl2e (e ->
L.e, asl));
86 case OP_exp:
return new exprExp (nl2e (e ->
L.e, asl));
91 case OP_cos:
return new exprCos (nl2e (e ->
L.e, asl));
92 case OP_atanh:
notimpl (
"atanh");
93 case OP_atan2:
notimpl (
"atan2");
95 case OP_asinh:
notimpl (
"asinh");
97 case OP_acosh:
notimpl (
"acosh");
103 for (expr **ep = e->L.ep; ep < e->R.ep; ep++)
104 al [i++] = nl2e (*ep, asl);
107 case OPintDIV:
notimpl (
"intdiv");
108 case OPprecision:
notimpl (
"precision");
109 case OPround:
notimpl (
"round");
110 case OPtrunc:
notimpl (
"trunc");
112 case OP1POW:
return new exprPow (nl2e (e ->
L.e, asl),
new exprConst (((expr_n *)e->R.e)->v));
114 case OPCPOW:
return new exprPow (
new exprConst (((expr_n *)e->L.e)->v), nl2e (e -> R.e, asl));
115 case OPFUNCALL:
notimpl (
"function call");
116 case OPNUM:
return new exprConst (((expr_n *)e)->v);
117 case OPPLTERM:
notimpl (
"plterm");
118 case OPIFSYM:
notimpl (
"ifsym");
122 int j = ((expr_v *) e) ->
a;
128 j = ((expr_v *) e) - ((
const ASL_fg *) asl) -> I.var_e_;
131 printf (
"error: unknown variable x_%d\n", j);
140 printf (
"Couenne error: unknown operator (address %p), aborting.\n",
Intcast (e -> op));
CouExpr & log(CouExpr &e)
void fint fint fint real * a
Power of an expression (binary operator), with constant.
void fint fint fint real fint real real real real real real real real real * e
int ndefined_
Number of "defined variables" (aka "common expressions")
expression clone (points to another expression)
std::vector< exprVar * > variables_
Variables (original, auxiliary, and defined)
int nOrigVars_
Number of original variables.
void notimpl(const std::string &fname)
class for the exponential,