help-octave
[Top][All Lists]
Advanced

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

new types and INSTALL_BINOP


From: adler
Subject: new types and INSTALL_BINOP
Date: Wed, 28 Feb 2001 20:44:09 -0500 (EST)

I'm working on adding complex sparse matrix
support to my octave sparse matrix library.
(http://cvs.sourceforge.net/
   cgi-bin/cvsweb.cgi/octave/dld/sparse/?cvsroot=octave)

It's going fairly well, except I seem to be 
required to add an enourmous amount of binary
operators for each type combination

for example, for addition, I need to define
the following BINOPS for each operator.
For example, for (op_add, ie + ) we have:

octave_sparse + octave_scalar
octave_sparse + octave_complex
octave_sparse + octave_matrix
octave_sparse + octave_complex_matrix
octave_sparse + octave_sparse
octave_sparse + octave_complex_sparse

octave_complex_sparse + octave_scalar
octave_complex_sparse + octave_complex
octave_complex_sparse + octave_matrix
octave_complex_sparse + octave_complex_matrix
octave_complex_sparse + octave_sparse
octave_complex_sparse + octave_complex_sparse

as well as the opposite order
ie, octave_scalar + octave_sparse

This turns into an enormous amount of code.
Is there some way to simplify this.

For example, could I define
   octave_sparse + octave_complex
and then let octave convert scalars into
complex so that I don't need to define
   octave_sparse + octave_scalar

Thanks,
_______________________________________
Andy Adler,                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]