[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Using external C++ functions from Octave
From: |
Tamara Bechtold |
Subject: |
Using external C++ functions from Octave |
Date: |
Tue, 02 Sep 2008 16:57:57 +0200 |
User-agent: |
Thunderbird 2.0.0.14 (Windows/20080421) |
Dear all,
I am trying to read in aggument in Octave and pass them to a C++
function to be compiled. I want to read-in a single argument which can
be either double or int, say the user gives 1 or 1.0. Within the c++
function I am trying to check what kind of argument was passed by the
user with following code:
int m;
double n;
if (args(3).is_scalar_type())
m = args(3).int_value();
if (args(3).is_double_type())
n= args(3).double_value();
But it does not work. In other word when I pass 10.0 both variables, m
and n are initialized with 10! I want only n to get the value 10.0. How
can this be done? Can enybody help?
Many thanks in advance.
Tamara
- Using external C++ functions from Octave,
Tamara Bechtold <=