11 #include "OsiSolverInterface.hpp"
12 #include "CoinPackedVector.hpp"
13 #include "CoinPackedMatrix.hpp"
14 #include "CoinHelperFunctions.hpp"
17 using namespace Couenne;
20 void addSubMatr (
int *start,
int *len,
int *ind,
double *el,
30 *aLe = A.getVectorLengths (),
31 *aIn = A.getIndices (),
32 *vIn = v.getIndices (),
33 aCol = A.getMajorDim ();
35 int vNum = v.getNumElements ();
38 *aEl = A.getElements (),
39 *vEl = v.getElements ();
42 for (
int i=0; i<aCol; i++, len++) {
48 for (
int j = 0;
j < *len;
j++) {
49 *ind++ = dispM + *aIn++;
56 if (vNum && (*vIn == i)) {
83 const int *start,
const int *len,
84 const int *ind,
const double *el) {
86 printf (
"------------------- %d rows, %d columns, %d nz\n", nrows, ncols, nel);
88 for (
int i=0, cur = 0; i<nrows; i++) {
90 printf (
"%2d [%2d -> %2d] (%2d): ", i, start [i], start [i+1] - 1, len [i]);
92 for (
int j=0;
j < len [i];
j++)
93 printf (
"%d ", ind [start [i] +
j]);
97 for (
int j=0, indice = 0;
j < len [i] &&
j < 1000; j++) {
98 while (indice < ind [cur]) {indice++; printf (
". ");}
100 printf (
"%2g ", el [cur++]);
111 nrows = A -> getMajorDim (),
112 ncols = A -> getMinorDim (),
113 nel = A -> getNumElements ();
116 *el = A -> getElements ();
119 *len = A -> getVectorLengths (),
120 *start = A -> getVectorStarts (),
121 *ind = A -> getIndices ();
123 printMatrix (nrows, ncols, nel, start, len, ind, el);
129 const CoinPackedMatrix *A = si.getMatrixByCol ();
void printLPMatrix(const OsiSolverInterface &si)
void printMatrix(int nrows, int ncols, int nel, const int *start, const int *len, const int *ind, const double *el)
void addSubMatr(int *start, int *len, int *ind, double *el, CoinPackedMatrix &Astd, CoinPackedVector &rstd, int &cur, int &curCol, int dispM, int dispVec, int nrows)