- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Array initialization in Function fails
Page Start Prev 1 Next End
Array initialization in Function fails
Array initialization in Function fails
Jan-09-14 07:29:54
A trivial example code to illustrate this.
Code:
model tryme
Real y ;
equation
y = myfun(3.4) * y + 2 ;
end tryme;
function myfun
input Real x ;
output Real y ;
// protected Real z[3 ]= {1,2,3} ; // This Falis (why ??)
protected Real z[3] ; // Works
algorithm
z[1] := x ;
y := 2 * z[1] ;
end myfun;
- ravi
- 32 Posts
Re: Array initialization in Function fails
Jan-09-14 09:55:16
Bug reports go here: https://trac.openmodelica.org/OpenModelica/newticket. There is a segmentation fault in the model because it directly uses a constant data segment instead of copying it.
- sjoelund.se
- 1700 Posts
Page Start Prev 1 Next End
- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Array initialization in Function fails
There are 0 guests and 0 other users also viewing this topic