[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-glpk] Patch for writing pseudo-boolean problems
From: |
Andrew Makhorin |
Subject: |
Re: [Help-glpk] Patch for writing pseudo-boolean problems |
Date: |
Wed, 27 Jun 2007 22:44:56 +0400 |
> please find enclosed a diff with an additional API-command
> lpx_write_pb that writes an instance in (possibly normalized)
> Pseudo-Boolean format. It is also incorporated in glpsol.
Please post me the source code. I cannot find it.
> The main problem so far is that the different PB solvers have qutie
> different requirements on the input. However, the normalized one
> follows the PB competition guidelines. There should probably be some
> checking that the variables are binary, but I skipped that as there
> might be cases where it may be useful.
> I would also like to add two requests:
> * An API-call to set the amount of available memory.
I added the API routine glp_mem_limit, which will appear in 4.19.
Below here is its source code, so you can add it right now (to the end
of file glpapi10.c).
/***********************************************************************
* NAME
*
* glp_mem_limit - set memory usage limit
*
* SYNOPSIS
*
* void glp_mem_limit(int limit);
*
* DESCRIPTION
*
* The routine lib_mem_limit limits the amount of memory available for
* dynamic allocation (in GLPK routines) to limit megabytes. */
void glp_mem_limit(int limit)
{ if (limit < 0)
xfault("glp_mem_limit: limit = %d; invalid parameter\n",
limit);
lib_mem_limit(ulmul(ulset(0, 1 << 20), ulset(0, limit)));
return;
}
> * An API-call to set a hook that is called with a tree pointer (or
> just the objective value) when a new MIP solution is found.
I would not like to add such a hook to lpx_integer, because it will
be replaced by glp_integer. However, you can insert a necessary call
into the routine record_solution (see file glpmip02.c).
Andrew Makhorin