COIN-OR::LEMON - Graph Library

Custom Query (545 matches)

Filters
 
Or
 
  
 
Columns

Show under each result:


Results (61 - 63 of 545)

Ticket Owner Reporter Resolution Summary
#326 Peter Kovacs Peter Kovacs fixed MipSolver interface fixes and extension
Description

In MipSolver there are type(), sol() and solValue() functions to obtain the (primal) solution.

  1. There are two inconsistent names here:
    • solValue() should be renamed to sol() (as on overloaded version) as primalValue() was renamed to primal() in LpSolver.
    • ColTypes should be renamed to ColType, since we do not use plural in similar names.
  1. Apart form that, I suggest an extension. Let's introduce primalType() and primal() as an alias for the above functions. Adding these variants, one can change to using a Mip solver instead of an Lp solver without rewriting the code (if only primal queries were used).
  1. Maybe type(), sol() could also be added to LpSolver as an alias for the primal queries.
#334 Balazs Dezso Akos Ladanyi fixed MIP solver gives wrong solution
Description

The program below gives x=1, y=0 as solution with LEMON 1.1.1, but with [9cc6e98c487d] the solution is x=1, y=1 (both with Glpk and Cbc).

#include <iostream>

#include <lemon/glpk.h>
#include <lemon/cbc.h>

int main()
{
    typedef lemon::GlpkMip MIP;
    //typedef lemon::CbcMip MIP;

    MIP mip;

    MIP::Col x, y;
    x = mip.addCol();
    y = mip.addCol();

    MIP::Expr e(x - 1.0);
    mip.addRow(e <= y);

    mip.colLowerBound(y, 0.0);

    mip.colType(x, MIP::INTEGER);
    mip.colBounds(x, 1.0, 2.0);

    mip.obj(y);
    mip.min();

    if (mip.solve() != MIP::SOLVED ||
        mip.type() != MIP::OPTIMAL)
    {
        std::cout << "could not solve it" << std::endl;
        return 0;
    }

    std::cout << "x=" << mip.sol(x) << std::endl;
    std::cout << "y=" << mip.sol(y) << std::endl;

    return 0;
}
#337 Balazs Dezso Alpar Juttner fixed LEMON doen't compile with glpk-4.42
Description

The title says everything.

Here is the related part of the build output.

	g++ -DHAVE_CONFIG_H   -I. -I.  -Wall -W -Wall -W -Wunused -Wformat=2 -Wctor-dtor-privacy -Wnon-virtual-dtor -Wno-char-subscripts -Wwrite-strings -Wno-char-subscripts -Wreturn-type -Wcast-qual -Wcast-align -Wsign-promo -Woverloaded-virtual -ansi -fno-strict-aliasing -Wold-style-cast -Wno-unknown-pragmas -ggdb -Werror -MT tools/dimacs-solver.o -MD -MP -MF $depbase.Tpo -c -o tools/dimacs-solver.o tools/dimacs-solver.cc &&\
	mv -f $depbase.Tpo $depbase.Po
In file included from lemon/glpk.cc:23:
/home/alpar/projects/LEMON/local/include/glpk.h:40: error: conflicting declaration ‘typedef struct glp_prob glp_prob’
./lemon/glpk.h:32: error: ‘glp_prob’ has a previous declaration as ‘typedef struct glp_prob glp_prob’
make[2]: *** [lemon/lemon_libemon_la-glpk.lo] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory `/home/alpar/projects/LEMON/hg/main'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/alpar/projects/LEMON/hg/main'
make: *** [all] Error 2
Note: See TracQuery for help on using queries.