[Top][All Lists]

[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 13-Nov-1999, 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.
| octave-2.1.19:3> x=make_sparse(eye(5));
|    installing sparse type at type-id = 18
|    DEBUG:sparse( SuperMatrix A)
|    DEBUG:sparse destructor
| octave-2.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

  octave_value do_index_op (const octave_value_list& idx)

For example, look at


Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:
How to fund new projects:
Subscription information:

reply via email to

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