MathGroup Archive 2002

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

Search the Archive

Re: Sequence and Or

  • To: mathgroup at smc.vnet.net
  • Subject: [mg34226] Re: Sequence and Or
  • From: "Allan Hayes" <hay at haystack.demon.co.uk>
  • Date: Fri, 10 May 2002 03:05:10 -0400 (EDT)
  • References: <abdgc4$cil$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

"DrBob" <majort at cox-internet.com> wrote in message
news:abdgc4$cil$1 at smc.vnet.net...
> On second thought, I doubt this feature has much benefit, unless it
> works in a case like
>
> Or@@expr
>
> where expr resolves to a long list of logical expressions.  I'm
> wondering how that could be accomplished, and I fear it can't be.
>
> If this performance feature is limited to small numbers of arguments to
> Or... as many as you'd be willing to type... the benefit seems small.
> With large numbers of arguments, it seems we'd have to use While, or a
> similar construct.
>
> Bobby Treat

Bobby,
A suggestion, modifying  Andrzej Kozlowski's example:

    p1 := 1 == 1

    p2 := FullSimplify[Gamma[z]*z == z!]

    expr := {p1, p2};

    Timing[
        ReleaseHold[Hold[expr] /. OwnValues[expr] /. {x___} :> Or[x]]
    ]

{0. Second, True}

--
Allan

---------------------
Allan Hayes
Mathematica Training and Consulting
Leicester UK
www.haystack.demon.co.uk
hay at haystack.demon.co.uk
Voice: +44 (0)116 271 4198
Fax: +44 (0)870 164 0565





  • Prev by Date: Re: How to integrate over a constrained domain
  • Next by Date: Re: How to integrate over a constrained domain
  • Previous by thread: Re: Sequence and Or
  • Next by thread: Re: Sequence and Or