gravatar
alpar (Alpar Juttner)
alpar@cs.elte.hu
Merge bugfix #430 to branch 1.2
0 2 0
merge 1.2
1 file changed with 12 insertions and 4 deletions:
↑ Collapse diff ↑
Ignore white space 24 line context
... ...
@@ -1609,72 +1609,72 @@
1609 1609
  inline LpBase::Expr operator/(const LpBase::Expr &a, const LpBase::Value &b) {
1610 1610
    LpBase::Expr tmp(a);
1611 1611
    tmp/=b;
1612 1612
    return tmp;
1613 1613
  }
1614 1614

	
1615 1615
  ///Create constraint
1616 1616

	
1617 1617
  ///\relates LpBase::Constr
1618 1618
  ///
1619 1619
  inline LpBase::Constr operator<=(const LpBase::Expr &e,
1620 1620
                                   const LpBase::Expr &f) {
1621
    return LpBase::Constr(0, f - e, LpBase::INF);
1621
    return LpBase::Constr(0, f - e, LpBase::NaN);
1622 1622
  }
1623 1623

	
1624 1624
  ///Create constraint
1625 1625

	
1626 1626
  ///\relates LpBase::Constr
1627 1627
  ///
1628 1628
  inline LpBase::Constr operator<=(const LpBase::Value &e,
1629 1629
                                   const LpBase::Expr &f) {
1630 1630
    return LpBase::Constr(e, f, LpBase::NaN);
1631 1631
  }
1632 1632

	
1633 1633
  ///Create constraint
1634 1634

	
1635 1635
  ///\relates LpBase::Constr
1636 1636
  ///
1637 1637
  inline LpBase::Constr operator<=(const LpBase::Expr &e,
1638 1638
                                   const LpBase::Value &f) {
1639
    return LpBase::Constr(- LpBase::INF, e, f);
1639
    return LpBase::Constr(LpBase::NaN, e, f);
1640 1640
  }
1641 1641

	
1642 1642
  ///Create constraint
1643 1643

	
1644 1644
  ///\relates LpBase::Constr
1645 1645
  ///
1646 1646
  inline LpBase::Constr operator>=(const LpBase::Expr &e,
1647 1647
                                   const LpBase::Expr &f) {
1648
    return LpBase::Constr(0, e - f, LpBase::INF);
1648
    return LpBase::Constr(0, e - f, LpBase::NaN);
1649 1649
  }
1650 1650

	
1651 1651

	
1652 1652
  ///Create constraint
1653 1653

	
1654 1654
  ///\relates LpBase::Constr
1655 1655
  ///
1656 1656
  inline LpBase::Constr operator>=(const LpBase::Value &e,
1657 1657
                                   const LpBase::Expr &f) {
1658 1658
    return LpBase::Constr(LpBase::NaN, f, e);
1659 1659
  }
1660 1660

	
1661 1661

	
1662 1662
  ///Create constraint
1663 1663

	
1664 1664
  ///\relates LpBase::Constr
1665 1665
  ///
1666 1666
  inline LpBase::Constr operator>=(const LpBase::Expr &e,
1667 1667
                                   const LpBase::Value &f) {
1668
    return LpBase::Constr(f, e, LpBase::INF);
1668
    return LpBase::Constr(f, e, LpBase::NaN);
1669 1669
  }
1670 1670

	
1671 1671
  ///Create constraint
1672 1672

	
1673 1673
  ///\relates LpBase::Constr
1674 1674
  ///
1675 1675
  inline LpBase::Constr operator==(const LpBase::Expr &e,
1676 1676
                                   const LpBase::Value &f) {
1677 1677
    return LpBase::Constr(f, e, f);
1678 1678
  }
1679 1679

	
1680 1680
  ///Create constraint
Ignore white space 6 line context
... ...
@@ -157,24 +157,32 @@
157 157
    //c = (p1 == p2 );
158 158
    c = (p1 == 2.2);
159 159
    c = (p1 == 2  );
160 160
    c = (2.2== p2 );
161 161
    c = (2  == p2 );
162 162

	
163 163
    c = ((2 <= e) <= 3);
164 164
    c = ((2 <= p1) <= 3);
165 165

	
166 166
    c = ((2 >= e) >= 3);
167 167
    c = ((2 >= p1) >= 3);
168 168

	
169
    { //Tests for #430
170
      LP::Col v=lp.addCol();
171
      LP::Constr c = v >= -3;
172
      c = c <= 4;
173
      LP::Constr c2;
174
      c2 = -3 <= v <= 4;
175
    }
176

	
169 177
    e[x[3]]=2;
170 178
    e[x[3]]=4;
171 179
    e[x[3]]=1;
172 180
    *e=12;
173 181

	
174 182
    lp.addRow(-LP::INF,e,23);
175 183
    lp.addRow(-LP::INF,3.0*(x[1]+x[2]/2)-x[3],23);
176 184
    lp.addRow(-LP::INF,3.0*(x[1]+x[2]*2-5*x[3]+12-x[4]/3)+2*x[4]-4,23);
177 185

	
178 186
    lp.addRow(x[1]+x[3]<=x[5]-3);
179 187
    lp.addRow((-7<=x[1]+x[3]-12)<=3);
180 188
    lp.addRow(x[1]<=x[5]);
0 comments (0 inline)