MathGroup Archive 2012

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

Search the Archive

Re: Tips for writing correct, non trivial Mathematica Libraries

  • To: mathgroup at smc.vnet.net
  • Subject: [mg124500] Re: Tips for writing correct, non trivial Mathematica Libraries
  • From: Murray Eisenberg <murray at math.umass.edu>
  • Date: Sun, 22 Jan 2012 07:19:07 -0500 (EST)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com

Oops -- I should have tested that myself rather than infer from the OP's 
message that the built-in function worked for scalars.

On 1/21/12 7:40 AM, Andrzej Kozlowski wrote:
>
> On 21 Jan 2012, at 11:13, Murray Eisenberg wrote:
>
>> Whether a function whose natural domain consists of lists should coerce
>> a scalar into a one-element list is purely a matter of convenience.
>>
>> That the built-in GeometricMean does do that whereas the documentation's
>> example geom does not is perhaps just a sloppy oversight in constructing
>> that example.
>
>
>
> GeometricMean[x + y]
>
> During evaluation of In[122]:= GeometricMean::vecmat1: Argument x+y is neither a non-empty vector nor a non-empty matrix.>>
>
> GeometricMean[x + y]
>
> Andrzej Kozlowski

-- 
Murray Eisenberg                     murray at math.umass.edu
Mathematics & Statistics Dept.
Lederle Graduate Research Tower      phone 413 549-1020 (H)
University of Massachusetts                413 545-2859 (W)
710 North Pleasant Street            fax   413 545-1801
Amherst, MA 01003-9305



  • Prev by Date: Re: MatrixPower problem
  • Next by Date: Re: select 1st column element based on criteria in 2nd AND 3rd column
  • Previous by thread: Re: Tips for writing correct, non trivial Mathematica Libraries
  • Next by thread: Re: Tips for writing correct, non trivial Mathematica Libraries