[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: new types and INSTALL_BINOP
From: |
Francesco Potorti` |
Subject: |
Re: new types and INSTALL_BINOP |
Date: |
Fri, 02 Mar 2001 13:01:32 +0100 |
| I have conversion methods for this, eg:
| Matrix octave_sparse::matrix_value (bool = false) const {
| Matrix M= oct_sparse_to_full( X );
| return M;
| }
(I'd write the body of this function as just
return oct_sparse_to_full (X);
since there is no need to have the declaration/initialization
statement here.)
Maybe I am completely wrong, but why not simply using a conversion
operator? Sorry if the syntax is incorrect, I have not used this for a
long time:
octave_sparse::operator Matrix() { return oct_sparse_to_full(this); }
-------------------------------------------------------------
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
-------------------------------------------------------------