[Scip] ZIMPL: error when accessing variable in function

Jan Vaillant jv at zalf.de
Fri Sep 5 10:24:49 CEST 2014


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



More information about the Scip mailing list