MathGroup Archive 2006

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

Search the Archive

Re: Redundant numerical input

  • To: mathgroup at smc.vnet.net
  • Subject: [mg67881] Re: Redundant numerical input
  • From: "Ray Koopman" <koopman at sfu.ca>
  • Date: Tue, 11 Jul 2006 05:59:04 -0400 (EDT)
  • References: <e8nsji$k46$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

gregorc wrote:
> I am using manually defined (compiled) function which takes for input
> over 50 arguments of length 3. Most of these are just material
> parameters which are constant during numerical simulation and only 3 of
> them are calculation variables. When the function is threaded over many
> discretization points, the calculation becomes rather time consuming. I
> was wondering if it is somehow posible to "tell" the numerical function
> not to parse the redundant parameters every time, since they are already
> in the memory, i.e. use the same form of numerical function, but only 3
> calculation varibles are evaluated each time used. I think this would
> greatly speed up my calculations!?

Do you mean you have something like
func = Compile[{p1, ..., p53}, whatever]
where the values assigned to p1,...,p50 are usually constant?
If so then why not make a function-generator
genfunk[p1_, ..., p50_] := Compile[{p51, p52, p53}, whatever]]
which you call to create a function with the values of p1,...,p50
fixed at x1,...x50:  funk = genfunk[x1,...,x50].
Then  funk[x51,x52,x53]  will waste no time.


  • Prev by Date: Re: Non Linear fit problem
  • Next by Date: Re: Sturm-Liouville (eigenvalue/eigenfunction) problems
  • Previous by thread: Re: Redundant numerical input
  • Next by thread: Re: Re: Redundant numerical input