Added a octave test for the concatenation operator.
Swig types can be used by the operators [a,b] or [a;b] if an octave overload functions horzcat.m or vertcat.m are added in a @swig_ref subdirectory. This requires that is_object() (isobject() for octave >= 4.4) returns true for swig types which is ensured by the swig octave runtime.
This commit is contained in:
parent
f0bb77221a
commit
7271ea805a
2 changed files with 10 additions and 0 deletions
6
Examples/octave/operator/@swig_ref/horzcat.m
Normal file
6
Examples/octave/operator/@swig_ref/horzcat.m
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
% test octaves concatenation operator
|
||||
function ret=horzcat(a, b)
|
||||
% return the concatenation of two ComplexVal values as a cell array.
|
||||
% (not really useful but it tests the concatenation of swig_ref objects)
|
||||
ret={a, b};
|
||||
end
|
||||
|
|
@ -42,3 +42,7 @@ if swig_octave_prereq(3,8,0)
|
|||
printf("conj(a) = %s\n", disp(conj(a)));
|
||||
printf("exp(a) = %s\n", disp(exp(a)));
|
||||
endif
|
||||
|
||||
# concatenation operator
|
||||
g = [a, b, c];
|
||||
printf("g = %s\n",disp(g));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue