[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Sparse functions for octave
From: 
John W. Eaton 
Subject: 
Re: Sparse functions for octave 
Date: 
Sat, 13 Nov 1999 21:37:37 0600 (CST) 
On 13Nov1999, A+A Adler <address@hidden> wrote:
 On Fri, 29 Oct 1999, John W. Eaton wrote:
 > I'd rather say it was just an incomplete example.
 > You can get the other operators if you add the following code:
 > [ code snipped ]

 Great, thanks. I've got UNOPS working and also have
 full( sparse_matrix ) working using the get_rep member
 function in 2.1.19.

 Now, I need to add indexing to sparse matrices, to that you can
 do:

 x(1:2,1:2) for sparse x.

 I've defined member functions:

 octave_value octave_sparse::index (idx_vector colv, idx_vector rowv ) ;

 and

 octave_value octave_sparse::extract (int r1, int c1, int r2, int c2) ;

 but this doesn't seem to work.

 octave2.1.19:3> x=make_sparse(eye(5));
 installing sparse type at typeid = 18
 DEBUG:sparse( SuperMatrix A)
 DEBUG:sparse destructor
 octave2.1.19:4> x(1:2,1:2)
 error: can't perform indexing operations for sparse type

 What is the right way to do this?
You need to define a function called do_index_op() with the following
signature:
octave_value do_index_op (const octave_value_list& idx)
For example, look at ovbasemat.cc.
jwe

Octave is freely available under the terms of the GNU GPL.
Octave's home on the web: http://www.che.wisc.edu/octave/octave.html
How to fund new projects: http://www.che.wisc.edu/octave/funding.html
Subscription information: http://www.che.wisc.edu/octave/archive.html

 Re: Sparse functions for octave, A+A Adler, 1999/11/13
 Re: Sparse functions for octave,
John W. Eaton <=
 Re: Sparse functions for octave, A+A Adler, 1999/11/15
 Re: Sparse functions for octave, John W. Eaton, 1999/11/15
 Re: Sparse functions for octave, A+A Adler, 1999/11/16
 Re: Sparse functions for octave, John W. Eaton, 1999/11/16
 Re: Sparse functions for octave, A+A Adler, 1999/11/26
 Re: Sparse functions for octave, Mike Miller, 1999/11/27
 Re: Sparse functions for octave, John W. Eaton, 1999/11/28