Mercurial > octave
comparison liboctave/operators/mx-op-decl.h @ 22197:e43d83253e28
refill multi-line macro definitions
Use the Emacs C++ mode style for line continuation markers in
multi-line macro definitions.
* make_int.cc, __dsearchn__.cc, __magick_read__.cc, besselj.cc,
bitfcns.cc, bsxfun.cc, cellfun.cc, data.cc, defun-dld.h, defun-int.h,
defun.h, det.cc, error.h, find.cc, gcd.cc, graphics.cc, interpreter.h,
jit-ir.h, jit-typeinfo.h, lookup.cc, ls-mat5.cc, max.cc, mexproto.h,
mxarray.in.h, oct-stream.cc, ordschur.cc, pr-output.cc, profiler.h,
psi.cc, regexp.cc, sparse-xdiv.cc, sparse-xpow.cc, tril.cc, txt-eng.h,
utils.cc, variables.cc, variables.h, xdiv.cc, xpow.cc, __glpk__.cc,
ov-base.cc, ov-base.h, ov-cell.cc, ov-ch-mat.cc, ov-classdef.cc,
ov-complex.cc, ov-cx-mat.cc, ov-cx-sparse.cc, ov-float.cc, ov-float.h,
ov-flt-complex.cc, ov-flt-cx-mat.cc, ov-flt-re-mat.cc,
ov-int-traits.h, ov-lazy-idx.h, ov-perm.cc, ov-re-mat.cc,
ov-re-sparse.cc, ov-scalar.cc, ov-scalar.h, ov-str-mat.cc,
ov-type-conv.h, ov.cc, ov.h, op-class.cc, op-int-conv.cc, op-int.h,
op-str-str.cc, ops.h, lex.ll, Array.cc, CMatrix.cc, CSparse.cc,
MArray.cc, MArray.h, MDiagArray2.cc, MDiagArray2.h, MSparse.h,
Sparse.cc, dMatrix.cc, dSparse.cc, fCMatrix.cc, fMatrix.cc,
idx-vector.cc, f77-fcn.h, quit.h, bsxfun-decl.h, bsxfun-defs.cc,
lo-specfun.cc, oct-convn.cc, oct-convn.h, oct-norm.cc, oct-norm.h,
oct-rand.cc, Sparse-op-decls.h, Sparse-op-defs.h, mx-inlines.cc,
mx-op-decl.h, mx-op-defs.h, mach-info.cc, oct-group.cc, oct-passwd.cc,
oct-syscalls.cc, oct-time.cc, data-conv.cc, kpse.cc, lo-ieee.h,
lo-macros.h, oct-cmplx.h, oct-glob.cc, oct-inttypes.cc,
oct-inttypes.h, oct-locbuf.h, oct-sparse.h, url-transfer.cc,
oct-conf-post.in.h, shared-fcns.h: Refill macro definitions.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Mon, 01 Aug 2016 12:40:18 -0400 |
parents | 1473547f50f5 |
children | bac0d6f07a3e |
comparison
equal
deleted
inserted
replaced
22196:dd992fd74fce | 22197:e43d83253e28 |
---|---|
25 #if ! defined (octave_mx_op_decl_h) | 25 #if ! defined (octave_mx_op_decl_h) |
26 #define octave_mx_op_decl_h 1 | 26 #define octave_mx_op_decl_h 1 |
27 | 27 |
28 #include "octave-config.h" | 28 #include "octave-config.h" |
29 | 29 |
30 #define BIN_OP_DECL(R, OP, X, Y, API) \ | 30 #define BIN_OP_DECL(R, OP, X, Y, API) \ |
31 extern API R OP (const X&, const Y&) | 31 extern API R OP (const X&, const Y&) |
32 | 32 |
33 class boolMatrix; | 33 class boolMatrix; |
34 class boolNDArray; | 34 class boolNDArray; |
35 | 35 |
36 #define CMP_OP_DECL(OP, X, Y, API) \ | 36 #define CMP_OP_DECL(OP, X, Y, API) \ |
37 extern API boolMatrix OP (const X&, const Y&) | 37 extern API boolMatrix OP (const X&, const Y&) |
38 | 38 |
39 #define NDCMP_OP_DECL(OP, X, Y, API) \ | 39 #define NDCMP_OP_DECL(OP, X, Y, API) \ |
40 extern API boolNDArray OP (const X&, const Y&) | 40 extern API boolNDArray OP (const X&, const Y&) |
41 | 41 |
42 #define BOOL_OP_DECL(OP, X, Y, API) \ | 42 #define BOOL_OP_DECL(OP, X, Y, API) \ |
43 extern API boolMatrix OP (const X&, const Y&) | 43 extern API boolMatrix OP (const X&, const Y&) |
44 | 44 |
45 #define NDBOOL_OP_DECL(OP, X, Y, API) \ | 45 #define NDBOOL_OP_DECL(OP, X, Y, API) \ |
46 extern API boolNDArray OP (const X&, const Y&) | 46 extern API boolNDArray OP (const X&, const Y&) |
47 | 47 |
48 // vector by scalar operations. | 48 // vector by scalar operations. |
49 | 49 |
50 #define VS_BIN_OP_DECLS(R, V, S, API) \ | 50 #define VS_BIN_OP_DECLS(R, V, S, API) \ |
51 BIN_OP_DECL (R, operator +, V, S, API); \ | 51 BIN_OP_DECL (R, operator +, V, S, API); \ |
52 BIN_OP_DECL (R, operator -, V, S, API); \ | 52 BIN_OP_DECL (R, operator -, V, S, API); \ |
53 BIN_OP_DECL (R, operator *, V, S, API); \ | 53 BIN_OP_DECL (R, operator *, V, S, API); \ |
54 BIN_OP_DECL (R, operator /, V, S, API); | 54 BIN_OP_DECL (R, operator /, V, S, API); |
55 | 55 |
56 #define VS_OP_DECLS(R, V, S, API) \ | 56 #define VS_OP_DECLS(R, V, S, API) \ |
57 VS_BIN_OP_DECLS(R, V, S, API) | 57 VS_BIN_OP_DECLS(R, V, S, API) |
58 | 58 |
59 // scalar by vector by operations. | 59 // scalar by vector by operations. |
60 | 60 |
61 #define SV_BIN_OP_DECLS(R, S, V, API) \ | 61 #define SV_BIN_OP_DECLS(R, S, V, API) \ |
62 BIN_OP_DECL (R, operator +, S, V, API); \ | 62 BIN_OP_DECL (R, operator +, S, V, API); \ |
63 BIN_OP_DECL (R, operator -, S, V, API); \ | 63 BIN_OP_DECL (R, operator -, S, V, API); \ |
64 BIN_OP_DECL (R, operator *, S, V, API); \ | 64 BIN_OP_DECL (R, operator *, S, V, API); \ |
65 BIN_OP_DECL (R, operator /, S, V, API); | 65 BIN_OP_DECL (R, operator /, S, V, API); |
66 | 66 |
67 #define SV_OP_DECLS(R, S, V, API) \ | 67 #define SV_OP_DECLS(R, S, V, API) \ |
68 SV_BIN_OP_DECLS(R, S, V, API) | 68 SV_BIN_OP_DECLS(R, S, V, API) |
69 | 69 |
70 // vector by vector operations. | 70 // vector by vector operations. |
71 | 71 |
72 #define VV_BIN_OP_DECLS(R, V1, V2, API) \ | 72 #define VV_BIN_OP_DECLS(R, V1, V2, API) \ |
73 BIN_OP_DECL (R, operator +, V1, V2, API); \ | 73 BIN_OP_DECL (R, operator +, V1, V2, API); \ |
74 BIN_OP_DECL (R, operator -, V1, V2, API); \ | 74 BIN_OP_DECL (R, operator -, V1, V2, API); \ |
75 BIN_OP_DECL (R, product, V1, V2, API); \ | 75 BIN_OP_DECL (R, product, V1, V2, API); \ |
76 BIN_OP_DECL (R, quotient, V1, V2, API); | 76 BIN_OP_DECL (R, quotient, V1, V2, API); |
77 | 77 |
78 #define VV_OP_DECLS(R, V1, V2, API) \ | 78 #define VV_OP_DECLS(R, V1, V2, API) \ |
79 VV_BIN_OP_DECLS(R, V1, V2, API) | 79 VV_BIN_OP_DECLS(R, V1, V2, API) |
80 | 80 |
81 // matrix by scalar operations. | 81 // matrix by scalar operations. |
82 | 82 |
83 #define MS_BIN_OP_DECLS(R, M, S, API) \ | 83 #define MS_BIN_OP_DECLS(R, M, S, API) \ |
84 BIN_OP_DECL (R, operator +, M, S, API); \ | 84 BIN_OP_DECL (R, operator +, M, S, API); \ |
85 BIN_OP_DECL (R, operator -, M, S, API); \ | 85 BIN_OP_DECL (R, operator -, M, S, API); \ |
86 BIN_OP_DECL (R, operator *, M, S, API); \ | 86 BIN_OP_DECL (R, operator *, M, S, API); \ |
87 BIN_OP_DECL (R, operator /, M, S, API); | 87 BIN_OP_DECL (R, operator /, M, S, API); |
88 | 88 |
89 #define MS_CMP_OP_DECLS(M, S, API) \ | 89 #define MS_CMP_OP_DECLS(M, S, API) \ |
90 CMP_OP_DECL (mx_el_lt, M, S, API); \ | 90 CMP_OP_DECL (mx_el_lt, M, S, API); \ |
91 CMP_OP_DECL (mx_el_le, M, S, API); \ | 91 CMP_OP_DECL (mx_el_le, M, S, API); \ |
92 CMP_OP_DECL (mx_el_ge, M, S, API); \ | 92 CMP_OP_DECL (mx_el_ge, M, S, API); \ |
93 CMP_OP_DECL (mx_el_gt, M, S, API); \ | 93 CMP_OP_DECL (mx_el_gt, M, S, API); \ |
94 CMP_OP_DECL (mx_el_eq, M, S, API); \ | 94 CMP_OP_DECL (mx_el_eq, M, S, API); \ |
95 CMP_OP_DECL (mx_el_ne, M, S, API); | 95 CMP_OP_DECL (mx_el_ne, M, S, API); |
96 | 96 |
97 #define MS_BOOL_OP_DECLS(M, S, API) \ | 97 #define MS_BOOL_OP_DECLS(M, S, API) \ |
98 BOOL_OP_DECL (mx_el_and, M, S, API); \ | 98 BOOL_OP_DECL (mx_el_and, M, S, API); \ |
99 BOOL_OP_DECL (mx_el_or, M, S, API); \ | 99 BOOL_OP_DECL (mx_el_or, M, S, API); \ |
100 | 100 |
101 #define MS_OP_DECLS(R, M, S, API) \ | 101 #define MS_OP_DECLS(R, M, S, API) \ |
102 MS_BIN_OP_DECLS (R, M, S, API) \ | 102 MS_BIN_OP_DECLS (R, M, S, API) \ |
103 MS_CMP_OP_DECLS (M, S, API) \ | 103 MS_CMP_OP_DECLS (M, S, API) \ |
104 MS_BOOL_OP_DECLS (M, S, API) \ | 104 MS_BOOL_OP_DECLS (M, S, API) \ |
105 | 105 |
106 // scalar by matrix operations. | 106 // scalar by matrix operations. |
107 | 107 |
108 #define SM_BIN_OP_DECLS(R, S, M, API) \ | 108 #define SM_BIN_OP_DECLS(R, S, M, API) \ |
109 BIN_OP_DECL (R, operator +, S, M, API); \ | 109 BIN_OP_DECL (R, operator +, S, M, API); \ |
110 BIN_OP_DECL (R, operator -, S, M, API); \ | 110 BIN_OP_DECL (R, operator -, S, M, API); \ |
111 BIN_OP_DECL (R, operator *, S, M, API); \ | 111 BIN_OP_DECL (R, operator *, S, M, API); \ |
112 BIN_OP_DECL (R, operator /, S, M, API); | 112 BIN_OP_DECL (R, operator /, S, M, API); |
113 | 113 |
114 #define SM_CMP_OP_DECLS(S, M, API) \ | 114 #define SM_CMP_OP_DECLS(S, M, API) \ |
115 CMP_OP_DECL (mx_el_lt, S, M, API); \ | 115 CMP_OP_DECL (mx_el_lt, S, M, API); \ |
116 CMP_OP_DECL (mx_el_le, S, M, API); \ | 116 CMP_OP_DECL (mx_el_le, S, M, API); \ |
117 CMP_OP_DECL (mx_el_ge, S, M, API); \ | 117 CMP_OP_DECL (mx_el_ge, S, M, API); \ |
118 CMP_OP_DECL (mx_el_gt, S, M, API); \ | 118 CMP_OP_DECL (mx_el_gt, S, M, API); \ |
119 CMP_OP_DECL (mx_el_eq, S, M, API); \ | 119 CMP_OP_DECL (mx_el_eq, S, M, API); \ |
120 CMP_OP_DECL (mx_el_ne, S, M, API); | 120 CMP_OP_DECL (mx_el_ne, S, M, API); |
121 | 121 |
122 #define SM_BOOL_OP_DECLS(S, M, API) \ | 122 #define SM_BOOL_OP_DECLS(S, M, API) \ |
123 BOOL_OP_DECL (mx_el_and, S, M, API); \ | 123 BOOL_OP_DECL (mx_el_and, S, M, API); \ |
124 BOOL_OP_DECL (mx_el_or, S, M, API); \ | 124 BOOL_OP_DECL (mx_el_or, S, M, API); \ |
125 | 125 |
126 #define SM_OP_DECLS(R, S, M, API) \ | 126 #define SM_OP_DECLS(R, S, M, API) \ |
127 SM_BIN_OP_DECLS (R, S, M, API) \ | 127 SM_BIN_OP_DECLS (R, S, M, API) \ |
128 SM_CMP_OP_DECLS (S, M, API) \ | 128 SM_CMP_OP_DECLS (S, M, API) \ |
129 SM_BOOL_OP_DECLS (S, M, API) \ | 129 SM_BOOL_OP_DECLS (S, M, API) \ |
130 | 130 |
131 // matrix by matrix operations. | 131 // matrix by matrix operations. |
132 | 132 |
133 #define MM_BIN_OP_DECLS(R, M1, M2, API) \ | 133 #define MM_BIN_OP_DECLS(R, M1, M2, API) \ |
134 BIN_OP_DECL (R, operator +, M1, M2, API); \ | 134 BIN_OP_DECL (R, operator +, M1, M2, API); \ |
135 BIN_OP_DECL (R, operator -, M1, M2, API); \ | 135 BIN_OP_DECL (R, operator -, M1, M2, API); \ |
136 BIN_OP_DECL (R, product, M1, M2, API); \ | 136 BIN_OP_DECL (R, product, M1, M2, API); \ |
137 BIN_OP_DECL (R, quotient, M1, M2, API); | 137 BIN_OP_DECL (R, quotient, M1, M2, API); |
138 | 138 |
139 #define MM_CMP_OP_DECLS(M1, M2, API) \ | 139 #define MM_CMP_OP_DECLS(M1, M2, API) \ |
140 CMP_OP_DECL (mx_el_lt, M1, M2, API); \ | 140 CMP_OP_DECL (mx_el_lt, M1, M2, API); \ |
141 CMP_OP_DECL (mx_el_le, M1, M2, API); \ | 141 CMP_OP_DECL (mx_el_le, M1, M2, API); \ |
142 CMP_OP_DECL (mx_el_ge, M1, M2, API); \ | 142 CMP_OP_DECL (mx_el_ge, M1, M2, API); \ |
143 CMP_OP_DECL (mx_el_gt, M1, M2, API); \ | 143 CMP_OP_DECL (mx_el_gt, M1, M2, API); \ |
144 CMP_OP_DECL (mx_el_eq, M1, M2, API); \ | 144 CMP_OP_DECL (mx_el_eq, M1, M2, API); \ |
145 CMP_OP_DECL (mx_el_ne, M1, M2, API); | 145 CMP_OP_DECL (mx_el_ne, M1, M2, API); |
146 | 146 |
147 #define MM_BOOL_OP_DECLS(M1, M2, API) \ | 147 #define MM_BOOL_OP_DECLS(M1, M2, API) \ |
148 BOOL_OP_DECL (mx_el_and, M1, M2, API); \ | 148 BOOL_OP_DECL (mx_el_and, M1, M2, API); \ |
149 BOOL_OP_DECL (mx_el_or, M1, M2, API); | 149 BOOL_OP_DECL (mx_el_or, M1, M2, API); |
150 | 150 |
151 #define MM_OP_DECLS(R, M1, M2, API) \ | 151 #define MM_OP_DECLS(R, M1, M2, API) \ |
152 MM_BIN_OP_DECLS (R, M1, M2, API) \ | 152 MM_BIN_OP_DECLS (R, M1, M2, API) \ |
153 MM_CMP_OP_DECLS (M1, M2, API) \ | 153 MM_CMP_OP_DECLS (M1, M2, API) \ |
154 MM_BOOL_OP_DECLS (M1, M2, API) | 154 MM_BOOL_OP_DECLS (M1, M2, API) |
155 | 155 |
156 // N-D matrix by scalar operations. | 156 // N-D matrix by scalar operations. |
157 | 157 |
158 #define NDS_BIN_OP_DECLS(R, ND, S, API) \ | 158 #define NDS_BIN_OP_DECLS(R, ND, S, API) \ |
159 BIN_OP_DECL (R, operator +, ND, S, API); \ | 159 BIN_OP_DECL (R, operator +, ND, S, API); \ |
160 BIN_OP_DECL (R, operator -, ND, S, API); \ | 160 BIN_OP_DECL (R, operator -, ND, S, API); \ |
161 BIN_OP_DECL (R, operator *, ND, S, API); \ | 161 BIN_OP_DECL (R, operator *, ND, S, API); \ |
162 BIN_OP_DECL (R, operator /, ND, S, API); | 162 BIN_OP_DECL (R, operator /, ND, S, API); |
163 | 163 |
164 #define NDS_CMP_OP_DECLS(ND, S, API) \ | 164 #define NDS_CMP_OP_DECLS(ND, S, API) \ |
165 NDCMP_OP_DECL (mx_el_lt, ND, S, API); \ | 165 NDCMP_OP_DECL (mx_el_lt, ND, S, API); \ |
166 NDCMP_OP_DECL (mx_el_le, ND, S, API); \ | 166 NDCMP_OP_DECL (mx_el_le, ND, S, API); \ |
167 NDCMP_OP_DECL (mx_el_ge, ND, S, API); \ | 167 NDCMP_OP_DECL (mx_el_ge, ND, S, API); \ |
168 NDCMP_OP_DECL (mx_el_gt, ND, S, API); \ | 168 NDCMP_OP_DECL (mx_el_gt, ND, S, API); \ |
169 NDCMP_OP_DECL (mx_el_eq, ND, S, API); \ | 169 NDCMP_OP_DECL (mx_el_eq, ND, S, API); \ |
170 NDCMP_OP_DECL (mx_el_ne, ND, S, API); | 170 NDCMP_OP_DECL (mx_el_ne, ND, S, API); |
171 | 171 |
172 #define NDS_BOOL_OP_DECLS(ND, S, API) \ | 172 #define NDS_BOOL_OP_DECLS(ND, S, API) \ |
173 NDBOOL_OP_DECL (mx_el_and, ND, S, API); \ | 173 NDBOOL_OP_DECL (mx_el_and, ND, S, API); \ |
174 NDBOOL_OP_DECL (mx_el_or, ND, S, API); \ | 174 NDBOOL_OP_DECL (mx_el_or, ND, S, API); \ |
175 NDBOOL_OP_DECL (mx_el_not_and, ND, S, API); \ | 175 NDBOOL_OP_DECL (mx_el_not_and, ND, S, API); \ |
176 NDBOOL_OP_DECL (mx_el_not_or, ND, S, API); | 176 NDBOOL_OP_DECL (mx_el_not_or, ND, S, API); |
177 | 177 |
178 #define NDS_OP_DECLS(R, ND, S, API) \ | 178 #define NDS_OP_DECLS(R, ND, S, API) \ |
179 NDS_BIN_OP_DECLS (R, ND, S, API) \ | 179 NDS_BIN_OP_DECLS (R, ND, S, API) \ |
180 NDS_CMP_OP_DECLS (ND, S, API) \ | 180 NDS_CMP_OP_DECLS (ND, S, API) \ |
181 NDS_BOOL_OP_DECLS (ND, S, API) | 181 NDS_BOOL_OP_DECLS (ND, S, API) |
182 | 182 |
183 // scalar by N-D matrix operations. | 183 // scalar by N-D matrix operations. |
184 | 184 |
185 #define SND_BIN_OP_DECLS(R, S, ND, API) \ | 185 #define SND_BIN_OP_DECLS(R, S, ND, API) \ |
186 BIN_OP_DECL (R, operator +, S, ND, API); \ | 186 BIN_OP_DECL (R, operator +, S, ND, API); \ |
187 BIN_OP_DECL (R, operator -, S, ND, API); \ | 187 BIN_OP_DECL (R, operator -, S, ND, API); \ |
188 BIN_OP_DECL (R, operator *, S, ND, API); \ | 188 BIN_OP_DECL (R, operator *, S, ND, API); \ |
189 BIN_OP_DECL (R, operator /, S, ND, API); | 189 BIN_OP_DECL (R, operator /, S, ND, API); |
190 | 190 |
191 #define SND_CMP_OP_DECLS(S, ND, API) \ | 191 #define SND_CMP_OP_DECLS(S, ND, API) \ |
192 NDCMP_OP_DECL (mx_el_lt, S, ND, API); \ | 192 NDCMP_OP_DECL (mx_el_lt, S, ND, API); \ |
193 NDCMP_OP_DECL (mx_el_le, S, ND, API); \ | 193 NDCMP_OP_DECL (mx_el_le, S, ND, API); \ |
194 NDCMP_OP_DECL (mx_el_ge, S, ND, API); \ | 194 NDCMP_OP_DECL (mx_el_ge, S, ND, API); \ |
195 NDCMP_OP_DECL (mx_el_gt, S, ND, API); \ | 195 NDCMP_OP_DECL (mx_el_gt, S, ND, API); \ |
196 NDCMP_OP_DECL (mx_el_eq, S, ND, API); \ | 196 NDCMP_OP_DECL (mx_el_eq, S, ND, API); \ |
197 NDCMP_OP_DECL (mx_el_ne, S, ND, API); | 197 NDCMP_OP_DECL (mx_el_ne, S, ND, API); |
198 | 198 |
199 #define SND_BOOL_OP_DECLS(S, ND, API) \ | 199 #define SND_BOOL_OP_DECLS(S, ND, API) \ |
200 NDBOOL_OP_DECL (mx_el_and, S, ND, API); \ | 200 NDBOOL_OP_DECL (mx_el_and, S, ND, API); \ |
201 NDBOOL_OP_DECL (mx_el_or, S, ND, API); \ | 201 NDBOOL_OP_DECL (mx_el_or, S, ND, API); \ |
202 NDBOOL_OP_DECL (mx_el_and_not, S, ND, API); \ | 202 NDBOOL_OP_DECL (mx_el_and_not, S, ND, API); \ |
203 NDBOOL_OP_DECL (mx_el_or_not, S, ND, API); | 203 NDBOOL_OP_DECL (mx_el_or_not, S, ND, API); |
204 | 204 |
205 #define SND_OP_DECLS(R, S, ND, API) \ | 205 #define SND_OP_DECLS(R, S, ND, API) \ |
206 SND_BIN_OP_DECLS (R, S, ND, API) \ | 206 SND_BIN_OP_DECLS (R, S, ND, API) \ |
207 SND_CMP_OP_DECLS (S, ND, API) \ | 207 SND_CMP_OP_DECLS (S, ND, API) \ |
208 SND_BOOL_OP_DECLS (S, ND, API) | 208 SND_BOOL_OP_DECLS (S, ND, API) |
209 | 209 |
210 // N-D matrix by N-D matrix operations. | 210 // N-D matrix by N-D matrix operations. |
211 | 211 |
212 #define NDND_BIN_OP_DECLS(R, ND1, ND2, API) \ | 212 #define NDND_BIN_OP_DECLS(R, ND1, ND2, API) \ |
213 BIN_OP_DECL (R, operator +, ND1, ND2, API); \ | 213 BIN_OP_DECL (R, operator +, ND1, ND2, API); \ |
214 BIN_OP_DECL (R, operator -, ND1, ND2, API); \ | 214 BIN_OP_DECL (R, operator -, ND1, ND2, API); \ |
215 BIN_OP_DECL (R, product, ND1, ND2, API); \ | 215 BIN_OP_DECL (R, product, ND1, ND2, API); \ |
216 BIN_OP_DECL (R, quotient, ND1, ND2, API); | 216 BIN_OP_DECL (R, quotient, ND1, ND2, API); |
217 | 217 |
218 #define NDND_CMP_OP_DECLS(ND1, ND2, API) \ | 218 #define NDND_CMP_OP_DECLS(ND1, ND2, API) \ |
219 NDCMP_OP_DECL (mx_el_lt, ND1, ND2, API); \ | 219 NDCMP_OP_DECL (mx_el_lt, ND1, ND2, API); \ |
220 NDCMP_OP_DECL (mx_el_le, ND1, ND2, API); \ | 220 NDCMP_OP_DECL (mx_el_le, ND1, ND2, API); \ |
221 NDCMP_OP_DECL (mx_el_ge, ND1, ND2, API); \ | 221 NDCMP_OP_DECL (mx_el_ge, ND1, ND2, API); \ |
222 NDCMP_OP_DECL (mx_el_gt, ND1, ND2, API); \ | 222 NDCMP_OP_DECL (mx_el_gt, ND1, ND2, API); \ |
223 NDCMP_OP_DECL (mx_el_eq, ND1, ND2, API); \ | 223 NDCMP_OP_DECL (mx_el_eq, ND1, ND2, API); \ |
224 NDCMP_OP_DECL (mx_el_ne, ND1, ND2, API); | 224 NDCMP_OP_DECL (mx_el_ne, ND1, ND2, API); |
225 | 225 |
226 #define NDND_BOOL_OP_DECLS(ND1, ND2, API) \ | 226 #define NDND_BOOL_OP_DECLS(ND1, ND2, API) \ |
227 NDBOOL_OP_DECL (mx_el_and, ND1, ND2, API); \ | 227 NDBOOL_OP_DECL (mx_el_and, ND1, ND2, API); \ |
228 NDBOOL_OP_DECL (mx_el_or, ND1, ND2, API); \ | 228 NDBOOL_OP_DECL (mx_el_or, ND1, ND2, API); \ |
229 NDBOOL_OP_DECL (mx_el_and_not, ND1, ND2, API); \ | 229 NDBOOL_OP_DECL (mx_el_and_not, ND1, ND2, API); \ |
230 NDBOOL_OP_DECL (mx_el_or_not, ND1, ND2, API); \ | 230 NDBOOL_OP_DECL (mx_el_or_not, ND1, ND2, API); \ |
231 NDBOOL_OP_DECL (mx_el_not_and, ND1, ND2, API); \ | 231 NDBOOL_OP_DECL (mx_el_not_and, ND1, ND2, API); \ |
232 NDBOOL_OP_DECL (mx_el_not_or, ND1, ND2, API); | 232 NDBOOL_OP_DECL (mx_el_not_or, ND1, ND2, API); |
233 | 233 |
234 #define NDND_OP_DECLS(R, ND1, ND2, API) \ | 234 #define NDND_OP_DECLS(R, ND1, ND2, API) \ |
235 NDND_BIN_OP_DECLS (R, ND1, ND2, API) \ | 235 NDND_BIN_OP_DECLS (R, ND1, ND2, API) \ |
236 NDND_CMP_OP_DECLS (ND1, ND2, API) \ | 236 NDND_CMP_OP_DECLS (ND1, ND2, API) \ |
237 NDND_BOOL_OP_DECLS (ND1, ND2, API) | 237 NDND_BOOL_OP_DECLS (ND1, ND2, API) |
238 | 238 |
239 // scalar by diagonal matrix operations. | 239 // scalar by diagonal matrix operations. |
240 | 240 |
241 #define SDM_BIN_OP_DECLS(R, S, DM, API) \ | 241 #define SDM_BIN_OP_DECLS(R, S, DM, API) \ |
242 BIN_OP_DECL (R, operator *, S, DM, API); \ | 242 BIN_OP_DECL (R, operator *, S, DM, API); \ |
243 | 243 |
244 #define SDM_OP_DECLS(R, S, DM, API) \ | 244 #define SDM_OP_DECLS(R, S, DM, API) \ |
245 SDM_BIN_OP_DECLS(R, S, DM, API) | 245 SDM_BIN_OP_DECLS(R, S, DM, API) |
246 | 246 |
247 // diagonal matrix by scalar operations. | 247 // diagonal matrix by scalar operations. |
248 | 248 |
249 #define DMS_BIN_OP_DECLS(R, DM, S, API) \ | 249 #define DMS_BIN_OP_DECLS(R, DM, S, API) \ |
250 BIN_OP_DECL (R, operator *, DM, S, API); \ | 250 BIN_OP_DECL (R, operator *, DM, S, API); \ |
251 BIN_OP_DECL (R, operator /, DM, S, API); | 251 BIN_OP_DECL (R, operator /, DM, S, API); |
252 | 252 |
253 #define DMS_OP_DECLS(R, DM, S, API) \ | 253 #define DMS_OP_DECLS(R, DM, S, API) \ |
254 DMS_BIN_OP_DECLS(R, DM, S, API) | 254 DMS_BIN_OP_DECLS(R, DM, S, API) |
255 | 255 |
256 // matrix by diagonal matrix operations. | 256 // matrix by diagonal matrix operations. |
257 | 257 |
258 #define MDM_BIN_OP_DECLS(R, M, DM, API) \ | 258 #define MDM_BIN_OP_DECLS(R, M, DM, API) \ |
259 BIN_OP_DECL (R, operator +, M, DM, API); \ | 259 BIN_OP_DECL (R, operator +, M, DM, API); \ |
260 BIN_OP_DECL (R, operator -, M, DM, API); \ | 260 BIN_OP_DECL (R, operator -, M, DM, API); \ |
261 BIN_OP_DECL (R, operator *, M, DM, API); | 261 BIN_OP_DECL (R, operator *, M, DM, API); |
262 | 262 |
263 #define MDM_OP_DECLS(R, M, DM, API) \ | 263 #define MDM_OP_DECLS(R, M, DM, API) \ |
264 MDM_BIN_OP_DECLS(R, M, DM, API) | 264 MDM_BIN_OP_DECLS(R, M, DM, API) |
265 | 265 |
266 // diagonal matrix by matrix operations. | 266 // diagonal matrix by matrix operations. |
267 | 267 |
268 #define DMM_BIN_OP_DECLS(R, DM, M, API) \ | 268 #define DMM_BIN_OP_DECLS(R, DM, M, API) \ |
269 BIN_OP_DECL (R, operator +, DM, M, API); \ | 269 BIN_OP_DECL (R, operator +, DM, M, API); \ |
270 BIN_OP_DECL (R, operator -, DM, M, API); \ | 270 BIN_OP_DECL (R, operator -, DM, M, API); \ |
271 BIN_OP_DECL (R, operator *, DM, M, API); | 271 BIN_OP_DECL (R, operator *, DM, M, API); |
272 | 272 |
273 #define DMM_OP_DECLS(R, DM, M, API) \ | 273 #define DMM_OP_DECLS(R, DM, M, API) \ |
274 DMM_BIN_OP_DECLS(R, DM, M, API) | 274 DMM_BIN_OP_DECLS(R, DM, M, API) |
275 | 275 |
276 // diagonal matrix by diagonal matrix operations. | 276 // diagonal matrix by diagonal matrix operations. |
277 | 277 |
278 #define DMDM_BIN_OP_DECLS(R, DM1, DM2, API) \ | 278 #define DMDM_BIN_OP_DECLS(R, DM1, DM2, API) \ |
279 BIN_OP_DECL (R, operator +, DM1, DM2, API); \ | 279 BIN_OP_DECL (R, operator +, DM1, DM2, API); \ |
280 BIN_OP_DECL (R, operator -, DM1, DM2, API); \ | 280 BIN_OP_DECL (R, operator -, DM1, DM2, API); \ |
281 BIN_OP_DECL (R, product, DM1, DM2, API); | 281 BIN_OP_DECL (R, product, DM1, DM2, API); |
282 | 282 |
283 #define DMDM_OP_DECLS(R, DM1, DM2, API) \ | 283 #define DMDM_OP_DECLS(R, DM1, DM2, API) \ |
284 DMDM_BIN_OP_DECLS (R, DM1, DM2, API) | 284 DMDM_BIN_OP_DECLS (R, DM1, DM2, API) |
285 | 285 |
286 // scalar by N-D array min/max ops | 286 // scalar by N-D array min/max ops |
287 | 287 |
288 #define MINMAX_DECLS(T, S, API) \ | 288 #define MINMAX_DECLS(T, S, API) \ |
289 extern API T min (S d, const T& m); \ | 289 extern API T min (S d, const T& m); \ |
290 extern API T min (const T& m, S d); \ | 290 extern API T min (const T& m, S d); \ |
291 extern API T min (const T& a, const T& b); \ | 291 extern API T min (const T& a, const T& b); \ |
292 extern API T max (S d, const T& m); \ | 292 extern API T max (S d, const T& m); \ |
293 extern API T max (const T& m, S d); \ | 293 extern API T max (const T& m, S d); \ |
294 extern API T max (const T& a, const T& b); | 294 extern API T max (const T& a, const T& b); |
295 | 295 |
296 // permutation matrix by matrix ops and vice versa | 296 // permutation matrix by matrix ops and vice versa |
297 | 297 |
298 #define PMM_BIN_OP_DECLS(R, PM, M, API) \ | 298 #define PMM_BIN_OP_DECLS(R, PM, M, API) \ |
299 BIN_OP_DECL (R, operator *, PM, M, API); | 299 BIN_OP_DECL (R, operator *, PM, M, API); |
300 | 300 |
301 #define MPM_BIN_OP_DECLS(R, M, PM, API) \ | 301 #define MPM_BIN_OP_DECLS(R, M, PM, API) \ |
302 BIN_OP_DECL (R, operator *, M, PM, API); | 302 BIN_OP_DECL (R, operator *, M, PM, API); |
303 | 303 |
304 #endif | 304 #endif |
305 | 305 |