[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Dynamic extensions: from octave_value to *double and vice versa
From: |
Muthu |
Subject: |
Re: Dynamic extensions: from octave_value to *double and vice versa |
Date: |
Tue, 18 Jan 2005 04:08:14 -0800 (PST) |
HI Nicolo!
What you say is very easily possible.
Please read the docs at http://wiki.octave.org
and the CoDa documents. Checkout the 'info octave'
and its section on dynamic extensions.
For your case just do this:
DEFUN_DLD(matrix_xyz,args,,"no comments")
{
Octave_Matrix x;
x=args(0).matrix_value();
//make changes.
x(1,1)=200-x.getElem(1,1);
return octave_value(x);
}
Please lookinto the header file ov.h and use the
member functions like
octave_value v;
v.string_value()
v.integer_value();
v.ulong_value();
v.scalar_value()
etc.
Actually you will know that octave_value is a
polymorphic base type that supports all the various
operations in it.
Cheers
Muthu.
__________________________________
Do you Yahoo!?
The all-new My Yahoo! - What will yours do?
http://my.yahoo.com
-------------------------------------------------------------
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
-------------------------------------------------------------