21 using namespace Couenne;
53 for (exprGroup::lincoeff::iterator el = lcoe.begin (); el != lcoe.end (); ++el)
54 lmap.
insert (el -> first ->
Index (), el -> second);
62 for (exprQuad::sparseQ::iterator row = M.begin (); row != M.end (); ++row) {
64 int xind = row -> first ->
Index ();
66 for (exprQuad::sparseQcol::iterator col = row -> second.begin ();
67 col != row -> second.end (); ++col)
68 qmap.
insert (xind, col -> first ->
Index (), col -> second);
78 for (
int i=0; i<
nargs_; i++)
79 p -> decomposeTerm (
arglist_ [i], 1, c0, lmap, qmap);
83 if (p -> Jnlst () -> ProduceOutput (Ipopt::J_ALL,
J_REFORMULATE)) {
84 printf (
"decompTerm: lin [");
85 for (std::map <int, CouNumber>::iterator i = lmap.
Map().begin (); i != lmap.
Map().end (); ++i)
86 printf (
"<%d,%g>", i -> first, i -> second);
87 printf (
"] -- quad [");
88 for (std::map <std::pair <int, int>,
CouNumber>::iterator i = qmap.
Map ().begin (); i != qmap.
Map ().end (); ++i)
89 printf (
"<%d,%d,%g>", i -> first.first, i -> first.second, i -> second);
90 printf (
"] (%g)\n", c0);
93 return p -> linStandardize (addAux, c0, lmap, qmap);
112 p -> decomposeTerm (
argument_, -1., c0, lmap, qmap);
114 return p -> linStandardize (addAux, c0, lmap, qmap);
138 p -> decomposeTerm (
arglist_ [0], 1., c0, lmap, qmap);
139 p -> decomposeTerm (
arglist_ [1], -1., c0, lmap, qmap);
141 return p -> linStandardize (addAux, c0, lmap, qmap);
class Group, with constant, linear and nonlinear terms:
std::vector< std::pair< exprVar *, sparseQcol > > sparseQ
expression * argument_
single argument taken by this expression
virtual int Index() const
Return index of variable (only valid for exprVar and exprAux)
void insert(int indI, int indJ, CouNumber coe)
insert a pair <<int,int>,CouNumber> into a map for quadratic terms
void insert(int index, CouNumber coe)
insert a pair <int,CouNumber> into a map for linear terms
Class for MINLP problems with symbolic information.
const Ipopt::EJournalCategory J_REFORMULATE(Ipopt::J_USER7)
exprAux * standardize(CouenneProblem *, bool addAux=true)
standardization (to deal with complex arguments)
std::map< int, CouNumber > & Map()
public access
expression ** arglist_
argument list is an array of pointers to other expressions
std::vector< std::pair< exprVar *, CouNumber > > lincoeff
double CouNumber
main number type in Couenne
int nargs_
number of arguments (cardinality of arglist)
class exprQuad, with constant, linear and quadratic terms
std::map< std::pair< int, int >, CouNumber > & Map()
public access
virtual exprAux * standardize(CouenneProblem *p, bool addAux=true)
Reduce expression in standard form, creating additional aux variables (and constraints) ...
virtual enum expr_type code()
Code for comparison.
virtual exprAux * standardize(CouenneProblem *p, bool addAux=true)
Reduce expression in standard form, creating additional aux variables (and constraints) ...