23 using namespace Couenne;
29 register int t1 = v1 -> Type (), t2;
30 return (((t1 ==
VAR) || (t1 ==
AUX)) &&
31 (((t2 = v2 -> Type ()) ==
VAR) || (t2 ==
AUX)) &&
32 (v1 -> Index () == v2 -> Index ()));
43 std::map <int, CouNumber> indCoe;
45 p -> flattenMul (
this, coeff, indCoe);
51 for (std::map <int, CouNumber>::iterator i = indCoe.begin (); i != indCoe.end (); ++i)
52 if (i -> second == 1.) arglist [nArgs++] =
new exprClone (p -> Var (i -> first));
76 return (addAux ? (p -> addAuxiliary (simMul)) :
new exprAux (simMul, p -> domain ()));
101 bool isBinProd =
true;
102 for (
int i=
nargs_; i--;) {
153 std::queue <expression *> queue;
155 for (
int i=0; i<
nargs_; i++)
160 while (queue.size() > 1) {
162 expression *arg1 = queue.front (); queue.pop ();
163 expression *arg2 = queue.front (); queue.pop ();
173 if (!(queue.empty ()))
174 aux = p -> addAuxiliary (aux);
179 aux = queue.front (); queue.pop ();
202 for (
int i = 1; i <
nargs_;) {
204 if (i < nargs_ - 1 && ((type==
tri_bi) || (i!=1))) {
225 printf (
"Couenne, exprTrilinear: bad ordering of factors in product, aborting\n");
235 aux = p -> addAuxiliary (aux);
248 aux = p -> addAuxiliary (aux);
277 for (
int i = 1; i <
nargs_ - 1; i++)
291 retExpr = p -> addAuxiliary (retExpr);
295 return (addAux ? (p -> addAuxiliary (retExpr)) :
new exprAux (retExpr, p -> domain ()));
virtual bool isInteger()
is this expression integer?
virtual exprAux * standardize(CouenneProblem *, bool addAux=true)
generate auxiliary variable
Power of an expression (binary operator), with constant.
exprMul(expression **, int)
Constructor.
int nArgs() const
return number of arguments
Class for MINLP problems with symbolic information.
expression clone (points to another expression)
expression ** arglist_
argument list is an array of pointers to other expressions
double CouNumber
main number type in Couenne
int nargs_
number of arguments (cardinality of arglist)
class for multiplications
virtual exprAux * standardize(CouenneProblem *p, bool addAux=true)
reduce expression in standard form, creating additional aux variables (and constraints) ...
virtual void getBounds(expression *&, expression *&)
Get lower and upper bound of an expression (if any)
virtual expression * Copy() const
return copy of this expression (only makes sense in exprCopy)
class for multiplications,