[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to use "do_colon_op" in an oct-file?
From: |
Lukas Reichlin |
Subject: |
Re: How to use "do_colon_op" in an oct-file? |
Date: |
Thu, 15 Oct 2015 17:29:30 +0200 |
On 15.10.2015, at 17:06, "John W. Eaton" <address@hidden> wrote:
> On 10/15/2015 10:55 AM, Lukas Reichlin wrote:
>> Dear Octave Community
>>
>> I'm writing an oct-file [1] for the control package where I want to use the
>> colon operator:
>>
>> octave_value mat_idx = do_colon_op (1, idx);
>>
>> However, I get the following compiler error:
>>
>> __lti_input_idx__.cc:50:28: error: use of undeclared identifier 'do_colon_op'
>> octave_value mat_idx = do_colon_op (1, idx);
>> ^
>>
>> How can I fix this error? Thanks in advance for every help!
>
> What are you trying to do?
>
> jwe
>
>
I'm trying to substitute the following function with C++ using DEFUN_DLD:
function [mat_idx, opt_idx] = __lti_input_idx__ (varargin)
str_idx = find (cellfun (@ischar, varargin));
if (isempty (str_idx))
mat_idx = 1 : nargin;
opt_idx = [];
else
mat_idx = 1 : str_idx(1)-1;
opt_idx = str_idx(1) : nargin;
endif
endfunction
In the file libinterp/corefcn/data.cc, I found the expression
retval = do_colon_op (args(0), args(1));
on line 6322 (inside definition of DEFUN (colon, args, …) on lines 6305-6335)
and tried to use it in my C++ code.
Lukas