That's certainly a very clever use of recursion. I don't know how often users of mathprog use this recursive feature. If not very often, then perhaps there could be a warning issued.
-----Original Message----- From: Andrew Makhorin [mailto:[EMAIL PROTECTED] Sent: Saturday, June 21, 2008 3:32 AM To: Meketon, Marc Cc: [email protected] Subject: Re: [Help-glpk] GMPL fails on circular references >> I had a line of math-prog code that had a circular reference: >> param FromNode{ (train,sd,seq) in TRAIN_SEGS } symbolic >> := Terminal[FromNode[train,sd,seq]]; >> GMPL, much further down in the model, just stops without any >> warning or anything else. It took a while to figure out the circular >> reference >> and fix my error. If possible, it would be nice if GMPL could >> discover this >> and issue a message. > It is problematic, because mathprog allows recursive definition of > sets and parameters. Incorrect definition, as in your case, leads to > infinite loop that, in turn, causes stack overflow--the same that > would happen in any programming language. See, for example, recursive definition of parameter z in model bpp.mod included in glpk distribution. _______________________________________________ Help-glpk mailing list [email protected] http://lists.gnu.org/mailman/listinfo/help-glpk
