MathGroup Archive 2013

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

Search the Archive

Re: Through[Divide[f1, f2][x]]

  • To: mathgroup at smc.vnet.net
  • Subject: [mg130952] Re: Through[Divide[f1, f2][x]]
  • From: Bob Hanlon <hanlonr357 at gmail.com>
  • Date: Tue, 28 May 2013 04:17:49 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • Delivered-to: l-mathgroup@wolfram.com
  • Delivered-to: mathgroup-outx@smc.vnet.net
  • Delivered-to: mathgroup-newsendx@smc.vnet.net
  • References: <20130526090600.D7C18633A@smc.vnet.net>

"Sometimes it would be nice to have a "reverse map", that
applied each of a list of functions to a single argument,
instead of a single function to each of a list of arguments."

Use Through

Through[{f1, f2, f3, f4}[x]]


{f1[x], f2[x], f3[x], f4[x]}


or Map


#[x] & /@ {f1, f2, f3, f4}


{f1[x], f2[x], f3[x], f4[x]}



Bob Hanlon


On Sun, May 26, 2013 at 5:06 AM, Ray Koopman <koopman at sfu.ca> wrote:

> Either of these will give you f1[x]/f2[x]:
>
>   Divide@@{f1@#,f2@#}&@x
>
>   Divide@@(#@x&)/@{f1,f2}
>
> Sometimes it would be nice to have a "reverse map", that
> applied each of a list of functions to a single argument,
> instead of a single function to each of a list of arguments.
>
> ----- Andres Guzman <andres.guzman.fernandez at gmail.com> wrote:
> > $Version
> > 8.0 for Linux x86 (64-bit) (October 10, 2011)
> >
> > Through[Divide[f1, f2][x]]
> > f1[x] (1/f2)[x]
> >
> > (* When what I want is: Divide[f1[x],f2[x]] . An uncomfortable
> >    consequence of the way Mathematica treats division.*)
> >
> > Divide[f1, f2] // FullForm
> > Times[f1, Power[f2, -1]]
>
>




  • Prev by Date: Re: Work on Basic Mathematica Stephen!
  • Next by Date: ListVectorPlot3D
  • Previous by thread: Re: Through[Divide[f1, f2][x]]
  • Next by thread: Re: Through[Divide[f1, f2][x]]