MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Compile for different parameter types


This idea is kinda silly but:

funcString[a_Integer,b_Integer]:="Compile[{{A,_Real,"<>ToString[a]<>"},
{B,_Real,"<>ToString[b]<>"}}, expr]";

cache[a_Integer,b_Integer]:=cache[a,b]=ToExpression[funcString[a,b]];

func[a_?ArrayQ,b_?ArrayQ]:=cache[ArrayDepth[a],ArrayDepth[b]][a,b];

You can always prebuild the cache: Array[cache,{15,15}];


  • Prev by Date: Re: General form of a summation as a function of 2 variables
  • Next by Date: Re: Using Select
  • Previous by thread: Compile for different parameter types
  • Next by thread: Re: Compile for different parameter types