Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2000

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

Search the Archive

Re: Re: Could this be improved?---Continued

  • To: mathgroup at
  • Subject: [mg21859] Re: [mg21832] Re: Could this be improved?---Continued
  • From: Hartmut Wolf <hwolf at>
  • Date: Wed, 2 Feb 2000 22:54:17 -0500 (EST)
  • Organization: debis Systemhaus
  • References: <>
  • Sender: owner-wri-mathgroup at

Allan Hayes schrieb:
> Jordan Rosenthal posted the problem of timing the evaluation of individual
> members of a list - how to prevent the members evaluating before Timing was
> wrapped round them.
> I put the following together in response to an email from Jordan.
> Timing[#[vSmall];] & /@ {f1, f2, f3, f4}
> More flexible is:
> Thread[Unevaluated[
>     Timing[#[#2];] &[{f1, f2, f3, f4}, vSmall]]]
> The next form allows multiple inputs to the functions.
> Thread[Unevaluated[
>     Timing[# @@ #2] &[{f1, f2, f3, f4}, {vSmall, vSmall2}]],
>   List, 1]
> Allan

Dear Allan

Just to look for variants, my answer to Jordan was (obviously we got the
same mail):

   List @@ Timing /@ Through[Hold[f1, f2, f3, f4][vSmall]]

This works for any number of arguments. If you want to do several tests
with one stroke you may do

   List @@ Timing /@ 
      Flatten[Outer[Apply, Hold[f1, f2, f3, f4], 
                           Hold[{vSmall, vSmall2}, {wSmall, wSmall2}]]]

yours, Hartmut

  • Prev by Date: Re: ContourPlot in arbitrary shape domain.
  • Next by Date: ConstrainedMin and vector-notation
  • Previous by thread: Re: ContourPlot in arbitrary shape domain.
  • Next by thread: ConstrainedMin and vector-notation