help-octave
[Top][All Lists]
Advanced

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

indexing operations in 2.1.39


From: Andy Adler
Subject: indexing operations in 2.1.39
Date: Mon, 4 Nov 2002 21:41:19 -0500 (EST)

I'm having trouble with my sparse code with
octave-2.1.39.

The code compiles, but Indexing operations give:

address@hidden /usr/src/octave-forge/main/sparse
$ /usr/local/oct-2.1.39test/bin/octave-2.1.39.exe -q
octave-2.1.39:1> s=sparse(eye(2));
octave-2.1.39:2> s(:)
error: can't perform indexing operations for sparse type

I have dug around, and found that indexing operations
no longer call "do_multi_index_op", but now call
the method "subsref"

I have got sparse to work correctly by adding the method:

octave_value_list
octave_sparse::subsref (const std::string type,
                        const SLList<octave_value_list>& idx,
                        int nargout)
{ return do_multi_index_op( nargout, idx.front()); }

$ /usr/src/octave-2.1.39/src/octave.exe -q
octave:1> s=sparse(eye(2));
octave:2> s(:)'
ans =
  1  0  0  1


MY QUESTION IS:
Is this the correct use of subsref?
Is this the right way to do this?
There is no documentation on subsref (that I could find)
so I'm not sure what it's supposed to do.

Thanks

Andy
--
Andy Adler,
Assistant Professor, School of Information Technology and Engineering,
University of Ottawa, Tel:1(613)562-5800 X 2345, Email:address@hidden




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

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

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