help-glpk
[Top][All Lists]
Advanced

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

Re: [Help-glpk] random numbers, excel import


From: glpk xypron
Subject: Re: [Help-glpk] random numbers, excel import
Date: Sat, 26 Sep 2009 22:12:49 +0200

Hello Mouli,

functions to create random numbers are described in file
doc/gmpl.pdf of the source distribution available at 
ftp://ftp.gnu.org/gnu/glpk/glpk-4.39.tar.gz

Unfortunately the seed of the random number generator
can not be changed. Hence in each run you will get the same
numbers.

# Example
set I := 1..400;
param r{i in I, j in I} := Uniform01();
display r;
end;

If you want to import data from Excel you can export the data
to a CSV file and import it with command "table IN" 
documented in doc/tables.pdf.

GLPK conforms to RFC4180.
http://www.rfc-editor.org/rfc/rfc4180.txt
except for LF used as line separator on Unix systems.

Unfortuately the CSV file format from Excel depends on the
regional settings of Windows. Eg. with German settings
fields are separated by semicolon. US settings will work together
with GLPK.

# Example
set V,dimen 2;
set I := setof{(i,j) in V}i;
set J := setof{(i,j) in V}j;
param r{V};
table ti IN "CSV" "c:\temp\data.csv" :
V <- [FROM, TO], r~DISTANCE;
display I,J,r;
end;

Best regards

Xypron


-------- Original-Nachricht --------
> On Fri, Sep 25, 2009 at 1:44 PM, G Chandramouli 
> wrote:
> 
> > Hi Jose,
> >             Can you please tell me how to input a random matrix of 400 *
> > 400 in GMPL or can I write it from some excel file ?
> > Regards
> > Mouli
> >
> >

-- 
Jetzt kostenlos herunterladen: Internet Explorer 8 und Mozilla Firefox 3.5 -
sicherer, schneller und einfacher! http://portal.gmx.net/de/go/chbrowser




reply via email to

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