[Scip] Fwd: ZIMPL: error when accessing variable in function

Matthias Miltenberger miltenberger at zib.de
Tue Sep 16 11:00:51 CEST 2014


Hi Thorsten,

kannst du bitte auf die Frage antworten? Uns ist auch nicht klar, was da 
schief geht.

Viele Grüße
Matthias


-------- Forwarded Message --------
Subject: 	[Scip] ZIMPL: error when accessing variable in function
Date: 	Fri, 5 Sep 2014 10:24:49 +0200 (CEST)
From: 	Jan Vaillant <jv at zalf.de>
Reply-To: 	Jan Vaillant <jv at zalf.de>
To: 	scip at zib.de



Dear list,

I try to access a variable from within a function definition but get a 800 error
(unexpected VARSYM). Page 14 (4.7) in the ZIMPL documentation states "The
arguments of a function can only be numbers or strings, but within the function
definition it is possible to access all otherwise declared sets, parameters and
variables." Am I misunderstanding something?

Thank you
Jan

example:

set A := { 1, 2 };
param a_data[A] := <1> "a", <2> "b";
var a_vars[A];
defnumb func1(x) := a_data[x];
do print func1(1);
defnumb func2(x) := a_vars[x];

output:

[jv at localhost PMR]$ scip -f test.zpl
SCIP version 3.1.0 [precision: 8 byte] [memory: block] [mode: optimized] [LP
solver: SoPlex 2.0.0] [GitHash: 577ee45]
Copyright (c) 2002-2014 Konrad-Zuse-Zentrum fuer Informationstechnik Berlin
(ZIB)

External codes:
   Readline 6.2         GNU library for command line editing (gnu.org/s/readline)
   SoPlex 2.0.0         Linear Programming Solver developed at Zuse Institute
Berlin (soplex.zib.de) [GitHash: 568f354]
   cppad-20140000.1     Algorithmic Differentiation of C++ algorithms developed
by B. Bell (www.coin-or.org/CppAD)
   ZLIB 1.2.8           General purpose compression library by J. Gailly and M.
Adler (zlib.net)
   GMP 5.0.2            GNU Multiple Precision Arithmetic Library developed by T.
Granlund (gmplib.org)
   ZIMPL 3.3.2          Zuse Institute Mathematical Programming Language
developed by T. Koch (zimpl.zib.de)
   Ipopt 3.11.9         Interior Point Optimizer developed by A. Waechter et.al.
(www.coin-or.org/Ipopt)

user parameter file not found - using default parameters

read problem
============


base directory for ZIMPL parsing: </home/jv/Desktop/PMR>

a
*** Error 800: File test.zpl Line 6 : syntax error, unexpected VARSYM
*** defnumb func2(x) := a_vars[x];
***                          ^^^
Segmentation fault

_______________________________________________
Scip mailing list
Scip at zib.de
http://listserv.zib.de/mailman/listinfo/scip



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listserv.zib.de/pipermail/scip/attachments/20140916/50d92bd6/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5149 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://listserv.zib.de/pipermail/scip/attachments/20140916/50d92bd6/attachment.p7s>


More information about the Scip mailing list