Diagonal v. sparse matrices [was Re: deprecated functions]
Jaroslav Hajek
highegg at gmail.com
Wed Mar 4 14:39:29 CST 2009
On Wed, Mar 4, 2009 at 9:33 PM, John W. Eaton <jwe at octave.org> wrote:
> On 4-Mar-2009, Jaroslav Hajek wrote:
>
> | But why, by heaven? What's so wrong with diag(sparse(vector))?
>
> Nothing. I just didn't realize that diag would generate a sparse
> matrix. I was thinking that it would only generate a diagonal matrix
> object.
>
> jwe
>
Nope, I didn't break compatibility that much :) This is, in fact, the
standard Matlab way to create a sparse diagonal matrix. It would be
nice, however, to be able to write this as sparse(diag()) as well
without losing efficiency. It seems Jason is working on something
along that lines, so I'd leave it to him. Note that the proper
constructors are already defined in liboctave.
cheers
--
RNDr. Jaroslav Hajek
computing expert & GNU Octave developer
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz
More information about the Octave-maintainers
mailing list