﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
1164	vector() can't handle matrix flattening!?	asodja	asodja	"The assigment {{A := diagonal(vector(ones(1, 4)));}} gets expanded to {{A := { {1,0,0,0},{0,1,0,0},{0,0,1,0},{0,0,0,1} } }} and fails, while assignment {{A := diagonal(vector(ones(4)));}} (notice the params passed to {{ones()}}) works fine.


The error produced by the first option (which fails) is:

{{
instantiateDaeFunction failed for MatrixAssign \\Error processing file: MAssign.mo \\- Algorithm.makeAssignment failed \\    A := { {1,0,0,0},{0,1,0,0},{0,0,1,0},{0,0,0,1} } \\- Algorithm.makeAssignment failed \\    A := { {1,0,0,0},{0,1,0,0},{0,0,1,0},{0,0,0,1} } \\

Error: Error occured while flattening model Vector may only be 1x2 or 2x1 dimensions \\Error: Type mismatch in assignment in A := {{1,0,0,0},{0,1,0,0},{0,0,1,0},{0,0,0,1}} of Real[4, 4] := Integer[1, 1, 4] \\Error: Error occured while flattening model Vector may only be 1x2 or 2x1 dimensions \\Error: Type mismatch in assignment in A := {{1,0,0,0},{0,1,0,0},{0,0,1,0},{0,0,0,1}} of Real[4, 4] := Integer[1, 1, 4] \\Error: No matching function found for MatrixAssign() of type function() => Real[4, 4], candidates are function() => Real[4, 4] \\
}}

It seems that the function {{vector()}} can't handle matrix flattening!?

Also see the test file in attachment."	defect	closed	high		Instantiation	1.5.0RC2	fixed		asodja Per Östlund
