help-glpk
[Top][All Lists]
Advanced

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

[Help-glpk] Re: Matrix definition


From: Andrew Makhorin
Subject: [Help-glpk] Re: Matrix definition
Date: Thu, 02 Dec 2010 10:09:35 +0300

> >   I have a large linear programming problem to solve where the constraint 
> matrix A in Ax<=b is sparse.
> > I defined:
> > 
> > param A{i in 1..n, j in 1..m} default 0.0;
> > 
> > So now in the data I would like to just define the non-zero values.
> > 
> > How can I do that? How do I address each element?
> > 
> > I tried 
> > 
> > data;
> > param A[2,3]:=5;
> > param A[6,1]:=2;
> > 
> > Etc.
> > 
> > But it does not work.
> > 
> > Any ideas?

data;
param A := [2,3] 5 [6,1] 2;

There exist several formats to specify data for 2d arrays. For more
details please see the mathprog language reference (doc/gmpl.pdf) and
examples included in the glpk distribution (egypt.mod, train.mod, etc.).




reply via email to

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