16 using namespace Ipopt;
17 using namespace Couenne;
20 int CouenneDisjCuts::separateWithDisjunction (OsiCuts *cuts,
21 OsiSolverInterface &si,
23 const CglTreeInfo &
info)
const {
25 if (jnlst_ -> ProduceOutput (J_VECTOR,
J_DISJCUTS) &&
26 ((cuts -> sizeRowCuts ()) ||
27 (cuts -> sizeColCuts ()))) {
29 printf (
"applying unilateral cuts:\n");
31 if (cuts -> sizeRowCuts ()) {
33 for (
int i=0; i < cuts -> sizeRowCuts (); i++) cuts -> rowCutPtr (i) -> print ();
36 if (cuts -> sizeColCuts ()) {
38 for (
int i=0; i < cuts -> sizeColCuts (); i++) cuts -> colCutPtr (i) -> print ();
42 int ncols = si.getNumCols ();
46 p -> domain () -> push (&si);
49 for (
int i = cuts -> sizeColCuts (); i--;) {
51 const CoinPackedVector
52 &lb = cuts -> colCutPtr (i) -> lbs (),
53 &ub = cuts -> colCutPtr (i) -> ubs ();
56 *lind = lb.getIndices (),
57 *uind = ub.getIndices ();
60 *lval = lb.getElements (), *oLB = si.getColLower (),
61 *uval = ub.getElements (), *oUB = si.getColUpper ();
63 for (
int j=lb.getNumElements ();
j--; lind++, lval++)
65 p -> Lb (*lind) = *lval;
66 chg [*lind].
setLower (t_chg_bounds::CHANGED);
69 for (
int j=ub.getNumElements ();
j--; uind++, uval++)
71 p -> Ub (*uind) = *uval;
72 chg [*uind].
setUpper (t_chg_bounds::CHANGED);
81 couenneCG_ -> genRowCuts (si, *cuts, nchanged, changed, chg);
83 p -> domain () -> pop ();
void fint fint fint real fint real real real real real real real real real fint real fint fint fint real fint fint fint fint * info
status of lower/upper bound of a variable, to be checked/modified in bound tightening ...
void setLower(ChangeStatus lower)
void sparse2dense(int ncols, t_chg_bounds *chg_bds, int *&changed, int &nchanged)
translate sparse to dense vector (should be replaced)
const Ipopt::EJournalCategory J_DISJCUTS(Ipopt::J_USER6)
void setUpper(ChangeStatus upper)
Class for MINLP problems with symbolic information.