Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.math.mathematica

Topic: Array of arrays of various sizes and compile
Replies: 5   Last Post: Jan 21, 2011 4:28 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Ramiro

Posts: 26
Registered: 9/18/07
Array of arrays of various sizes and compile
Posted: Jan 18, 2011 5:47 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

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




Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.