octave-maintainers
[Top][All Lists]
Advanced

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

Re: Status for sparse matrix support


From: Andy Adler
Subject: Re: Status for sparse matrix support
Date: Wed, 21 May 2003 14:24:48 -0400 (EDT)

On 21 May 2003, Nicolas Guilbert wrote:
> I was wondering how the progress is going concerning the sparse matrix
> functionality. Specifically, it would be useful (for me) to be able to
> concatenate sparse matrices easily (S3 = [S1,S2]) and change the content
> (for instance a = sparse(eye(10)), a(1,2)=3) whithout the matrices
> becoming full. Does anyone have plans for this (in particular Andy
> Adler, I suppose)? Or does anyone know what the caveats are in doing it?

I would like to do this, but, as far as I know, there is
no easy way to "overload" the matrix concatenation operators
for new types in octave.

However, I've just added the functions sphcat and spvcat to
octave-forge to allow this:

octave:2> x1=sparse(ones(3,2)); x2= sparse(diag(1:3));
octave:3> full(   sphcat(  x1, x2, x2, x1) )
ans =

  1  1  1  0  0  1  0  0  1  1
  1  1  0  2  0  0  2  0  1  1
  1  1  0  0  3  0  0  3  1  1

PS. If someone could show me show to overload the concatenation ops,
I'll implement this properly.

Andy





reply via email to

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