<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 &lt;mjs@clemson.edu&gt;<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>&gt; I have just installed the CoinMP library (CoinMP.dll) found<br>&gt; at <a href="https://projects.coin-or.org/CoinMP" target="_blank">https://projects.coin-or.org/CoinMP</a><br>&gt; <br>&gt; I don't think the example.c file nor the CoinMP.h file provided with<br>&gt; the package are sufficient to figure out how to use the library.<br>&gt; However, I cannot seem to find a document that explains all the<br>&gt; 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.&nbsp; 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>&gt;
 <br>&gt; Specifically, I cannot figure out how to use the following function<br>&gt; exported by CoinMP.dll:<br>&gt; SOLVAPI int&nbsp; &nbsp; SOLVCALL CoinLoadProblem(HPROB hProb,&nbsp; <br>&gt; int ColCount, int RowCount, int NZCount, int RangeCount, <br>&gt; int ObjectSense, double ObjectConst, double* ObjectCoeffs, <br>&gt; double* LowerBounds, double* UpperBounds, const char* RowType, <br>&gt; double* RHSValues, double* RangeValues, int* MatrixBegin,&nbsp; <br>&gt; int* MatrixCount, int* MatrixIndex, double* MatrixValues,&nbsp;  <br>&gt; char** ColNamesList, char** RowNamesList, const char* ObjectName);<br>&gt; <br>&gt; What is the meaning of RangeCount and MatrixBegin? I have inferred<br>&gt; from the example code that matrixCount stores the number of variables<br>&gt; in each column of the constraint matrix and that matrixIndex stores<br>&gt; the position of those variables within the columns, but which document<br>&gt; 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.&nbsp; (Probably not documented here just because it's pretty<br>well known, so the author assumes there's no need.)&nbsp; <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).&nbsp; 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.&nbsp; A third array tells where in these two<br>arrays the block of entries associated with
 each column starts.&nbsp; Often<br>another array gives the count of nonzeros in each column, so that<br>padding can be included in the row blocks.&nbsp; So walking a column is<br>accomplished by a loop like:<br><br>&nbsp; &nbsp; &nbsp; &nbsp; for (i = MatrixBegin[j]; i &lt; MatrixBegin[j] + MatrixCount[j]; i<br>&nbsp; &nbsp; &nbsp; &nbsp; ++) {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; printf("The entry in row %d, column %d has value %g\n",<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MatrixIndex[i], j, MatrixValues[i]);<br>&nbsp; &nbsp; &nbsp; &nbsp; }<br><br>&gt; <br>&gt; Also, I am confused about declaring unconstrained variables.<br>&gt; In example.c, it seems that upper bounds are set to 1e+37 when they<br>&gt; 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.&nbsp; 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.&nbsp; The practice<br>dates from long before IEEE 754.&nbsp; 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>