help-glpk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-glpk] glp_malloc: no memory available


From: glpk xypron
Subject: Re: [Help-glpk] glp_malloc: no memory available
Date: Mon, 16 Jul 2012 23:04:32 +0200

Hello David,

normally the matrices of LP problems are sparse.

Probably you will be using glp_set_mat_row, glp_set_mat_col, or glp_load_matrix 
in your code. Make sure that you only copy values that are not zero.

Make sure that you delete the vectors you are passing to said methods after 
usage.

            ind = GLPK.new_intArray(3);
            GLPK.intArray_setitem(ind, 1, 1);
            GLPK.intArray_setitem(ind, 2, 2);
            val = GLPK.new_doubleArray(3);
            GLPK.doubleArray_setitem(val, 1, 1.);
            GLPK.doubleArray_setitem(val, 2, -1.);
            GLPK.glp_set_mat_row(lp, 1, 2, ind, val);
            GLPK.delete_doubleArray(val);
            GLPK.delete_intArray(ind);

Best regards

Xypron

-------- Original-Nachricht --------
> Datum: Mon, 16 Jul 2012 13:44:19 -0400
> Betreff: [Help-glpk] glp_malloc: no memory available

> Hello,
> 
> I am building an LP using GLPK_4_47 in eclipse and am receiving the error:
> 
> glp_malloc: no memory available
> Error detected in file ..\src\glpenv05.c at line 70
> Exception in thread "main" org.gnu.glpk.GlpkException: function
> glp_add_rows failed
> at org.gnu.glpk.GLPKJNI.glp_add_rows(Native Method)
> at org.gnu.glpk.GLPK.glp_add_rows(GLPK.java:230)
> at
> cmif.LPWeighting.LPWeighting.developIMinusKConstraintsMax(LPWeighting.java:234)
> at cmif.LPWeighting.LPWeighting.singleOutputMaxLP(LPWeighting.java:56)
> at tests.MassSamplingLPTest.main(MassSamplingLPTest.java:30)
> 
> If anyone has any help at all, it would be much appreciated.  Thanks.
> 
> --David



reply via email to

[Prev in Thread] Current Thread [Next in Thread]