[英]Octave value list datatype
I'm using Octave in cpp code. 我在cpp代码中使用Octave。 I call Octave functions using feval.
我使用feval调用Octave函数。 The code is-
该代码是-
octave_value_list out = feval (pstData[0], in, 1);
Which function do I have to use to determine the data type and size of each element in the list out
? 这功能我必须用它来确定在列表中的数据类型,每个元素的大小
out
? I have to check if the element is scalar/2D matrix/hypermatrix, the data type- complex/real/int/float/double/bool/string and the size of the matrix. 我必须检查元素是否为标量/ 2D矩阵/超矩阵,数据类型为complex / real / int / float / double / bool / string和矩阵大小。
From the doc of octave_value_list
, I'd say you can access its elements through the operator()
. 从
octave_value_list
的文档中,我可以说您可以通过operator()
访问其元素。 This way, you will get an octave_value
, a type that offers all the functions you need , like is_float_type()
, is_double_type()
, etc.. 这样,您将获得
octave_value
,该类型提供所需的所有功能 ,例如is_float_type()
, is_double_type()
等。
Example (not tested) 示例(未经测试)
octave_value& v = out(2); // access the value with id 2
bool is_double = v.is_double_type; // check wether out(2) is a double
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.