octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Opinions for linspace behavior


From: Olaf Till
Subject: Re: Opinions for linspace behavior
Date: Thu, 27 Aug 2015 09:02:03 +0200
User-agent: Mutt/1.5.23 (2014-03-12)

> On Wed, Aug 26, 2015 at 22:11:35 +0100, Carnë Draug wrote:
> > However, suppose some code which gets an arbitrary number of base values
> > in a row vector (so each new vector is a column vector).  When this program
> > gets a single base value, linspace() will suddenly return a single row
> > vector instead of the expected single column vector.

Thats a good point.

Also, the second argument can also be a vector, and there might be
cases in which the vectors have different orientation:

linspace ([a, b], [c; d], f)

(currently returning [a, ..., b; c, ..., d]).

> > So we'd have to add an
> > extra option to specify dimension.

That would indeed be necessary. But Riks original motive was probably
to make the returned value fitting with the orientation of the
arguments, so this extra option seems to be a different issue.

> > I'm not sure if it's worthy the extra
> > complication.

IMHO it could only be worth it if it's internally done without
transposing the result (otherwise it wouldn't be better than having
the user transpose the result). But doing it internally without
transposing would among others mean to change the whole lot of
linspace() functions in liboctave/array/... .

Olaf

-- 
public key id EAFE0591, e.g. on x-hkp://pool.sks-keyservers.net

Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]