Mercurial > octave
annotate libinterp/operators/ops.h @ 20791:f7084eae3318
maint: Use Octave coding conventions for #if statements.
* mk-opts.pl, dialog.h, find-files-dialog.h, find-files-model.h,
file-editor-tab.h, octave-qscintilla.h, octave-txt-lexer.h, main-window.h,
octave-cmd.h, octave-dock-widget.h, octave-gui.h, thread-manager.h,
workspace-model.h, workspace-view.h, builtins.h, Cell.h, bitfcns.cc,
c-file-ptr-stream.h, cdisplay.h, comment-list.h, cutils.h, data.h, debug.h,
defaults.in.h, defun-dld.h, defun-int.h, defun.h, dirfns.h, display.h,
dynamic-ld.h, error.h, event-queue.h, file-io.h, filter.cc, getrusage.cc,
gl-render.h, gl2ps-renderer.h, graphics.in.h, gripes.h, help.h, hook-fcn.h,
input.h, jit-ir.h, jit-typeinfo.h, jit-util.h, load-path.h, load-save.h,
ls-ascii-helper.h, ls-hdf5.h, ls-mat-ascii.h, ls-mat4.h, ls-mat5.h,
ls-oct-binary.h, ls-oct-text.h, ls-utils.h, oct-errno.h, oct-fstrm.h,
oct-handle.h, oct-hdf5-types.h, oct-hdf5.h, oct-hist.h, oct-iostrm.h,
oct-lvalue.h, oct-map.h, oct-obj.h, oct-prcstrm.h, oct-procbuf.h,
oct-stdstrm.h, oct-stream.h, oct-strstrm.h, oct.h, octave-link.h, pager.h,
pr-output.h, procstream.h, profiler.h, pt-jit.h, sighandlers.cc, sighandlers.h,
siglist.h, sparse-xdiv.h, sparse-xpow.h, symtab.h, syscalls.cc, sysdep.h,
toplev.cc, toplev.h, utils.h, variables.h, workspace-element.h, xdiv.h,
xnorm.h, xpow.h, dmperm.cc, oct-qhull.h, mkbuiltins, oct-conf.in.h,
ov-base-diag.h, ov-base-int.h, ov-base-mat.h, ov-base-scalar.h,
ov-base-sparse.h, ov-base.h, ov-bool-mat.h, ov-bool-sparse.h, ov-bool.h,
ov-builtin.h, ov-cell.h, ov-ch-mat.h, ov-class.h, ov-classdef.h, ov-colon.h,
ov-complex.h, ov-cs-list.h, ov-cx-diag.h, ov-cx-mat.h, ov-cx-sparse.h,
ov-dld-fcn.h, ov-fcn-handle.h, ov-fcn-inline.h, ov-fcn.h, ov-float.h,
ov-flt-complex.h, ov-flt-cx-diag.h, ov-flt-cx-mat.h, ov-flt-re-diag.h,
ov-flt-re-mat.h, ov-int-traits.h, ov-int16.h, ov-int32.h, ov-int64.h,
ov-int8.h, ov-java.h, ov-lazy-idx.h, ov-mex-fcn.h, ov-null-mat.h, ov-perm.h,
ov-range.h, ov-re-diag.h, ov-re-mat.h, ov-re-sparse.h, ov-scalar.h,
ov-str-mat.h, ov-struct.h, ov-type-conv.h, ov-typeinfo.h, ov-uint16.h,
ov-uint32.h, ov-uint64.h, ov-uint8.h, ov-usr-fcn.h, ov.h, octave.h, ops.h,
options-usage.h, lex.h, parse.h, pt-all.h, pt-arg-list.h, pt-array-list.h,
pt-assign.h, pt-binop.h, pt-bp.h, pt-cbinop.h, pt-cell.h, pt-check.h,
pt-classdef.h, pt-cmd.h, pt-colon.h, pt-const.h, pt-decl.h, pt-eval.h,
pt-except.h, pt-exp.h, pt-fcn-handle.h, pt-funcall.h, pt-id.h, pt-idx.h,
pt-jump.h, pt-loop.h, pt-mat.h, pt-misc.h, pt-pr-code.h, pt-select.h,
pt-stmt.h, pt-unop.h, pt-walk.h, pt.h, token.h, version.in.h, Array-util.h,
Array.h, CColVector.h, CDiagMatrix.h, CMatrix.h, CNDArray.h, CRowVector.h,
CSparse.h, DiagArray2.h, MArray-decl.h, MArray-defs.h, MArray.h, MDiagArray2.h,
MSparse.h, Matrix.h, MatrixType.h, PermMatrix.h, Range.h, Sparse.h,
boolMatrix.h, boolNDArray.h, boolSparse.h, chMatrix.h, chNDArray.h,
dColVector.h, dDiagMatrix.h, dMatrix.h, dNDArray.h, dRowVector.h, dSparse.h,
dim-vector.h, fCColVector.h, fCDiagMatrix.h, fCMatrix.h, fCNDArray.h,
fCRowVector.h, fColVector.h, fDiagMatrix.h, fMatrix.h, fNDArray.h,
fRowVector.h, idx-vector.h, int16NDArray.h, int32NDArray.h, int64NDArray.h,
int8NDArray.h, intNDArray.h, uint16NDArray.h, uint32NDArray.h, uint64NDArray.h,
uint8NDArray.h, f77-fcn.h, lo-error.h, quit.h, CmplxAEPBAL.h, CmplxCHOL.h,
CmplxGEPBAL.h, CmplxHESS.h, CmplxLU.h, CmplxQR.h, CmplxQRP.h, CmplxSCHUR.h,
CmplxSVD.h, CollocWt.h, DAE.h, DAEFunc.h, DAERT.h, DAERTFunc.h, DASPK.h,
DASRT.h, DASSL.h, DET.h, EIG.h, LSODE.h, ODE.h, ODEFunc.h, ODES.h, ODESFunc.h,
Quad.h, SparseCmplxCHOL.h, SparseCmplxLU.h, SparseCmplxQR.cc, SparseCmplxQR.h,
SparseQR.h, SparsedbleCHOL.h, SparsedbleLU.h, base-aepbal.h, base-dae.h,
base-de.h, base-lu.h, base-min.h, base-qr.h, bsxfun-decl.h, bsxfun-defs.cc,
bsxfun.h, dbleAEPBAL.h, dbleCHOL.h, dbleGEPBAL.h, dbleHESS.h, dbleLU.h,
dbleQR.h, dbleQRP.h, dbleSCHUR.h, dbleSVD.h, eigs-base.cc, fCmplxAEPBAL.h,
fCmplxCHOL.h, fCmplxGEPBAL.h, fCmplxHESS.h, fCmplxLU.h, fCmplxQR.h,
fCmplxQRP.h, fCmplxSCHUR.h, fCmplxSVD.h, fEIG.h, floatAEPBAL.h, floatCHOL.h,
floatGEPBAL.h, floatHESS.h, floatLU.h, floatQR.h, floatQRP.h, floatSCHUR.h,
floatSVD.h, lo-mappers.cc, lo-mappers.h, lo-specfun.cc, lo-specfun.h,
oct-convn.h, oct-fftw.h, oct-norm.h, oct-rand.h, oct-spparms.h, randmtzig.c,
sparse-base-chol.h, sparse-base-lu.h, sparse-dmsolve.cc, Sparse-diag-op-defs.h,
Sparse-op-decls.h, Sparse-op-defs.h, Sparse-perm-op-defs.h, mk-ops.awk,
mx-base.h, mx-defs.h, mx-ext.h, mx-inlines.cc, mx-op-decl.h, mx-op-defs.h,
sparse-mk-ops.awk, dir-ops.h, file-ops.h, file-stat.h, lo-sysdep.h,
mach-info.h, oct-env.h, oct-group.h, oct-openmp.h, oct-passwd.h,
oct-syscalls.h, oct-time.cc, oct-time.h, oct-uname.h, pathlen.h, sysdir.h,
syswait.h, action-container.h, base-list.h, byte-swap.h, caseless-str.h,
cmd-edit.h, cmd-hist.h, data-conv.h, functor.h, glob-match.h, kpse.cc,
lo-array-gripes.h, lo-cutils.h, lo-ieee.h, lo-macros.h, lo-math.h, lo-regexp.h,
lo-traits.h, lo-utils.h, oct-alloc.h, oct-base64.h, oct-binmap.h, oct-cmplx.h,
oct-glob.h, oct-inttypes.h, oct-locbuf.h, oct-mutex.h, oct-refcount.h,
oct-rl-edit.h, oct-rl-hist.h, oct-shlib.h, oct-sort.h, oct-sparse.h,
pathsearch.h, singleton-cleanup.h, sparse-sort.h, sparse-util.h, statdefs.h,
str-vec.h, sun-utils.h, unwind-prot.h, url-transfer.h:
Use Octave coding conventions for #if statements.
author | Rik <rik@octave.org> |
---|---|
date | Thu, 03 Dec 2015 10:23:38 -0800 |
parents | 4197fc428c7d |
children | 6176560b03d9 |
rev | line source |
---|---|
2376 | 1 /* |
2 | |
19697
4197fc428c7d
maint: Update copyright notices for 2015.
John W. Eaton <jwe@octave.org>
parents:
17787
diff
changeset
|
3 Copyright (C) 1996-2015 John W. Eaton |
9601
a9b37bae1802
add a couple of missing copyright statements
Jaroslav Hajek <highegg@gmail.com>
parents:
9588
diff
changeset
|
4 Copyright (C) 2009 VZLU Prague, a.s. |
2376 | 5 |
6 This file is part of Octave. | |
7 | |
8 Octave is free software; you can redistribute it and/or modify it | |
9 under the terms of the GNU General Public License as published by the | |
7016 | 10 Free Software Foundation; either version 3 of the License, or (at your |
11 option) any later version. | |
2376 | 12 |
13 Octave is distributed in the hope that it will be useful, but WITHOUT | |
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
16 for more details. | |
17 | |
18 You should have received a copy of the GNU General Public License | |
7016 | 19 along with Octave; see the file COPYING. If not, see |
20 <http://www.gnu.org/licenses/>. | |
2376 | 21 |
22 */ | |
23 | |
20791
f7084eae3318
maint: Use Octave coding conventions for #if statements.
Rik <rik@octave.org>
parents:
19697
diff
changeset
|
24 #if ! defined (octave_ops_h) |
2376 | 25 #define octave_ops_h 1 |
26 | |
4669 | 27 #include "Array-util.h" |
28 | |
8366
8b1a2555c4e2
implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
29 // Concatenation macros that enforce argument prescan |
8b1a2555c4e2
implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
30 #define CONCAT2X(x,y) x ## y |
8b1a2555c4e2
implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
31 #define CONCAT2(x,y) CONCAT2X(x,y) |
8b1a2555c4e2
implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
32 |
8b1a2555c4e2
implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
33 #define CONCAT3X(x,y,z) x ## y ## z |
8b1a2555c4e2
implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
34 #define CONCAT3(x,y,z) CONCAT3X(x,y,z) |
8b1a2555c4e2
implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
35 |
2376 | 36 extern void install_ops (void); |
37 | |
3203 | 38 #define INSTALL_UNOP(op, t, f) \ |
39 octave_value_typeinfo::register_unary_op \ | |
8366
8b1a2555c4e2
implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
40 (octave_value::op, t::static_type_id (), CONCAT2(oct_unop_, f)); |
3203 | 41 |
42 #define INSTALL_NCUNOP(op, t, f) \ | |
43 octave_value_typeinfo::register_non_const_unary_op \ | |
8366
8b1a2555c4e2
implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
44 (octave_value::op, t::static_type_id (), CONCAT2(oct_unop_, f)); |
3203 | 45 |
2376 | 46 #define INSTALL_BINOP(op, t1, t2, f) \ |
47 octave_value_typeinfo::register_binary_op \ | |
3203 | 48 (octave_value::op, t1::static_type_id (), t2::static_type_id (), \ |
8366
8b1a2555c4e2
implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
49 CONCAT2(oct_binop_, f)); |
2376 | 50 |
4915 | 51 #define INSTALL_CATOP(t1, t2, f) \ |
52 octave_value_typeinfo::register_cat_op \ | |
8366
8b1a2555c4e2
implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
53 (t1::static_type_id (), t2::static_type_id (), CONCAT2(oct_catop_, f)); |
4915 | 54 |
2879 | 55 #define INSTALL_ASSIGNOP(op, t1, t2, f) \ |
2376 | 56 octave_value_typeinfo::register_assign_op \ |
3203 | 57 (octave_value::op, t1::static_type_id (), t2::static_type_id (), \ |
8366
8b1a2555c4e2
implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
58 CONCAT2(oct_assignop_, f)); |
2376 | 59 |
3195 | 60 #define INSTALL_ASSIGNANYOP(op, t1, f) \ |
61 octave_value_typeinfo::register_assignany_op \ | |
8366
8b1a2555c4e2
implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
62 (octave_value::op, t1::static_type_id (), CONCAT2(oct_assignop_, f)); |
3195 | 63 |
2376 | 64 #define INSTALL_ASSIGNCONV(t1, t2, tr) \ |
65 octave_value_typeinfo::register_pref_assign_conv \ | |
66 (t1::static_type_id (), t2::static_type_id (), tr::static_type_id ()); | |
67 | |
4901 | 68 #define INSTALL_CONVOP(t1, t2, f) \ |
69 octave_value_typeinfo::register_type_conv_op \ | |
8366
8b1a2555c4e2
implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
70 (t1::static_type_id (), t2::static_type_id (), CONCAT2(oct_conv_, f)); |
4901 | 71 |
2376 | 72 #define INSTALL_WIDENOP(t1, t2, f) \ |
73 octave_value_typeinfo::register_widening_op \ | |
8366
8b1a2555c4e2
implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
74 (t1::static_type_id (), t2::static_type_id (), CONCAT2(oct_conv_, f)); |
2376 | 75 |
3203 | 76 #define CAST_UNOP_ARG(t) \ |
5760 | 77 t v = dynamic_cast<t> (a) |
3203 | 78 |
2376 | 79 #define CAST_BINOP_ARGS(t1, t2) \ |
10313 | 80 t1 v1 = dynamic_cast<t1> (a1); \ |
5760 | 81 t2 v2 = dynamic_cast<t2> (a2) |
2376 | 82 |
83 #define CAST_CONV_ARG(t) \ | |
5760 | 84 t v = dynamic_cast<t> (a) |
2376 | 85 |
2914 | 86 #define ASSIGNOPDECL(name) \ |
87 static octave_value \ | |
8366
8b1a2555c4e2
implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
88 CONCAT2(oct_assignop_, name) (octave_base_value& a1, \ |
10313 | 89 const octave_value_list& idx, \ |
90 const octave_base_value& a2) | |
5759 | 91 |
8150
283989f2da9b
make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
7997
diff
changeset
|
92 #define NULLASSIGNOPDECL(name) \ |
283989f2da9b
make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
7997
diff
changeset
|
93 static octave_value \ |
8366
8b1a2555c4e2
implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
94 CONCAT2(oct_assignop_, name) (octave_base_value& a, \ |
10313 | 95 const octave_value_list& idx, \ |
96 const octave_base_value&) | |
8150
283989f2da9b
make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
7997
diff
changeset
|
97 |
5759 | 98 #define ASSIGNANYOPDECL(name) \ |
99 static octave_value \ | |
8366
8b1a2555c4e2
implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
100 CONCAT2(oct_assignop_, name) (octave_base_value& a1, \ |
10313 | 101 const octave_value_list& idx, \ |
102 const octave_value& a2) | |
2914 | 103 |
104 #define DEFASSIGNOP(name, t1, t2) \ | |
105 ASSIGNOPDECL (name) | |
106 | |
107 #define DEFASSIGNOP_FN(name, t1, t2, f) \ | |
108 ASSIGNOPDECL (name) \ | |
109 { \ | |
8366
8b1a2555c4e2
implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
110 CAST_BINOP_ARGS (CONCAT2(octave_, t1)&, const CONCAT2(octave_, t2)&); \ |
2914 | 111 \ |
8366
8b1a2555c4e2
implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
112 v1.f (idx, v2.CONCAT2(t1, _value) ()); \ |
2914 | 113 return octave_value (); \ |
114 } | |
115 | |
8150
283989f2da9b
make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
7997
diff
changeset
|
116 #define DEFNULLASSIGNOP_FN(name, t, f) \ |
283989f2da9b
make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
7997
diff
changeset
|
117 NULLASSIGNOPDECL (name) \ |
283989f2da9b
make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
7997
diff
changeset
|
118 { \ |
8366
8b1a2555c4e2
implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
119 CAST_UNOP_ARG (CONCAT2(octave_, t)&); \ |
8150
283989f2da9b
make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
7997
diff
changeset
|
120 \ |
283989f2da9b
make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
7997
diff
changeset
|
121 v.f (idx); \ |
283989f2da9b
make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
7997
diff
changeset
|
122 return octave_value (); \ |
283989f2da9b
make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
7997
diff
changeset
|
123 } |
283989f2da9b
make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
7997
diff
changeset
|
124 |
4686 | 125 #define DEFNDASSIGNOP_FN(name, t1, t2, e, f) \ |
126 ASSIGNOPDECL (name) \ | |
127 { \ | |
8366
8b1a2555c4e2
implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
128 CAST_BINOP_ARGS (CONCAT2(octave_, t1)&, const CONCAT2(octave_, t2)&); \ |
4686 | 129 \ |
8366
8b1a2555c4e2
implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
130 v1.f (idx, v2.CONCAT2(e, _value) ()); \ |
4686 | 131 return octave_value (); \ |
132 } | |
133 | |
9548
e5f7aee2ab8c
optimize &=, |= operators
Jaroslav Hajek <highegg@gmail.com>
parents:
9546
diff
changeset
|
134 // FIXME: the following currently don't handle index. |
9546
1beb23d2b892
optimize op= in common cases
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
135 #define DEFNDASSIGNOP_OP(name, t1, t2, f, op) \ |
1beb23d2b892
optimize op= in common cases
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
136 ASSIGNOPDECL (name) \ |
1beb23d2b892
optimize op= in common cases
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
137 { \ |
1beb23d2b892
optimize op= in common cases
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
138 CAST_BINOP_ARGS (CONCAT2(octave_, t1)&, const CONCAT2(octave_, t2)&); \ |
1beb23d2b892
optimize op= in common cases
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
139 \ |
1beb23d2b892
optimize op= in common cases
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
140 assert (idx.empty ()); \ |
1beb23d2b892
optimize op= in common cases
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
141 v1.matrix_ref () op v2.CONCAT2(f, _value) (); \ |
1beb23d2b892
optimize op= in common cases
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
142 \ |
1beb23d2b892
optimize op= in common cases
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
143 return octave_value (); \ |
1beb23d2b892
optimize op= in common cases
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
144 } |
1beb23d2b892
optimize op= in common cases
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
145 |
9548
e5f7aee2ab8c
optimize &=, |= operators
Jaroslav Hajek <highegg@gmail.com>
parents:
9546
diff
changeset
|
146 #define DEFNDASSIGNOP_FNOP(name, t1, t2, f, fnop) \ |
e5f7aee2ab8c
optimize &=, |= operators
Jaroslav Hajek <highegg@gmail.com>
parents:
9546
diff
changeset
|
147 ASSIGNOPDECL (name) \ |
e5f7aee2ab8c
optimize &=, |= operators
Jaroslav Hajek <highegg@gmail.com>
parents:
9546
diff
changeset
|
148 { \ |
e5f7aee2ab8c
optimize &=, |= operators
Jaroslav Hajek <highegg@gmail.com>
parents:
9546
diff
changeset
|
149 CAST_BINOP_ARGS (CONCAT2(octave_, t1)&, const CONCAT2(octave_, t2)&); \ |
e5f7aee2ab8c
optimize &=, |= operators
Jaroslav Hajek <highegg@gmail.com>
parents:
9546
diff
changeset
|
150 \ |
e5f7aee2ab8c
optimize &=, |= operators
Jaroslav Hajek <highegg@gmail.com>
parents:
9546
diff
changeset
|
151 assert (idx.empty ()); \ |
e5f7aee2ab8c
optimize &=, |= operators
Jaroslav Hajek <highegg@gmail.com>
parents:
9546
diff
changeset
|
152 fnop (v1.matrix_ref (), v2.CONCAT2(f, _value) ()); \ |
e5f7aee2ab8c
optimize &=, |= operators
Jaroslav Hajek <highegg@gmail.com>
parents:
9546
diff
changeset
|
153 \ |
e5f7aee2ab8c
optimize &=, |= operators
Jaroslav Hajek <highegg@gmail.com>
parents:
9546
diff
changeset
|
154 return octave_value (); \ |
e5f7aee2ab8c
optimize &=, |= operators
Jaroslav Hajek <highegg@gmail.com>
parents:
9546
diff
changeset
|
155 } |
e5f7aee2ab8c
optimize &=, |= operators
Jaroslav Hajek <highegg@gmail.com>
parents:
9546
diff
changeset
|
156 |
3195 | 157 #define DEFASSIGNANYOP_FN(name, t1, f) \ |
5759 | 158 ASSIGNANYOPDECL (name) \ |
3195 | 159 { \ |
8366
8b1a2555c4e2
implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
160 CONCAT2(octave_, t1)& v1 = dynamic_cast<CONCAT2(octave_, t1)&> (a1); \ |
3195 | 161 \ |
162 v1.f (idx, a2); \ | |
163 return octave_value (); \ | |
164 } | |
165 | |
2914 | 166 #define CONVDECL(name) \ |
5759 | 167 static octave_base_value * \ |
8366
8b1a2555c4e2
implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
168 CONCAT2(oct_conv_, name) (const octave_base_value& a) |
3203 | 169 |
170 #define CONVDECLX(name) \ | |
5759 | 171 static octave_base_value * \ |
8366
8b1a2555c4e2
implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
172 CONCAT2(oct_conv_, name) (const octave_base_value&) |
2914 | 173 |
4901 | 174 #define DEFCONV(name, a_dummy, b_dummy) \ |
2914 | 175 CONVDECL (name) |
176 | |
4901 | 177 #define DEFCONVFNX(name, tfrom, ovtto, tto, e) \ |
178 CONVDECL (name) \ | |
179 { \ | |
8366
8b1a2555c4e2
implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
180 CAST_CONV_ARG (const CONCAT2(octave_, tfrom)&); \ |
4901 | 181 \ |
8366
8b1a2555c4e2
implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
182 return new CONCAT2(octave_, ovtto) (CONCAT2(tto, NDArray) (v.CONCAT2(e, array_value) ())); \ |
4901 | 183 } |
184 | |
7997
2b8952e133c9
implement checked conversions between integers
Jaroslav Hajek <highegg@gmail.com>
parents:
7922
diff
changeset
|
185 #define DEFCONVFNX2(name, tfrom, ovtto, e) \ |
2b8952e133c9
implement checked conversions between integers
Jaroslav Hajek <highegg@gmail.com>
parents:
7922
diff
changeset
|
186 CONVDECL (name) \ |
2b8952e133c9
implement checked conversions between integers
Jaroslav Hajek <highegg@gmail.com>
parents:
7922
diff
changeset
|
187 { \ |
8366
8b1a2555c4e2
implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
188 CAST_CONV_ARG (const CONCAT2(octave_, tfrom)&); \ |
7997
2b8952e133c9
implement checked conversions between integers
Jaroslav Hajek <highegg@gmail.com>
parents:
7922
diff
changeset
|
189 \ |
8366
8b1a2555c4e2
implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
190 return new CONCAT2(octave_, ovtto) (v.CONCAT2(e, array_value) ()); \ |
7997
2b8952e133c9
implement checked conversions between integers
Jaroslav Hajek <highegg@gmail.com>
parents:
7922
diff
changeset
|
191 } |
2b8952e133c9
implement checked conversions between integers
Jaroslav Hajek <highegg@gmail.com>
parents:
7922
diff
changeset
|
192 |
4901 | 193 #define DEFDBLCONVFN(name, ovtfrom, e) \ |
194 CONVDECL (name) \ | |
195 { \ | |
8366
8b1a2555c4e2
implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
196 CAST_CONV_ARG (const CONCAT2(octave_, ovtfrom)&); \ |
4901 | 197 \ |
8366
8b1a2555c4e2
implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
198 return new octave_matrix (NDArray (v.CONCAT2(e, _value) ())); \ |
4901 | 199 } |
200 | |
8852 | 201 #define DEFFLTCONVFN(name, ovtfrom, e) \ |
202 CONVDECL (name) \ | |
203 { \ | |
204 CAST_CONV_ARG (const CONCAT2(octave_, ovtfrom)&); \ | |
205 \ | |
206 return new octave_float_matrix (FloatNDArray (v.CONCAT2(e, _value) ())); \ | |
207 } | |
208 | |
5032 | 209 #define DEFSTRINTCONVFN(name, tto) \ |
8366
8b1a2555c4e2
implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
210 DEFCONVFNX(name, char_matrix_str, CONCAT2(tto, _matrix), tto, char_) |
5032 | 211 |
5992 | 212 #define DEFSTRDBLCONVFN(name, tfrom) \ |
213 DEFCONVFNX(name, tfrom, matrix, , char_) | |
5032 | 214 |
8852 | 215 #define DEFSTRFLTCONVFN(name, tfrom) \ |
216 DEFCONVFNX(name, tfrom, float_matrix, Float, char_) | |
217 | |
4901 | 218 #define DEFCONVFN(name, tfrom, tto) \ |
8366
8b1a2555c4e2
implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
219 DEFCONVFNX2 (name, tfrom, CONCAT2(tto, _matrix), CONCAT2(tto, _)) |
4901 | 220 |
221 #define DEFCONVFN2(name, tfrom, sm, tto) \ | |
8366
8b1a2555c4e2
implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
222 DEFCONVFNX2 (name, CONCAT3(tfrom, _, sm), CONCAT2(tto, _matrix), CONCAT2(tto, _)) |
4901 | 223 |
3203 | 224 #define UNOPDECL(name, a) \ |
225 static octave_value \ | |
8366
8b1a2555c4e2
implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
226 CONCAT2(oct_unop_, name) (const octave_base_value& a) |
3203 | 227 |
228 #define DEFUNOPX(name, t) \ | |
229 UNOPDECL (name, , ) | |
230 | |
231 #define DEFUNOP(name, t) \ | |
232 UNOPDECL (name, a) | |
233 | |
234 #define DEFUNOP_OP(name, t, op) \ | |
235 UNOPDECL (name, a) \ | |
236 { \ | |
8366
8b1a2555c4e2
implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
237 CAST_UNOP_ARG (const CONCAT2(octave_, t)&); \ |
8b1a2555c4e2
implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
238 return octave_value (op v.CONCAT2(t, _value) ()); \ |
3203 | 239 } |
240 | |
4550 | 241 #define DEFNDUNOP_OP(name, t, e, op) \ |
4543 | 242 UNOPDECL (name, a) \ |
243 { \ | |
8366
8b1a2555c4e2
implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
244 CAST_UNOP_ARG (const CONCAT2(octave_, t)&); \ |
8b1a2555c4e2
implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
245 return octave_value (op v.CONCAT2(e, _value) ()); \ |
4543 | 246 } |
247 | |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
248 // FIXME: in some cases, the constructor isn't necessary. |
3203 | 249 |
250 #define DEFUNOP_FN(name, t, f) \ | |
251 UNOPDECL (name, a) \ | |
252 { \ | |
8366
8b1a2555c4e2
implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
253 CAST_UNOP_ARG (const CONCAT2(octave_, t)&); \ |
8b1a2555c4e2
implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
254 return octave_value (f (v.CONCAT2(t, _value) ())); \ |
3203 | 255 } |
256 | |
4550 | 257 #define DEFNDUNOP_FN(name, t, e, f) \ |
4543 | 258 UNOPDECL (name, a) \ |
259 { \ | |
8366
8b1a2555c4e2
implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
260 CAST_UNOP_ARG (const CONCAT2(octave_, t)&); \ |
8b1a2555c4e2
implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
261 return octave_value (f (v.CONCAT2(e, _value) ())); \ |
4543 | 262 } |
263 | |
3203 | 264 #define DEFNCUNOP_METHOD(name, t, method) \ |
265 static void \ | |
8366
8b1a2555c4e2
implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
266 CONCAT2(oct_unop_, name) (octave_base_value& a) \ |
3203 | 267 { \ |
8366
8b1a2555c4e2
implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
268 CAST_UNOP_ARG (CONCAT2(octave_, t)&); \ |
3203 | 269 v.method (); \ |
270 } | |
271 | |
2914 | 272 #define BINOPDECL(name, a1, a2) \ |
273 static octave_value \ | |
8366
8b1a2555c4e2
implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
274 CONCAT2(oct_binop_, name) (const octave_base_value& a1, const octave_base_value& a2) |
2914 | 275 |
276 #define DEFBINOPX(name, t1, t2) \ | |
277 BINOPDECL (name, , ) | |
278 | |
279 #define DEFBINOP(name, t1, t2) \ | |
280 BINOPDECL (name, a1, a2) | |
281 | |
282 #define DEFBINOP_OP(name, t1, t2, op) \ | |
283 BINOPDECL (name, a1, a2) \ | |
284 { \ | |
8366
8b1a2555c4e2
implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
285 CAST_BINOP_ARGS (const CONCAT2(octave_, t1)&, const CONCAT2(octave_, t2)&); \ |
2914 | 286 return octave_value \ |
8366
8b1a2555c4e2
implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
287 (v1.CONCAT2(t1, _value) () op v2.CONCAT2(t2, _value) ()); \ |
2914 | 288 } |
289 | |
9588
319e2ab9b8ae
warn about the complex comparison ops
Jaroslav Hajek <highegg@gmail.com>
parents:
9587
diff
changeset
|
290 #define DEFCMPLXCMPOP_OP(name, t1, t2, op) \ |
319e2ab9b8ae
warn about the complex comparison ops
Jaroslav Hajek <highegg@gmail.com>
parents:
9587
diff
changeset
|
291 BINOPDECL (name, a1, a2) \ |
319e2ab9b8ae
warn about the complex comparison ops
Jaroslav Hajek <highegg@gmail.com>
parents:
9587
diff
changeset
|
292 { \ |
319e2ab9b8ae
warn about the complex comparison ops
Jaroslav Hajek <highegg@gmail.com>
parents:
9587
diff
changeset
|
293 CAST_BINOP_ARGS (const CONCAT2(octave_, t1)&, const CONCAT2(octave_, t2)&); \ |
319e2ab9b8ae
warn about the complex comparison ops
Jaroslav Hajek <highegg@gmail.com>
parents:
9587
diff
changeset
|
294 gripe_warn_complex_cmp (); \ |
319e2ab9b8ae
warn about the complex comparison ops
Jaroslav Hajek <highegg@gmail.com>
parents:
9587
diff
changeset
|
295 return octave_value \ |
319e2ab9b8ae
warn about the complex comparison ops
Jaroslav Hajek <highegg@gmail.com>
parents:
9587
diff
changeset
|
296 (v1.CONCAT2(t1, _value) () op v2.CONCAT2(t2, _value) ()); \ |
319e2ab9b8ae
warn about the complex comparison ops
Jaroslav Hajek <highegg@gmail.com>
parents:
9587
diff
changeset
|
297 } |
319e2ab9b8ae
warn about the complex comparison ops
Jaroslav Hajek <highegg@gmail.com>
parents:
9587
diff
changeset
|
298 |
7922
935be827eaf8
error for NaN values in & and | expressions
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
299 #define DEFSCALARBOOLOP_OP(name, t1, t2, op) \ |
935be827eaf8
error for NaN values in & and | expressions
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
300 BINOPDECL (name, a1, a2) \ |
935be827eaf8
error for NaN values in & and | expressions
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
301 { \ |
8366
8b1a2555c4e2
implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
302 CAST_BINOP_ARGS (const CONCAT2(octave_, t1)&, const CONCAT2(octave_, t2)&); \ |
8b1a2555c4e2
implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
303 if (xisnan (v1.CONCAT2(t1, _value) ()) || xisnan (v2.CONCAT2(t2, _value) ())) \ |
7922
935be827eaf8
error for NaN values in & and | expressions
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
304 { \ |
11129
0de5cc44e690
use gripe functions for NaN to logical and NaN to character conversions more consistently
John W. Eaton <jwe@octave.org>
parents:
10313
diff
changeset
|
305 gripe_nan_to_logical_conversion (); \ |
7922
935be827eaf8
error for NaN values in & and | expressions
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
306 return octave_value (); \ |
935be827eaf8
error for NaN values in & and | expressions
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
307 } \ |
935be827eaf8
error for NaN values in & and | expressions
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
308 else \ |
935be827eaf8
error for NaN values in & and | expressions
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
309 return octave_value \ |
8366
8b1a2555c4e2
implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
310 (v1.CONCAT2(t1, _value) () op v2.CONCAT2(t2, _value) ()); \ |
7922
935be827eaf8
error for NaN values in & and | expressions
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
311 } |
935be827eaf8
error for NaN values in & and | expressions
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
312 |
4543 | 313 #define DEFNDBINOP_OP(name, t1, t2, e1, e2, op) \ |
314 BINOPDECL (name, a1, a2) \ | |
315 { \ | |
8366
8b1a2555c4e2
implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
316 CAST_BINOP_ARGS (const CONCAT2(octave_, t1)&, const CONCAT2(octave_, t2)&); \ |
4543 | 317 return octave_value \ |
8366
8b1a2555c4e2
implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
318 (v1.CONCAT2(e1, _value) () op v2.CONCAT2(e2, _value) ()); \ |
4543 | 319 } |
320 | |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
321 // FIXME: in some cases, the constructor isn't necessary. |
2914 | 322 |
323 #define DEFBINOP_FN(name, t1, t2, f) \ | |
324 BINOPDECL (name, a1, a2) \ | |
325 { \ | |
8366
8b1a2555c4e2
implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
326 CAST_BINOP_ARGS (const CONCAT2(octave_, t1)&, const CONCAT2(octave_, t2)&); \ |
8b1a2555c4e2
implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
327 return octave_value (f (v1.CONCAT2(t1, _value) (), v2.CONCAT2(t2, _value) ())); \ |
2914 | 328 } |
329 | |
4543 | 330 #define DEFNDBINOP_FN(name, t1, t2, e1, e2, f) \ |
331 BINOPDECL (name, a1, a2) \ | |
332 { \ | |
8366
8b1a2555c4e2
implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
333 CAST_BINOP_ARGS (const CONCAT2(octave_, t1)&, const CONCAT2(octave_, t2)&); \ |
8b1a2555c4e2
implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
334 return octave_value (f (v1.CONCAT2(e1, _value) (), v2.CONCAT2(e2, _value) ())); \ |
4543 | 335 } |
336 | |
9588
319e2ab9b8ae
warn about the complex comparison ops
Jaroslav Hajek <highegg@gmail.com>
parents:
9587
diff
changeset
|
337 #define DEFNDCMPLXCMPOP_FN(name, t1, t2, e1, e2, f) \ |
319e2ab9b8ae
warn about the complex comparison ops
Jaroslav Hajek <highegg@gmail.com>
parents:
9587
diff
changeset
|
338 BINOPDECL (name, a1, a2) \ |
319e2ab9b8ae
warn about the complex comparison ops
Jaroslav Hajek <highegg@gmail.com>
parents:
9587
diff
changeset
|
339 { \ |
319e2ab9b8ae
warn about the complex comparison ops
Jaroslav Hajek <highegg@gmail.com>
parents:
9587
diff
changeset
|
340 CAST_BINOP_ARGS (const CONCAT2(octave_, t1)&, const CONCAT2(octave_, t2)&); \ |
319e2ab9b8ae
warn about the complex comparison ops
Jaroslav Hajek <highegg@gmail.com>
parents:
9587
diff
changeset
|
341 return octave_value (f (v1.CONCAT2(e1, _value) (), v2.CONCAT2(e2, _value) ())); \ |
319e2ab9b8ae
warn about the complex comparison ops
Jaroslav Hajek <highegg@gmail.com>
parents:
9587
diff
changeset
|
342 } |
319e2ab9b8ae
warn about the complex comparison ops
Jaroslav Hajek <highegg@gmail.com>
parents:
9587
diff
changeset
|
343 |
10313 | 344 #define CATOPDECL(name, a1, a2) \ |
4915 | 345 static octave_value \ |
8366
8b1a2555c4e2
implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
346 CONCAT2(oct_catop_, name) (octave_base_value& a1, const octave_base_value& a2, \ |
10313 | 347 const Array<octave_idx_type>& ra_idx) |
4915 | 348 |
10313 | 349 #define DEFCATOPX(name, t1, t2) \ |
4915 | 350 CATOPDECL (name, , ) |
351 | |
10313 | 352 #define DEFCATOP(name, t1, t2) \ |
4915 | 353 CATOPDECL (name, a1, a2) |
354 | |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
355 // FIXME: in some cases, the constructor isn't necessary. |
4915 | 356 |
357 #define DEFCATOP_FN(name, t1, t2, f) \ | |
5075 | 358 CATOPDECL (name, a1, a2) \ |
4915 | 359 { \ |
8366
8b1a2555c4e2
implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
360 CAST_BINOP_ARGS (CONCAT2(octave_, t1)&, const CONCAT2(octave_, t2)&); \ |
8b1a2555c4e2
implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
361 return octave_value (v1.CONCAT2(t1, _value) () . f (v2.CONCAT2(t2, _value) (), ra_idx)); \ |
4915 | 362 } |
363 | |
5075 | 364 #define DEFNDCATOP_FN(name, t1, t2, e1, e2, f) \ |
365 CATOPDECL (name, a1, a2) \ | |
4915 | 366 { \ |
8366
8b1a2555c4e2
implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
367 CAST_BINOP_ARGS (CONCAT2(octave_, t1)&, const CONCAT2(octave_, t2)&); \ |
8b1a2555c4e2
implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
368 return octave_value (v1.CONCAT2(e1, _value) () . f (v2.CONCAT2(e2, _value) (), ra_idx)); \ |
5533 | 369 } |
370 | |
371 #define DEFNDCHARCATOP_FN(name, t1, t2, f) \ | |
372 CATOPDECL (name, a1, a2) \ | |
373 { \ | |
8366
8b1a2555c4e2
implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
374 CAST_BINOP_ARGS (CONCAT2(octave_, t1)&, const CONCAT2(octave_, t2)&); \ |
5533 | 375 \ |
376 return octave_value (v1.char_array_value () . f (v2.char_array_value (), ra_idx), \ | |
10313 | 377 ((a1.is_sq_string () || a2.is_sq_string ()) \ |
378 ? '\'' : '"')); \ | |
4915 | 379 } |
380 | |
5075 | 381 // For compatibility, the second arg is always converted to the type |
382 // of the first. Hmm. | |
383 | |
384 #define DEFNDCATOP_FN2(name, t1, t2, tc1, tc2, e1, e2, f) \ | |
385 CATOPDECL (name, a1, a2) \ | |
386 { \ | |
8366
8b1a2555c4e2
implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
387 CAST_BINOP_ARGS (CONCAT2(octave_, t1)&, const CONCAT2(octave_, t2)&); \ |
8b1a2555c4e2
implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
388 return octave_value (tc1 (v1.CONCAT2(e1, _value) ()) . f (tc2 (v2.CONCAT2(e2, _value) ()), ra_idx)); \ |
5075 | 389 } |
390 | |
4915 | 391 #define CATOP_NONCONFORMANT(msg) \ |
392 gripe_nonconformant (msg, \ | |
10313 | 393 a1.rows (), a1.columns (), \ |
394 a2.rows (), a2.columns ()); \ | |
4915 | 395 return octave_value () |
396 | |
2376 | 397 #endif |