MathGroup Archive 2009

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

Search the Archive

Re: Compile for different parameter types

  • To: mathgroup at smc.vnet.net
  • Subject: [mg97400] Re: Compile for different parameter types
  • From: Raffy <raffy at mac.com>
  • Date: Thu, 12 Mar 2009 05:41:41 -0500 (EST)
  • References: <gpacur$mu6$1@smc.vnet.net>

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