0

I work a lot on Mathematica and sometimes I need to optimize my computations by using compiled functions. Now I'm making numerical integrations and I'm trying to compile the functions involved to make everything faster. I'm having basically the fallowing issue which explain by it self:

gCC = Compile[{{x, _Real}}, x^2];

fCC = Compile[{{R, _Real}}, NIntegrate[gCC[x + y]*Boole[x^2 + y^2 < R^2], {x, -R, R}, {y, -R, R}] ];

Then when I use the function fCC I get the fallowing error:

fCC[2.1]

CompiledFunction::cfsa: Argument x+y at position 1 should be a machine-size real number. >>

30.549

How can I solve this? Regards.

0 Answers0