Re: sparse constructor "sum"

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Re: sparse constructor "sum"

Rik-4
On 06/06/2014 04:20 PM, [hidden email] wrote:

> Message: 4
> Date: Fri, 06 Jun 2014 16:03:18 -0400
> From: Jordi Guti?rrez Hermoso <[hidden email]>
> To: octave maintainers mailing list <[hidden email]>
> Subject: Confusing sparse summation
> Message-ID: <1402084998.4762.9.camel@Iris>
> Content-Type: text/plain; charset="UTF-8"
>
> Rik, why did you remove that doc example with cset 2dcc4398950d? Was
> it really that confusing?
>
> I've found people have found the default sparse summation behaviour to
> be confusing, so I thought an example that showed what it was
> equivalent to might be elucidating.
>
> - Jordi G. H.
Jordi,

The "sum" argument wasn't documented as being a valid argument to sparse()
in the @deftypefn header section, nor was there a separate paragraph
describing what "sum" did.  It's not in the Matlab documentation either, so
I found it confusing that the documentation referred to the default
behavior being equivalent to calling sparse with an undocumented option.

I think the best thing is to explicitly provide an example of the default
behavior and the behavior with the "unique" option.  I did that in this
documentation changeset which also increased the density of seealso links
between the various sparse functions
(http://hg.savannah.gnu.org/hgweb/octave/rev/53af80da6781)

--Rik