[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-glpk] Inputting a large sparse matrix in GLPK data file
From: |
Andrew Makhorin |
Subject: |
Re: [Help-glpk] Inputting a large sparse matrix in GLPK data file |
Date: |
Thu, 23 Oct 2008 03:11:11 +0300 |
> I am a newbie to GLPK - but am enjoying this !
> I need to input (or specify) a large sparse integer matrix A which is
> say 1500 X 1500.
> Only a few entries are integers, say 100 of them are integers and the
> rest are zeros.
> How does one go about inputting this in to GLPK ?
> How is this done neatly in GLPK ? (ie initializing all entries of A to
> zero) and inputting only the non-zero ones
> I was trying something along the lines of saying (in the MOD file)
> set I := 1..1500;
> set J := 1..1500;
> param A{i in I, j in J}, >=0, default 0.0;
> How are the non-zero entries specified then ?
> When I tried setting [in the DAT file]
> A[1,2] := 5; A[3, 2]:=9, A[1,6]: = 6;
> I get an error.
> Please help !!!
param A := [1,2] 5 [3,2] 9 [1,6] 6;
Note that there are other, more convenient ways to specify parameters
in the data section; see example models included in the distribution.