The actual usage was wrapped in a function, where profiling showed that
the cost was comparable to a DCT. No global variables were used.
The issue: in the attached code it doesn't realize that the output of
plan(x) where plan is a pre-planned DCT is a vector, so it can't compile the
for loop.
So what I did to fix it was split out the for loop into a separate
function, negateeven!. Probably annotating the output of plan would be another
solution. Thanks for the help.
function foo(plan::Function,x::Vector)
y = plan(x)
for k =2:2:length(y)
y[k] = -y[k]
end
end
On 6 Jan 2014, at 6:23 pm, Ivar Nesje <[email protected]> wrote:
> Are you using global variables? Try to wrap your computation in a function.