[Top][All Lists]

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

Re: Sparse functions for octave

From: A+A Adler
Subject: Re: Sparse functions for octave
Date: Mon, 15 Nov 1999 20:26:58 -0500 (EST)

On Sat, 13 Nov 1999, John W. Eaton wrote:
> | Now, I need to add indexing to sparse matrices, to that you can
> | do:
> | x(1:2,1:2) for sparse x.
> 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

Unfortunately, I don't seem to be able to get this to work.
For example, I added the following code to the public 
   methods of 

      octave_value do_index_op (const octave_value_list& idx) {
        if (idx.length() == 1)
          return (double) scalar;
          error("idx !=1");

But I still get the following error
   octave-2.1.19:1> x=make_int(1);
   installing integer type at type-id = 18
   octave-2.1.19:2> x(1)
   error: can't perform indexing operations for integer type

Andy Adler,                               address@hidden

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]