Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #8077

Re: Tips for writing correct, non trivial Mathematica Libraries

From Murray Eisenberg <murray@math.umass.edu>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: Tips for writing correct, non trivial Mathematica Libraries
Date 2012-01-22 12:20 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <jfgutk$pb7$1@smc.vnet.net> (permalink)

Show all headers | View raw


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@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

Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread


Thread

Re: Tips for writing correct, non trivial Mathematica Libraries Murray Eisenberg <murray@math.umass.edu> - 2012-01-22 12:20 +0000

csiph-web