[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Accessing ComplexMatrix values from octave_value_list
From: |
remigio |
Subject: |
Re: Accessing ComplexMatrix values from octave_value_list |
Date: |
Thu, 11 Jan 2018 02:59:25 -0700 (MST) |
Hello Andy,
I tryed your suggestion and it didn't work, I made a minimum working example
to help understand the problem :
///////////////////////////////////////////////////////////////////////////////////
#include <octave/oct.h>
#include <octave/octave.h>
#include <cmath>
DEFUN_DLD (function1, args, nargout,"function1")
{
ComplexMatrix psi_int(2, 3);
octave_value_list retval;
retval(0) = octave_value(psi_int);
return octave_value (retval);
}
///////////////////////////////////////////////////////////////////////////////////
#include <octave/oct.h>
#include <octave/octave.h>
#include <octave/parse.h>
#include <cmath>
DEFUN_DLD (function2, args, nargout, "function2")
{
octave_value_list out = feval("function1");
ComplexMatrix psi_int = out(0).complex_matrix_value();
octave_value_list retval;
retval(0) = octave_value(psi_int);
return octave_value (retval);
}
function1 executed in octave works fine and return a 2x3 zero matrix as
expected but function2 which calls function1 and should return the same show
the error message:
error: octave_base_value::complex_matrix_value(): wrong type argument
'cs-list'
I would be gratefull to anyone who can make clear what is wrong with this
code,
RĂ©mi
--
Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html