﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
1595	sum-function does not work with arrays with three or more dimensions	Teemu Lempinen	Teemu Lempinen	"sum-function does not work properly if an array given to it has three or more dimensions. I suppose it should handle any number of dimensions.
{{{
 model ArrayTest
   Real Valve1[2,2,2] = fill(1,2,2,2);
   Real total;
 equation
   total = sum(Valve1);
 end ArrayTest;
}}}

flattens to

{{{
 class ArrayTest
   Real Valve1[1,1,1] = 1.0;
   Real Valve1[1,1,2] = 1.0;
   Real Valve1[1,2,1] = 1.0;
   Real Valve1[1,2,2] = 1.0;
   Real Valve1[2,1,1] = 1.0;
   Real Valve1[2,1,2] = 1.0;
   Real Valve1[2,2,1] = 1.0;
   Real Valve1[2,2,2] = 1.0;
   Real total;
 equation
   total = {Valve1[1,1,1] + (Valve1[1,2,1] + (Valve1[2,1,1] + Valve1[2,2,1])),Valve1[1,1,2] + (Valve1[1,2,2] + (Valve1[2,1,2] + Valve1[2,2,2]))};
 end ArrayTest;
}}}

{{{
 [ArrayTest2.mo:3:3-3:13:writable] Error: Internal error Initial value of unknown type: {4.0,4.0}
 [SimCodeC.tpl:2372:14-2372:14:writable] Error: Template error: initial value of unknown type: {4.0,4.0}
}}}

(Sorry about the formatting issues in the last bug report. I was lazy and tried to use the WYSIWYG)"	defect	closed	high			1.7.0	fixed		Teemu Lempinen
