[Fwd: MathProg set vs param]
Andrew Makhorin <[email protected]> Sun, 28 May 2023 03:17:52 +0300
| Newsgroups | gmane.comp.gnu.glpk |
|---|---|
| Message-ID | <[email protected]> |
-------- Forwarded Message -------- From: Code Raguet <[email protected]> To: [email protected] Subject: MathProg set vs param Date: Sat, 27 May 2023 19:51:01 -0300 > Hi, there! > I'm new to MathProg (and LP) but I have several years as a software > developer. > I would like to understand the semantic differences between set and > param. > When reading the doc and looking at examples, I understand that the > set statement is for sets, arrays, vectors, (n-tuples) and simple > symbolic elements. On the other hand, param statement is for simple > scalar values or values of a set (usually indexed). > > My issues are about the semantics and rationale behind these > statements. > Why are two different statements for doing quite similar (in my > understanding) purpose? > I mean, both declare data structures (and initialize in the data > section). > Aren't sets kind of a param after all? > > for ex.: > Imagine declaring an array of simple elements: > set S := {'A', 'B'}; > param P{i in {'A', 'B'}}; > > How are these statements different? > > > Thanks in advance, > Ignacio.