Skip to content

Commit b96b1e1

Browse files
committed
Redef topo order except UEnc #248
1 parent fcf769d commit b96b1e1

File tree

4 files changed

+114
-97
lines changed

4 files changed

+114
-97
lines changed

include/mp/flat/constr_keeper.h

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -734,12 +734,13 @@ public: \
734734
/// without a subexpression map.
735735
/// Provide empty MapFind (returns -1) / MapInsert
736736
#define STORE_CONSTRAINT_TYPE__NO_MAP( \
737-
Constraint, optionNames) \
737+
Constraint, optionNames, prior) \
738738
STORE_CONSTRAINT_TYPE__INTERNAL( \
739739
Constraint, optionNames) \
740740
int MapFind__Impl(const Constraint& ) { return -1; } \
741741
bool MapInsert__Impl(const Constraint&, int ) \
742-
{ return true; }
742+
{ return true; } \
743+
DEFINE_CONSTRAINT_PRIORITY(Constraint, prior)
743744

744745

745746
/// Define a constraint keeper
@@ -748,10 +749,11 @@ public: \
748749
/// should define MapFind / MapInsert accessing
749750
/// the GET_(CONST_)CONSTRAINT_MAP(Constraint)
750751
#define STORE_CONSTRAINT_TYPE__WITH_MAP( \
751-
Constraint, optionNames) \
752+
Constraint, optionNames, prior) \
752753
STORE_CONSTRAINT_TYPE__INTERNAL( \
753754
Constraint, optionNames) \
754-
STORE_CONSTRAINT_MAP(Constraint)
755+
STORE_CONSTRAINT_MAP(Constraint) \
756+
DEFINE_CONSTRAINT_PRIORITY(Constraint, prior)
755757

756758
/// Internal use. Name of the constraint container
757759
#define CONSTRAINT_KEEPER_VAR(Constraint) \
@@ -773,6 +775,11 @@ public: \
773775
#define CONSTRAINT_MAP_VAR(Constraint) \
774776
map__ ## Constraint ## _
775777

778+
/// Define constraint priority
779+
#define DEFINE_CONSTRAINT_PRIORITY(Constraint, prior) \
780+
static constexpr double ConstraintCvtPriority( \
781+
const Constraint*) { return prior; }
782+
776783

777784
/////////////////////////////////////////////////////////////////////////////
778785
/// Subexpression map

include/mp/flat/converter.h

Lines changed: 87 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,9 @@ class FlatConverter :
188188
using ConInfo = AbstractConstraintLocation;
189189

190190
/// Replace functional expression defining a given variable.
191+
/// After this, if the arguments are any new expressions,
192+
/// the original context should be propagated into \a res_var:
193+
/// PropagateResultOfInitExpr(res_var, ctx);
191194
template <class FuncConstraint>
192195
void RedefineVariable(int res_var, FuncConstraint&& fc) {
193196
assert( MPD( HasInitExpression(res_var) ) );
@@ -1634,115 +1637,118 @@ class FlatConverter :
16341637
/// 2nd parameter: solver options for this constraint,
16351638
/// in case it is accepted by the solver natively and
16361639
/// is convertible by us.
1640+
/// 3rd parameter: reformulation priority (double).
1641+
/// Can be changed in a derived class by ConstraintCvtPriority().
1642+
/// NOTE: The reformulation meta-graph should be acyclic #248.
16371643

16381644
/// Static algebraic cons
16391645
STORE_CONSTRAINT_TYPE__NO_MAP(LinConRange,
1640-
"acc:linrange acc:linrng")
1641-
STORE_CONSTRAINT_TYPE__NO_MAP(LinConLE, "acc:linle")
1642-
STORE_CONSTRAINT_TYPE__NO_MAP(LinConEQ, "acc:lineq")
1643-
STORE_CONSTRAINT_TYPE__NO_MAP(LinConGE, "acc:linge")
1646+
"acc:linrange acc:linrng", 5000)
1647+
STORE_CONSTRAINT_TYPE__NO_MAP(LinConLE, "acc:linle", 5100)
1648+
STORE_CONSTRAINT_TYPE__NO_MAP(LinConEQ, "acc:lineq", 5200)
1649+
STORE_CONSTRAINT_TYPE__NO_MAP(LinConGE, "acc:linge", 5300)
16441650

16451651
STORE_CONSTRAINT_TYPE__NO_MAP(QuadConRange,
1646-
"acc:quadrange acc:quadrng")
1647-
STORE_CONSTRAINT_TYPE__NO_MAP(QuadConLE, "acc:quadle")
1648-
STORE_CONSTRAINT_TYPE__NO_MAP(QuadConEQ, "acc:quadeq")
1649-
STORE_CONSTRAINT_TYPE__NO_MAP(QuadConGE, "acc:quadge")
1652+
"acc:quadrange acc:quadrng", 4000)
1653+
STORE_CONSTRAINT_TYPE__NO_MAP(QuadConLE, "acc:quadle", 4100)
1654+
STORE_CONSTRAINT_TYPE__NO_MAP(QuadConEQ, "acc:quadeq", 4200)
1655+
STORE_CONSTRAINT_TYPE__NO_MAP(QuadConGE, "acc:quadge", 4300)
16501656

16511657
/// Our own functional constraints: LFC, QFC
16521658
STORE_CONSTRAINT_TYPE__WITH_MAP(
1653-
LinearFunctionalConstraint, "acc:linfunccon")
1659+
LinearFunctionalConstraint, "acc:linfunccon", 3200)
16541660
STORE_CONSTRAINT_TYPE__WITH_MAP(
1655-
QuadraticFunctionalConstraint, "acc:quadfunccon")
1661+
QuadraticFunctionalConstraint, "acc:quadfunccon", 3100)
16561662

16571663
/// Flattened NL expressions
1658-
STORE_CONSTRAINT_TYPE__WITH_MAP(MaxConstraint, "acc:max")
1659-
STORE_CONSTRAINT_TYPE__WITH_MAP(MinConstraint, "acc:min")
1660-
STORE_CONSTRAINT_TYPE__WITH_MAP(AbsConstraint, "acc:abs")
1664+
STORE_CONSTRAINT_TYPE__WITH_MAP(MaxConstraint, "acc:max", 1100)
1665+
STORE_CONSTRAINT_TYPE__WITH_MAP(MinConstraint, "acc:min", 1200)
1666+
STORE_CONSTRAINT_TYPE__WITH_MAP(AbsConstraint, "acc:abs", 100)
16611667
STORE_CONSTRAINT_TYPE__WITH_MAP(AndConstraint,
1662-
"acc:and acc:forall")
1668+
"acc:and acc:forall", 2200)
16631669
STORE_CONSTRAINT_TYPE__WITH_MAP(OrConstraint,
1664-
"acc:or acc:exists")
1670+
"acc:or acc:exists", 2300)
16651671
/// Used only for expression output,
16661672
/// flat model keeps this in algebraic form
16671673
STORE_CONSTRAINT_TYPE__WITH_MAP(
1668-
EquivalenceConstraint, "acc:equiv acc:equivalence")
1669-
1670-
STORE_CONSTRAINT_TYPE__WITH_MAP(CondLinConEQ, "acc:condlineq")
1671-
STORE_CONSTRAINT_TYPE__WITH_MAP(CondLinConLE, "acc:condlinle")
1672-
STORE_CONSTRAINT_TYPE__WITH_MAP(CondLinConLT, "acc:condlinlt")
1673-
STORE_CONSTRAINT_TYPE__WITH_MAP(CondLinConGE, "acc:condlinge")
1674-
STORE_CONSTRAINT_TYPE__WITH_MAP(CondLinConGT, "acc:condlingt")
1675-
1676-
STORE_CONSTRAINT_TYPE__WITH_MAP(CondQuadConEQ, "acc:condquadeq")
1677-
STORE_CONSTRAINT_TYPE__WITH_MAP(CondQuadConLE, "acc:condquadle")
1678-
STORE_CONSTRAINT_TYPE__WITH_MAP(CondQuadConLT, "acc:condquadlt")
1679-
STORE_CONSTRAINT_TYPE__WITH_MAP(CondQuadConGE, "acc:condquadge")
1680-
STORE_CONSTRAINT_TYPE__WITH_MAP(CondQuadConGT, "acc:condquadgt")
1681-
1682-
STORE_CONSTRAINT_TYPE__WITH_MAP(NotConstraint, "acc:not")
1683-
STORE_CONSTRAINT_TYPE__WITH_MAP(DivConstraint, "acc:div")
1684-
STORE_CONSTRAINT_TYPE__WITH_MAP(IfThenConstraint, "acc:ifthen")
1685-
STORE_CONSTRAINT_TYPE__WITH_MAP(ImplicationConstraint, "acc:impl")
1686-
STORE_CONSTRAINT_TYPE__WITH_MAP(AllDiffConstraint, "acc:alldiff")
1674+
EquivalenceConstraint, "acc:equiv acc:equivalence", 2150)
1675+
1676+
STORE_CONSTRAINT_TYPE__WITH_MAP(CondLinConEQ, "acc:condlineq", 1950)
1677+
STORE_CONSTRAINT_TYPE__WITH_MAP(CondLinConLE, "acc:condlinle", 2050)
1678+
STORE_CONSTRAINT_TYPE__WITH_MAP(CondLinConLT, "acc:condlinlt", 2060)
1679+
STORE_CONSTRAINT_TYPE__WITH_MAP(CondLinConGE, "acc:condlinge", 2070)
1680+
STORE_CONSTRAINT_TYPE__WITH_MAP(CondLinConGT, "acc:condlingt", 2080)
1681+
1682+
STORE_CONSTRAINT_TYPE__WITH_MAP(CondQuadConEQ, "acc:condquadeq", 1900)
1683+
STORE_CONSTRAINT_TYPE__WITH_MAP(CondQuadConLE, "acc:condquadle", 2000)
1684+
STORE_CONSTRAINT_TYPE__WITH_MAP(CondQuadConLT, "acc:condquadlt", 2010)
1685+
STORE_CONSTRAINT_TYPE__WITH_MAP(CondQuadConGE, "acc:condquadge", 2020)
1686+
STORE_CONSTRAINT_TYPE__WITH_MAP(CondQuadConGT, "acc:condquadgt", 2030)
1687+
1688+
STORE_CONSTRAINT_TYPE__WITH_MAP(NotConstraint, "acc:not", 2100)
1689+
STORE_CONSTRAINT_TYPE__WITH_MAP(DivConstraint, "acc:div", 600)
1690+
STORE_CONSTRAINT_TYPE__WITH_MAP(IfThenConstraint, "acc:ifthen", 700)
1691+
STORE_CONSTRAINT_TYPE__WITH_MAP(ImplicationConstraint, "acc:impl", 800)
1692+
STORE_CONSTRAINT_TYPE__WITH_MAP(AllDiffConstraint, "acc:alldiff", 200)
16871693
STORE_CONSTRAINT_TYPE__WITH_MAP(NumberofConstConstraint,
1688-
"acc:numberofconst")
1694+
"acc:numberofconst", 1300)
16891695
STORE_CONSTRAINT_TYPE__WITH_MAP(NumberofVarConstraint,
1690-
"acc:numberofvar")
1691-
STORE_CONSTRAINT_TYPE__WITH_MAP(CountConstraint, "acc:count")
1692-
1693-
STORE_CONSTRAINT_TYPE__WITH_MAP(ExpConstraint, "acc:exp")
1694-
STORE_CONSTRAINT_TYPE__WITH_MAP(ExpAConstraint, "acc:expa acc:expA")
1695-
STORE_CONSTRAINT_TYPE__WITH_MAP(LogConstraint, "acc:log")
1696-
STORE_CONSTRAINT_TYPE__WITH_MAP(LogAConstraint, "acc:loga acc:logA")
1697-
STORE_CONSTRAINT_TYPE__WITH_MAP(PowConstExpConstraint, "acc:powconstexp")
1698-
STORE_CONSTRAINT_TYPE__WITH_MAP(PowConstraint, "acc:pow")
1699-
STORE_CONSTRAINT_TYPE__WITH_MAP(SinConstraint, "acc:sin")
1700-
STORE_CONSTRAINT_TYPE__WITH_MAP(CosConstraint, "acc:cos")
1701-
STORE_CONSTRAINT_TYPE__WITH_MAP(TanConstraint, "acc:tan")
1702-
STORE_CONSTRAINT_TYPE__WITH_MAP(AsinConstraint, "acc:asin")
1703-
STORE_CONSTRAINT_TYPE__WITH_MAP(AcosConstraint, "acc:acos")
1704-
STORE_CONSTRAINT_TYPE__WITH_MAP(AtanConstraint, "acc:atan")
1705-
STORE_CONSTRAINT_TYPE__WITH_MAP(SinhConstraint, "acc:sinh")
1706-
STORE_CONSTRAINT_TYPE__WITH_MAP(CoshConstraint, "acc:cosh")
1707-
STORE_CONSTRAINT_TYPE__WITH_MAP(TanhConstraint, "acc:tanh")
1708-
STORE_CONSTRAINT_TYPE__WITH_MAP(AsinhConstraint, "acc:asinh")
1709-
STORE_CONSTRAINT_TYPE__WITH_MAP(AcoshConstraint, "acc:acosh")
1710-
STORE_CONSTRAINT_TYPE__WITH_MAP(AtanhConstraint, "acc:atanh")
1696+
"acc:numberofvar", 1350)
1697+
STORE_CONSTRAINT_TYPE__WITH_MAP(CountConstraint, "acc:count", 400)
1698+
1699+
STORE_CONSTRAINT_TYPE__WITH_MAP(ExpConstraint, "acc:exp", 1000)
1700+
STORE_CONSTRAINT_TYPE__WITH_MAP(ExpAConstraint, "acc:expa acc:expA", 1002)
1701+
STORE_CONSTRAINT_TYPE__WITH_MAP(LogConstraint, "acc:log", 1004)
1702+
STORE_CONSTRAINT_TYPE__WITH_MAP(LogAConstraint, "acc:loga acc:logA", 1006)
1703+
STORE_CONSTRAINT_TYPE__WITH_MAP(PowConstExpConstraint, "acc:powconstexp", 900)
1704+
STORE_CONSTRAINT_TYPE__WITH_MAP(PowConstraint, "acc:pow", 950) // -> exp, log
1705+
STORE_CONSTRAINT_TYPE__WITH_MAP(SinConstraint, "acc:sin", 1008)
1706+
STORE_CONSTRAINT_TYPE__WITH_MAP(CosConstraint, "acc:cos", 1010)
1707+
STORE_CONSTRAINT_TYPE__WITH_MAP(TanConstraint, "acc:tan", 1012)
1708+
STORE_CONSTRAINT_TYPE__WITH_MAP(AsinConstraint, "acc:asin", 1014)
1709+
STORE_CONSTRAINT_TYPE__WITH_MAP(AcosConstraint, "acc:acos", 1016)
1710+
STORE_CONSTRAINT_TYPE__WITH_MAP(AtanConstraint, "acc:atan", 1018)
1711+
STORE_CONSTRAINT_TYPE__WITH_MAP(SinhConstraint, "acc:sinh", 1020)
1712+
STORE_CONSTRAINT_TYPE__WITH_MAP(CoshConstraint, "acc:cosh", 1022)
1713+
STORE_CONSTRAINT_TYPE__WITH_MAP(TanhConstraint, "acc:tanh", 1024)
1714+
STORE_CONSTRAINT_TYPE__WITH_MAP(AsinhConstraint, "acc:asinh", 1026)
1715+
STORE_CONSTRAINT_TYPE__WITH_MAP(AcoshConstraint, "acc:acosh", 1028)
1716+
STORE_CONSTRAINT_TYPE__WITH_MAP(AtanhConstraint, "acc:atanh", 1030)
17111717

17121718
/// No maps for static constraints
17131719
STORE_CONSTRAINT_TYPE__NO_MAP(
1714-
IndicatorConstraintLinLE, "acc:indle acc:indlinle")
1720+
IndicatorConstraintLinLE, "acc:indle acc:indlinle", 2460)
17151721
STORE_CONSTRAINT_TYPE__NO_MAP(
1716-
IndicatorConstraintLinEQ, "acc:indeq acc:indlineq")
1722+
IndicatorConstraintLinEQ, "acc:indeq acc:indlineq", 2450)
17171723
STORE_CONSTRAINT_TYPE__NO_MAP(
1718-
IndicatorConstraintLinGE, "acc:indge acc:indlinge")
1724+
IndicatorConstraintLinGE, "acc:indge acc:indlinge", 2470)
17191725
STORE_CONSTRAINT_TYPE__NO_MAP(
1720-
IndicatorConstraintQuadLE, "acc:indquadle")
1726+
IndicatorConstraintQuadLE, "acc:indquadle", 2410)
17211727
STORE_CONSTRAINT_TYPE__NO_MAP(
1722-
IndicatorConstraintQuadEQ, "acc:indquadeq")
1728+
IndicatorConstraintQuadEQ, "acc:indquadeq", 2400)
17231729
STORE_CONSTRAINT_TYPE__NO_MAP(
1724-
IndicatorConstraintQuadGE, "acc:indquadge")
1730+
IndicatorConstraintQuadGE, "acc:indquadge", 2420)
17251731
STORE_CONSTRAINT_TYPE__WITH_MAP(PLConstraint,
1726-
"acc:pl acc:pwl acc:piecewise")
1727-
STORE_CONSTRAINT_TYPE__NO_MAP(SOS1Constraint, "acc:sos1")
1728-
STORE_CONSTRAINT_TYPE__NO_MAP(SOS2Constraint, "acc:sos2")
1732+
"acc:pl acc:pwl acc:piecewise", 1500)
1733+
STORE_CONSTRAINT_TYPE__NO_MAP(SOS1Constraint, "acc:sos1", 1600)
1734+
STORE_CONSTRAINT_TYPE__NO_MAP(SOS2Constraint, "acc:sos2", 1700)
17291735
STORE_CONSTRAINT_TYPE__NO_MAP(
1730-
ComplementarityLinear, "acc:compl acc:compllin")
1736+
ComplementarityLinear, "acc:compl acc:compllin", 350)
17311737
STORE_CONSTRAINT_TYPE__NO_MAP(
1732-
ComplementarityQuadratic, "acc:complquad")
1738+
ComplementarityQuadratic, "acc:complquad", 300)
17331739
STORE_CONSTRAINT_TYPE__NO_MAP(
1734-
QuadraticConeConstraint, "acc:quadcone")
1740+
QuadraticConeConstraint, "acc:quadcone", 3002)
17351741
STORE_CONSTRAINT_TYPE__NO_MAP(
1736-
RotatedQuadraticConeConstraint, "acc:rotatedquadcone")
1742+
RotatedQuadraticConeConstraint, "acc:rotatedquadcone", 3001)
17371743
STORE_CONSTRAINT_TYPE__NO_MAP(
1738-
PowerConeConstraint, "acc:powercone")
1744+
PowerConeConstraint, "acc:powercone", 3000)
17391745
STORE_CONSTRAINT_TYPE__NO_MAP(
1740-
ExponentialConeConstraint, "acc:expcone")
1746+
ExponentialConeConstraint, "acc:expcone", 3010)
17411747
STORE_CONSTRAINT_TYPE__NO_MAP(
1742-
GeometricConeConstraint, "acc:geomcone")
1748+
GeometricConeConstraint, "acc:geomcone", 3020)
17431749
/// Store UEncConstr
17441750
STORE_CONSTRAINT_TYPE__NO_MAP(
1745-
UnaryEncodingConstraint, "acc:uenc")
1751+
UnaryEncodingConstraint, "acc:uenc", 1800)
17461752
/// Dummy conversion for UEncConstr
17471753
Context Convert(const UnaryEncodingConstraint& )
17481754
{ return Context::CTX_ROOT; }
@@ -1753,22 +1759,22 @@ class FlatConverter :
17531759

17541760
////////////////////// NL constraints & expressions ///////////////////////
17551761
STORE_CONSTRAINT_TYPE__NO_MAP(
1756-
NLConstraint, "acc:nlcon acc:nlalgcon")
1762+
NLConstraint, "acc:nlcon acc:nlalgcon", 10000)
17571763
STORE_CONSTRAINT_TYPE__NO_MAP(
1758-
NLAssignEQ, "acc:nlassigneq")
1764+
NLAssignEQ, "acc:nlassigneq", 10100)
17591765
STORE_CONSTRAINT_TYPE__NO_MAP(
1760-
NLAssignLE, "acc:nlassignle")
1766+
NLAssignLE, "acc:nlassignle", 10200)
17611767
STORE_CONSTRAINT_TYPE__NO_MAP(
1762-
NLAssignGE, "acc:nlassignge")
1768+
NLAssignGE, "acc:nlassignge", 10300)
17631769

17641770
STORE_CONSTRAINT_TYPE__NO_MAP(
1765-
NLLogical, "acc:nllogcon acc:nllogical")
1771+
NLLogical, "acc:nllogcon acc:nllogical", 12000)
17661772
STORE_CONSTRAINT_TYPE__NO_MAP(
1767-
NLReifEquiv, "acc:nlreifequiv")
1773+
NLReifEquiv, "acc:nlreifequiv", 12100)
17681774
STORE_CONSTRAINT_TYPE__NO_MAP(
1769-
NLReifImpl, "acc:nlreifimpl")
1775+
NLReifImpl, "acc:nlreifimpl", 12200)
17701776
STORE_CONSTRAINT_TYPE__NO_MAP(
1771-
NLReifRimpl, "acc:nlreifrimpl")
1777+
NLReifRimpl, "acc:nlreifrimpl", 12300)
17721778

17731779

17741780
protected:

include/mp/flat/item_keeper.h

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#ifndef ITEM_KEEPER_H
22
#define ITEM_KEEPER_H
33

4+
#include <memory>
5+
#include <map>
46
#include <cmath>
57

68
#include "mp/flat/preprocess.h"
@@ -320,16 +322,16 @@ class BasicFlatConverter {
320322
/// when they overload Convert() etc, due to C++ name hiding
321323
#define USE_BASE_CONSTRAINT_CONVERTERS(BaseConverter) \
322324
using BaseConverter::PreprocessConstraint; \
323-
using BaseConverter::PropagateResult; \
324-
using BaseConverter::IfHasCvt_impl; \
325+
using BaseConverter::PropagateResult; \
326+
using BaseConverter::IfHasCvt_impl; \
325327
using BaseConverter::IfNeedsCvt_impl; \
326328
using BaseConverter::IfDelayCvt_impl; \
327-
using BaseConverter::Convert
329+
using BaseConverter::Convert
328330

329331

330-
/// For Common Subexpression Elimination, we can use maps
331-
/// This stub returns empty Id
332-
int MapFind(const BasicConstraint& ) { return -1; }
332+
/// For Common Subexpression Elimination, we can use maps
333+
/// This stub returns empty Id
334+
int MapFind(const BasicConstraint& ) { return -1; }
333335

334336
/// Returns false when we do have a map and entry duplicated
335337
/// (should not happen).
@@ -341,9 +343,9 @@ class BasicFlatConverter {
341343
/// need to 'using' base class' map accessors in the Converter
342344
#define USE_BASE_MAP_FINDERS(BaseConverter) \
343345
using BaseConverter::MapFind; \
344-
using BaseConverter::MapInsert; \
345-
template <class Constraint> \
346-
using ConstraintLocation = \
346+
using BaseConverter::MapInsert; \
347+
template <class Constraint> \
348+
using ConstraintLocation = \
347349
ConstraintLocationHelper< \
348350
ConstraintKeeper< Impl, ModelAPI, Constraint > >;
349351

@@ -368,7 +370,8 @@ class ConstraintManager {
368370
public:
369371
/// Add a new CKeeper with given conversion priority (smaller = sooner)
370372
void AddConstraintKeeper(BasicConstraintKeeper& ck, double priority) {
371-
con_keepers_.insert( { priority, ck } );
373+
auto insres = con_keepers_.insert( { priority, ck } );
374+
MP_ASSERT_ALWAYS(insres.second, "Duplicated constraint priority");
372375
ck.SetLogger(&*graph_exporter_app_);
373376
}
374377

@@ -453,7 +456,7 @@ class ConstraintManager {
453456
{ return *graph_exporter_app_; }
454457

455458
private:
456-
std::multimap<double, BasicConstraintKeeper&> con_keepers_;
459+
std::map<double, BasicConstraintKeeper&> con_keepers_;
457460
/// Conversion graph exporter file appender
458461
std::unique_ptr<BasicFileAppender>
459462
graph_exporter_app_{MakeFileAppender()};

include/mp/flat/redef/MIP/power.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ class PowConstExponentConverter_MIP
7676
QuadAndLinTerms( { }, { {1.0}, {arg1}, {arg2} } ),
7777
0.0) ));
7878
/// propagate ctx into new constr,
79-
/// particularly into the arguments which are new constraints
79+
/// particularly into the arguments
80+
/// which are new expressions when pwr>2
8081
GetMC().PropagateResultOfInitExpr(
8182
con.GetResultVar(), con.GetContext());
8283
}

0 commit comments

Comments
 (0)