[Cbc] Regarding matrix operations within coinor

G Chandramouli gcmouli1 at gmail.com
Mon Jul 21 07:25:13 EDT 2014


Dear all,
         In CoinPackedMatrix(or other coinor library)  is there
 a way to get the matrix in some standard format (for e.g. CSC etc),
so that I can use some  standard libraries like armadillo or eigen.
 Even lapack/blas will work. Fetching and copying each individual
 element is one way, but I want to  maintain sparse storage.
 I need to do some matrix computations like dot product of two
different rows, getting upper triangular elements of AA^T,
 solving Ax=b etc.

 Also, is there is a way to create identity matrix outside
(let us say using some 2d array in C++) and then import it to a
 matrix in CoinPackedMatrix form. Doing it directly, takes a lot of
 time when no. of columns is large. Is there a better way to do this.

I did the following stuff, but it took nearly 700 secs for
 numberColumns >200000

 ------------------------------------------------------------------
CoinPackedMatrix *matrix_col=new CoinPackedMatrix(false,0,0);
matrix_col->setDimensions(0,numberColumns);
CoinPackedVector *row=new CoinPackedVector[numberColumns];
for(int i=0;i<numberColumns;i++)
        {
                row[i].insert(i,1);
                matrix_col->appendRow(row[i]);
        }
-------------------------------------------------------------------
Thanks,
Mouli
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/cbc/attachments/20140721/b678e1c1/attachment.html>


More information about the Cbc mailing list