[CoinUtils] Where can I find comprehensive CoinMP Documentation

Mark Liu markisusmarkmark at yahoo.com
Mon Apr 9 21:44:32 EDT 2012


Thank you so much!
Exactly the information I need to start using the library.
I will direct all further questions to the CoinMP mailing list.


________________________________
 From: Matthew Saltzman <mjs at clemson.edu>
To: coinutils at list.coin-or.org 
Sent: Sunday, April 8, 2012 10:07 PM
Subject: Re: [CoinUtils] Where can I find comprehensive CoinMP Documentation
 
On Sat, 2012-04-07 at 11:37 -0700, Mark Liu wrote:
> I have just installed the CoinMP library (CoinMP.dll) found
> at https://projects.coin-or.org/CoinMP
> 
> I don't think the example.c file nor the CoinMP.h file provided with
> the package are sufficient to figure out how to use the library.
> However, I cannot seem to find a document that explains all the
> functions exported by CoinMP.dll.

It is a common problem with open-source tools that the developers like
coding better than documenting, so documenting often gets short shrift.

Your best bet for CoinMP questions is probably the CoinMP mailing list
at http://list.coin-or.org/mailman/listinfo/CoinMP.  Author Bjarni has
been head down for a while, but is apparently back now, so you should be
able to get a response from him.

But keep reading.

> 
> Specifically, I cannot figure out how to use the following function
> exported by CoinMP.dll:
> SOLVAPI int    SOLVCALL CoinLoadProblem(HPROB hProb,  
> int ColCount, int RowCount, int NZCount, int RangeCount, 
> int ObjectSense, double ObjectConst, double* ObjectCoeffs, 
> double* LowerBounds, double* UpperBounds, const char* RowType, 
> double* RHSValues, double* RangeValues, int* MatrixBegin,  
> int* MatrixCount, int* MatrixIndex, double* MatrixValues,  
> char** ColNamesList, char** RowNamesList, const char* ObjectName);
> 
> What is the meaning of RangeCount and MatrixBegin? I have inferred
> from the example code that matrixCount stores the number of variables
> in each column of the constraint matrix and that matrixIndex stores
> the position of those variables within the columns, but which document
> actually explains that?

This is one variation of one of two standard ways of storing the nonzero
entries of a sparse matrix representation of a set of linear
constraints.  (Probably not documented here just because it's pretty
well known, so the author assumes there's no need.)  

If you have a constraint with both upper and lower bounds (b_l \leq a^T
x \leq b_u), then you can convert it to an equality constraint with a
bounded slack (a^T x + s = b_u, 0 \leq s \leq b_u - b_l).  These are
often called "range constraints", and I suspect that RangeCount just
tells how many of these there are--i.e., the number of entries in the
array RangeValues.

The sparse representation of the constraint matrix coefficients consists
of two arrays, one with the row indices of nonzeros and another with
their values, grouped by column.  A third array tells where in these two
arrays the block of entries associated with each column starts.  Often
another array gives the count of nonzeros in each column, so that
padding can be included in the row blocks.  So walking a column is
accomplished by a loop like:

        for (i = MatrixBegin[j]; i < MatrixBegin[j] + MatrixCount[j]; i
        ++) {
                printf("The entry in row %d, column %d has value %g\n",
                                MatrixIndex[i], j, MatrixValues[i]);
        }

> 
> Also, I am confused about declaring unconstrained variables.
> In example.c, it seems that upper bounds are set to 1e+37 when they
> are unbounded from above. Am I right about this?

Generally, solvers select a very large finite value to indicate a
variable whose upper bound is infinite.  This simplifies the process of
testing for a bound, and still is almost always practically
distinguishable from the case of a "real" finite bound.  The practice
dates from long before IEEE 754.  The chosen value may differ among
solvers, but yes, your interpretation is correct.


-- 
Matthew Saltzman
Clemson University Mathematical Sciences
mjs AT clemson DOT edu


_______________________________________________
CoinUtils mailing list
CoinUtils at list.coin-or.org
http://list.coin-or.org/mailman/listinfo/coinutils
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/coinutils/attachments/20120409/367e1f9c/attachment-0001.html>


More information about the CoinUtils mailing list