Julian Francis
unread,Dec 13, 2011, 5:41:42 AM12/13/11You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
Dear all,
I have a simple function which compiles fine:
fC1 = Compile[{{mx, _Integer}, {my, _Integer}, {mat, _Real, 2}},
Sum[
mat[[mx, my]] , {a, 0, 1}]
]
However, a sum within a sum doesn't compile:
fC2 = Compile[{{mx, _Integer}, {my, _Integer}, {mat, _Real, 2}},
Sum[
Sum[
mat[[mx, my]] , {a, 0, 1}],
{b, 1, 1}]
]
which generates the following error message:
Compile::noinfo: No information is available for compilation of \!\
(\*UnderoverscriptBox[\(\[Sum]\), \(b = 1\), \(1\)]\
((\*UnderoverscriptBox[\(\[Sum]\), \(a = 0\), \(1\)]mat[[mx, my]])\)
\). The compiler will use an external evaluation and make assumptions
about the return type. >>
I am confused as to why the first works, but the second doesn't.
Any help would be appreciated.
Thanks,
Julian Francis.