[Clp] Performance Issue with CoinPackedMatrix
John Forrest
john.forrest at fastercoin.com
Wed Mar 11 10:54:32 EDT 2015
Alexander,
A CoinPackedMatrix can have rows added - to make this have less overhead
an initial gap can be left between the elements for each column. This
means that giving the start of each column and then the rows and
elements is not enough - you need to give the length of each column.
If you have no gaps then set len=NULL. The code then checks that
start[major]==numels and operates as you would expect. The last two
arguments should be zero in that case.
John Forrest
On 11/03/15 14:01, alexander wrote:
> Hi,
>
> I want to solve min_y ||Ay-b|| using CLP (A has n rows and m columns,
> n>>m, in my case m = 2, n something like 100). Therefore I create an
> augmented matrix:
> B = (A, I, -I)
> and solve
> min_x c^T x s.t. Bx = b
>
> where:
> a) x_i >= 0 for i > m otherwise x_i is free,
> b) c_i = 1 for i > m, otherwise c_i = 0
>
> This works just fine. My problem is that _filling_ the CoinPackedMatrix
> is very slow. I compared it to filling a dense armadillo matrix, the
> dense matrix is filled 40 times faster.
>
> This is the code I use to solve the linear problem:
>
> http://paste.debian.net/160743/
>
> I'm using modifyCoefficient and I think that's causing the performance
> issues.
>
> I tried to use the constructor for CoinPackedMatrix which takes 8
> arguments but I can't figure out what the "const int* len" argument is
> supposed to be.
>
> Is there a faster way to fill the matrix?
>
> Alexander
>
>
> _______________________________________________
> Clp mailing list
> Clp at list.coin-or.org
> http://list.coin-or.org/mailman/listinfo/clp
>
>
More information about the Clp
mailing list