MathGroup Archive 2010

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

Search the Archive

Re: Clip[DirectedInfinity[1]] remains unevaluated?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg107435] Re: Clip[DirectedInfinity[1]] remains unevaluated?
  • From: Raffy <adraffy at gmail.com>
  • Date: Fri, 12 Feb 2010 04:44:31 -0500 (EST)
  • References: <201002111018.FAA28036@smc.vnet.net> <hl0r26$ua$1@smc.vnet.net>

On Feb 11, 3:52 am, Patrick Scheibe <psche... at trm.uni-leipzig.de>
wrote:
> Hi,
>
> what about
>
> Clip[Infinity] // Simplify
>
> ?
>
> Cheers
> Patrick
>
>
>
> On Thu, 2010-02-11 at 05:18 -0500, asdf qwerty wrote:
> > Shouldn't Clip[Infinity] evaluate to 1? It remains unevaluated. I'm
> > trying to think of a reason why 1 wouldn't always be the correct
> > answer. Same with Clip[-Infinity], seems like it should be -1.

You can fix by doing:

Unprotect[Clip];
Clip[x_List /; ! Developer`PackedArrayQ[x], a___] := Clip[#, a] & /@
x;
Clip[Infinity] = 1;
Clip[Infinity, ___, {_, max_}] := max;
Clip[-Infinity] = -1;
Clip[-Infinity, ___, {min_, _}] := min;
Protect[Clip];


  • Prev by Date: Re: Plotting two list variables
  • Next by Date: Re: download data from database
  • Previous by thread: Re: Clip[DirectedInfinity[1]] remains unevaluated?
  • Next by thread: Plotting two list variables