Here's a simplified form of a function I would like to compile, but it produces errors
DataType = Compile[{{Inputdata, _Real, 1}}, Module[{CIEL, CIEa, CIEb},
dim = Dimensions@Inputdata;
If[dim[[1]] > 3,
{CIEL, CIEa, CIEb} = Inputdata
]
],
CompilationTarget -> "C"
];
The error Mathematica produces is:
Compile::extscalar:
dim=Dimensions[Inputdata]cannot be compiled and will be evaluated externally. The result is assumed to be of type Void. >>
Is there a workaround to allow these types of functions to compile for conditionals that depend on the dimensions of a list?
(Dimensions@Inputdata)[[1]] > 3then you can't set{CIEL, CIEa, CIEb} = InputdatasinceDimensions@{CIEL, CIEa, CIEb} == {3}. – s0rce Nov 27 '13 at 03:21