Array of arrays of various sizes and compile
- To: mathgroup at smc.vnet.net
- Subject: [mg115669] Array of arrays of various sizes and compile
- From: Ramiro <ramiro.barrantes at gmail.com>
- Date: Tue, 18 Jan 2011 05:47:47 -0500 (EST)
Is it possible to include such a variable in a compiled function?
{ {1}, {2,3}, {1}, {5,7,8} }
I am getting an error with such input.
Example:
example=Compile[{{m,_Integer,2}},Plus@@Flatten[m]]
example[{{1},{2}}]
Works ok.
But for the following:
example[{{1},{2,1}}]
During evaluation of In[338]:= CompiledFunction::cfta: Argument {{1},
{2,1}} at position 1 should be a rank 2 tensor of machine-size
integers. >>
Out[340]= 4
Any suggestions?
Thanks,
Ramiro