<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:8pt"><div><span>Thank you so much!</span></div><div><span>Exactly the information I need to start using the library.</span></div><div><span>I will direct all further questions to the CoinMP mailing list.</span></div><div><br></div> <div style="font-size: 8pt; font-family: 'times new roman', 'new york', times, serif; "> <div style="font-size: 12pt; font-family: 'times new roman', 'new york', times, serif; "> <div dir="ltr"> <font size="2" face="Arial"> <hr size="1"> <b><span style="font-weight:bold;">From:</span></b> Matthew Saltzman <mjs@clemson.edu><br> <b><span style="font-weight: bold;">To:</span></b> coinutils@list.coin-or.org <br> <b><span style="font-weight: bold;">Sent:</span></b> Sunday, April 8, 2012 10:07 PM<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: [CoinUtils] Where can I find comprehensive
CoinMP Documentation<br> </font> </div> <br>
On Sat, 2012-04-07 at 11:37 -0700, Mark Liu wrote:<br>> I have just installed the CoinMP library (CoinMP.dll) found<br>> at <a href="https://projects.coin-or.org/CoinMP" target="_blank">https://projects.coin-or.org/CoinMP</a><br>> <br>> I don't think the example.c file nor the CoinMP.h file provided with<br>> the package are sufficient to figure out how to use the library.<br>> However, I cannot seem to find a document that explains all the<br>> functions exported by CoinMP.dll.<br><br>It is a common problem with open-source tools that the developers like<br>coding better than documenting, so documenting often gets short shrift.<br><br>Your best bet for CoinMP questions is probably the CoinMP mailing list<br>at http://list.coin-or.org/mailman/listinfo/CoinMP. Author Bjarni has<br>been head down for a while, but is apparently back now, so you should be<br>able to get a response from him.<br><br>But keep reading.<br><br>>
<br>> Specifically, I cannot figure out how to use the following function<br>> exported by CoinMP.dll:<br>> SOLVAPI int SOLVCALL CoinLoadProblem(HPROB hProb, <br>> int ColCount, int RowCount, int NZCount, int RangeCount, <br>> int ObjectSense, double ObjectConst, double* ObjectCoeffs, <br>> double* LowerBounds, double* UpperBounds, const char* RowType, <br>> double* RHSValues, double* RangeValues, int* MatrixBegin, <br>> int* MatrixCount, int* MatrixIndex, double* MatrixValues, <br>> char** ColNamesList, char** RowNamesList, const char* ObjectName);<br>> <br>> What is the meaning of RangeCount and MatrixBegin? I have inferred<br>> from the example code that matrixCount stores the number of variables<br>> in each column of the constraint matrix and that matrixIndex stores<br>> the position of those variables within the columns, but which document<br>> actually explains
that?<br><br>This is one variation of one of two standard ways of storing the nonzero<br>entries of a sparse matrix representation of a set of linear<br>constraints. (Probably not documented here just because it's pretty<br>well known, so the author assumes there's no need.) <br><br>If you have a constraint with both upper and lower bounds (b_l \leq a^T<br>x \leq b_u), then you can convert it to an equality constraint with a<br>bounded slack (a^T x + s = b_u, 0 \leq s \leq b_u - b_l). These are<br>often called "range constraints", and I suspect that RangeCount just<br>tells how many of these there are--i.e., the number of entries in the<br>array RangeValues.<br><br>The sparse representation of the constraint matrix coefficients consists<br>of two arrays, one with the row indices of nonzeros and another with<br>their values, grouped by column. A third array tells where in these two<br>arrays the block of entries associated with
each column starts. Often<br>another array gives the count of nonzeros in each column, so that<br>padding can be included in the row blocks. So walking a column is<br>accomplished by a loop like:<br><br> for (i = MatrixBegin[j]; i < MatrixBegin[j] + MatrixCount[j]; i<br> ++) {<br> printf("The entry in row %d, column %d has value %g\n",<br> MatrixIndex[i], j, MatrixValues[i]);<br> }<br><br>> <br>> Also, I am confused about declaring unconstrained variables.<br>> In example.c, it seems that upper bounds are set to 1e+37 when they<br>> are unbounded from above. Am I right about this?<br><br>Generally, solvers select a very large finite value to indicate a<br>variable whose upper bound is
infinite. This simplifies the process of<br>testing for a bound, and still is almost always practically<br>distinguishable from the case of a "real" finite bound. The practice<br>dates from long before IEEE 754. The chosen value may differ among<br>solvers, but yes, your interpretation is correct.<br><br><br>-- <br>Matthew Saltzman<br>Clemson University Mathematical Sciences<br>mjs AT clemson DOT edu<br><br><br>_______________________________________________<br>CoinUtils mailing list<br><a ymailto="mailto:CoinUtils@list.coin-or.org" href="mailto:CoinUtils@list.coin-or.org">CoinUtils@list.coin-or.org</a><br>http://list.coin-or.org/mailman/listinfo/coinutils<br><br><br> </div> </div> </div></body></html>