COIN-OR::LEMON - Graph Library

Opened 16 years ago

Last modified 15 years ago

#203 closed enhancement

faster addRow operation for LP — at Version 1

Reported by: Tapolcai János Owned by: Alpar Juttner
Priority: major Milestone: LEMON 1.2 release
Component: core Version: hg main
Keywords: LP interface Cc:
Revision id:

Description (last modified by Alpar Juttner)

A new function is requested in lp_base.h:

virtual int _addRow(ConstRowIterator, ConstRowIterator, Value, Value) =0;

int this case the following two function can be replaced in lp_base.h

1.

    Row addRow(Value l,const Expr &e, Value u) {
      Row r=addRow();
      row(r,l,e,u);
      return r;
    }

by

    Row addRow(Value l,const Expr &e, Value u) {
	  Row r; 
      e.simplify();
      r.id = _addRow(ConstRowIterator(e.begin(), *this),
                    ConstRowIterator(e.end(), *this),l-e.constComp(),u-e.constComp() );
      return r;
    }

2.

    Row addRow(const Constr &c) {
      Row r=addRow();
      row(r,c);
      return r;
    }

by

    Row addRow(const Constr &c) {
      Row r=addRow(c.lowerBounded()?c.lowerBound():-INF,
          c.expr(), c.upperBounded()?c.upperBound():INF);
      return r;
    }

For each solver a new int _addRow(ConstRowIterator, ConstRowIterator, Value, Value) function must be implemented (see also the attached files).

Change History (2)

Changed 16 years ago by Tapolcai János

Attachment: lemon_lp_mip.zip added

comment:1 Changed 16 years ago by Alpar Juttner

Description: modified (diff)
Note: See TracTickets for help on using tickets.