Opened 14 years ago
Last modified 14 years ago
#1287 closed defect (fixed)
Codegen for single array element
Reported by: | Willi Braun | Owned by: | Willi Braun |
---|---|---|---|
Priority: | high | Milestone: | |
Component: | Code Generation | Version: | 1.6.0 |
Keywords: | Cc: | Willi Braun, |
Description
small model that fails:
{{{model smallArray
parameter Boolean a[:] = {false};
Boolean out[size(a,1)];
algorithm
for i in 1:size(a,1) loop
if a[i] then
out[i] := true;
else
out[i] := false;
end if;
end for;
end smallArray;
}}}
with following error message:
{{{smallArray.cpp: In function ‘int functionDAE_output2()’:
smallArray.cpp:464: error: ‘OTHER_ASUB’ was not declared in this scope
smallArray.cpp: In function ‘int function_updateDependents()’:
smallArray.cpp:597: error: ‘OTHER_ASUB’ was not declared in this scope
smallArray.cpp: In function ‘int function_updateDepend(int&)’:
smallArray.cpp:629: error: ‘OTHER_ASUB’ was not declared in this scope}}}If the the array is set up with two elements
(e.g. a[:] = {false,true}; ) }}}then the model is compilable.
Change History (2)
comment:1 by , 14 years ago
comment:2 by , 14 years ago
Thanks to your fixes in revision 6171, this now works for Boolean and Integer too.
This is partially fixed in revision 6169, but only works for Real arrays. For other types of arrays it doesn't work no matter the size of the array.