help-glpk
[Top][All Lists]
Advanced

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

Re: [Help-glpk] String literal too long


From: Yaron Kretchmer
Subject: Re: [Help-glpk] String literal too long
Date: Sun, 22 Mar 2009 12:39:45 -0700

Hi Xypron
Sorry, I didn't try had enough to make my point :)
Here's a corrected model which illustrates the problem:
set F := {1..3};
param x{f in F} := 3;
solve;
table tab_results{f in F:x[f]>0} OUT "CSV"
"YesImaverylongpathbutthatsOKfortheoperatingsystemsowhyisntitokforglpkYesImaverylongpathbutthatsOKfortheoperatingsystemsowhyisntitokforglpkYesImaverylongpathbutthatsOKfortheoperatingsystemsowhyisntitokforglpkYesImaverylongpathbutthatsOKfortheoperatingsystemsowhyisntitokforglpkYesImaverylongpathbutthatsOKfortheoperatingsystemsowhyisntitokforglpk.csv"
:
f;

Changing the MAX_LENGTH number to 2000 solved my problem. Except for higher memory consumption, would there be any adverse effects of a higher MAX_LENGTH on glpsol?
 
Thanks
Yaron

 
On Sun, Mar 22, 2009 at 12:26 PM, xypron <address@hidden> wrote:

Hello Yaron,


Yaron Kretchmer-2 wrote:
>
> Hi All
> I'm getting a "String literal too long" error from glpsol when giving a
> (admittedly very long, but still valid) file path
> *table tab_results{f in F:x[f]>0} OUT "CSV"
> "YesImaverylongpathbutthatsOKfortheoperatingsystemsowhyisntitokforglpk.csv"
> :
> *
> **
> Is that because i'm violating some built-in max length setting? If so,
> what
> is it , can I change it , and if so, where ?
>

The maximum length of a symbol is defined in include/gmpl.h to be 100
characters.

#define MAX_LENGTH 100
/* maximal length of any symbolic value (this includes symbolic names,
  numeric and string literals, and all symbolic values that may appear
  during the evaluation phase) */

The following model following your example solved without a problem because
the
string length of the file name is "only" 73 characters.

set F := {1..3};
param x{f in F} := 3;
solve;
table tab_results{f in F:x[f]>0} OUT "CSV"
"YesImaverylongpathbutthatsOKfortheoperatingsystemsowhyisntitokforglpk.csv"
:
f;

Best regards

Xypron
--
View this message in context: http://www.nabble.com/String-literal-too-long-tp22643593p22649552.html
Sent from the Gnu - GLPK - Help mailing list archive at Nabble.com.



_______________________________________________
Help-glpk mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/help-glpk


reply via email to

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