Mercurial > octave
annotate liboctave/array/MDiagArray2.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 |
rev | line source |
---|---|
1993 | 1 // Template array classes with like-type math ops |
1988 | 2 /* |
3 | |
19697
4197fc428c7d
maint: Update copyright notices for 2015.
John W. Eaton <jwe@octave.org>
parents:
17769
diff
changeset
|
4 Copyright (C) 1996-2015 John W. Eaton |
10521
4d1fc073fbb7
add some missing copyright stmts
Jaroslav Hajek <highegg@gmail.com>
parents:
10364
diff
changeset
|
5 Copyright (C) 2010 VZLU Prague |
1988 | 6 |
7 This file is part of Octave. | |
8 | |
9 Octave is free software; you can redistribute it and/or modify it | |
10 under the terms of the GNU General Public License as published by the | |
7016 | 11 Free Software Foundation; either version 3 of the License, or (at your |
12 option) any later version. | |
1988 | 13 |
14 Octave is distributed in the hope that it will be useful, but WITHOUT | |
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
16 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
17 for more details. | |
18 | |
19 You should have received a copy of the GNU General Public License | |
7016 | 20 along with Octave; see the file COPYING. If not, see |
21 <http://www.gnu.org/licenses/>. | |
1988 | 22 |
23 */ | |
24 | |
20791
f7084eae3318
maint: Use Octave coding conventions for #if statements.
Rik <rik@octave.org>
parents:
19697
diff
changeset
|
25 #if ! defined (octave_MDiagArray2_h) |
1988 | 26 #define octave_MDiagArray2_h 1 |
27 | |
21244
1473547f50f5
include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents:
21139
diff
changeset
|
28 #include "octave-config.h" |
1473547f50f5
include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents:
21139
diff
changeset
|
29 |
1988 | 30 #include "DiagArray2.h" |
8375
e3c9102431a9
fix design problems of diag & perm matrix classes
Jaroslav Hajek <highegg@gmail.com>
parents:
8367
diff
changeset
|
31 #include "MArray.h" |
1988 | 32 |
21139
538b57866b90
consistently use "typename" intead of "class" in template declarations
John W. Eaton <jwe@octave.org>
parents:
20960
diff
changeset
|
33 template <typename T> class MDiagArray2; |
3107 | 34 |
20960
2a99b8b250cd
MArray macro removal without loss of functionality to improve maintainability.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
20791
diff
changeset
|
35 template <typename T> MDiagArray2<T> operator + (const MDiagArray2<T>&); |
2a99b8b250cd
MArray macro removal without loss of functionality to improve maintainability.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
20791
diff
changeset
|
36 template <typename T> MDiagArray2<T> operator - (const MDiagArray2<T>&); |
2a99b8b250cd
MArray macro removal without loss of functionality to improve maintainability.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
20791
diff
changeset
|
37 template <typename T> MDiagArray2<T> operator * (const MDiagArray2<T>&, |
2a99b8b250cd
MArray macro removal without loss of functionality to improve maintainability.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
20791
diff
changeset
|
38 const T&); |
2a99b8b250cd
MArray macro removal without loss of functionality to improve maintainability.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
20791
diff
changeset
|
39 template <typename T> MDiagArray2<T> operator / (const MDiagArray2<T>&, |
2a99b8b250cd
MArray macro removal without loss of functionality to improve maintainability.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
20791
diff
changeset
|
40 const T&); |
2a99b8b250cd
MArray macro removal without loss of functionality to improve maintainability.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
20791
diff
changeset
|
41 template <typename T> MDiagArray2<T> operator * (const T&, |
2a99b8b250cd
MArray macro removal without loss of functionality to improve maintainability.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
20791
diff
changeset
|
42 const MDiagArray2<T>&); |
2a99b8b250cd
MArray macro removal without loss of functionality to improve maintainability.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
20791
diff
changeset
|
43 template <typename T> MDiagArray2<T> operator + (const MDiagArray2<T>&, |
2a99b8b250cd
MArray macro removal without loss of functionality to improve maintainability.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
20791
diff
changeset
|
44 const MDiagArray2<T>&); |
2a99b8b250cd
MArray macro removal without loss of functionality to improve maintainability.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
20791
diff
changeset
|
45 template <typename T> MDiagArray2<T> operator - (const MDiagArray2<T>&, |
2a99b8b250cd
MArray macro removal without loss of functionality to improve maintainability.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
20791
diff
changeset
|
46 const MDiagArray2<T>&); |
2a99b8b250cd
MArray macro removal without loss of functionality to improve maintainability.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
20791
diff
changeset
|
47 template <typename T> MDiagArray2<T> product (const MDiagArray2<T>&, |
2a99b8b250cd
MArray macro removal without loss of functionality to improve maintainability.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
20791
diff
changeset
|
48 const MDiagArray2<T>&); |
3107 | 49 |
20960
2a99b8b250cd
MArray macro removal without loss of functionality to improve maintainability.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
20791
diff
changeset
|
50 //! Template for two dimensional diagonal array with math operators. |
21139
538b57866b90
consistently use "typename" intead of "class" in template declarations
John W. Eaton <jwe@octave.org>
parents:
20960
diff
changeset
|
51 template <typename T> |
3585 | 52 class |
53 MDiagArray2 : public DiagArray2<T> | |
1988 | 54 { |
55 public: | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
56 |
1988 | 57 MDiagArray2 (void) : DiagArray2<T> () { } |
3585 | 58 |
5275 | 59 MDiagArray2 (octave_idx_type r, octave_idx_type c) : DiagArray2<T> (r, c) { } |
3585 | 60 |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
61 MDiagArray2 (octave_idx_type r, octave_idx_type c, const T& val) |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
62 : DiagArray2<T> (r, c, val) { } |
3585 | 63 |
64 MDiagArray2 (const MDiagArray2<T>& a) : DiagArray2<T> (a) { } | |
65 | |
1988 | 66 MDiagArray2 (const DiagArray2<T>& a) : DiagArray2<T> (a) { } |
3585 | 67 |
21139
538b57866b90
consistently use "typename" intead of "class" in template declarations
John W. Eaton <jwe@octave.org>
parents:
20960
diff
changeset
|
68 template <typename U> |
8366
8b1a2555c4e2
implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
7789
diff
changeset
|
69 MDiagArray2 (const DiagArray2<U>& a) : DiagArray2<T> (a) { } |
8b1a2555c4e2
implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
7789
diff
changeset
|
70 |
3585 | 71 explicit MDiagArray2 (const Array<T>& a) : DiagArray2<T> (a) { } |
1988 | 72 |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
73 MDiagArray2 (const Array<T>& a, octave_idx_type r, octave_idx_type c) |
10362
b47ab50a6aa8
simplify appliers in mx-inlines.cc
Jaroslav Hajek <highegg@gmail.com>
parents:
10352
diff
changeset
|
74 : DiagArray2<T> (a, r, c) { } |
b47ab50a6aa8
simplify appliers in mx-inlines.cc
Jaroslav Hajek <highegg@gmail.com>
parents:
10352
diff
changeset
|
75 |
1988 | 76 ~MDiagArray2 (void) { } |
77 | |
78 MDiagArray2<T>& operator = (const MDiagArray2<T>& a) | |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
79 { |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
80 DiagArray2<T>::operator = (a); |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
81 return *this; |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
82 } |
1988 | 83 |
10363
a0728e81ed25
improve diag matrix interface & implementation
Jaroslav Hajek <highegg@gmail.com>
parents:
10362
diff
changeset
|
84 MArray<T> array_value () const |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
85 { |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
86 return DiagArray2<T>::array_value (); |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
87 } |
1988 | 88 |
8366
8b1a2555c4e2
implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
7789
diff
changeset
|
89 octave_idx_type nnz (void) const |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
90 { |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
91 octave_idx_type retval = 0; |
8366
8b1a2555c4e2
implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
7789
diff
changeset
|
92 |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
93 const T *d = this->data (); |
8366
8b1a2555c4e2
implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
7789
diff
changeset
|
94 |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
95 octave_idx_type nel = this->length (); |
8366
8b1a2555c4e2
implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
7789
diff
changeset
|
96 |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
97 for (octave_idx_type i = 0; i < nel; i++) |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
98 { |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
99 if (d[i] != T ()) |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
100 retval++; |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
101 } |
8366
8b1a2555c4e2
implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
7789
diff
changeset
|
102 |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
103 return retval; |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
104 } |
8366
8b1a2555c4e2
implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
7789
diff
changeset
|
105 |
8375
e3c9102431a9
fix design problems of diag & perm matrix classes
Jaroslav Hajek <highegg@gmail.com>
parents:
8367
diff
changeset
|
106 MArray<T> diag (octave_idx_type k = 0) const |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
107 { return DiagArray2<T>::extract_diag (k); } |
8375
e3c9102431a9
fix design problems of diag & perm matrix classes
Jaroslav Hajek <highegg@gmail.com>
parents:
8367
diff
changeset
|
108 |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
109 MDiagArray2<T> transpose (void) const { return DiagArray2<T>::transpose (); } |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
110 MDiagArray2<T> hermitian (T (*fcn) (const T&) = 0) const |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
111 { return DiagArray2<T>::hermitian (fcn); } |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
112 |
8367
445d27d79f4e
support permutation matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
8366
diff
changeset
|
113 bool is_multiple_of_identity (T val) const; |
445d27d79f4e
support permutation matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
8366
diff
changeset
|
114 |
3580 | 115 // Currently, the OPS functions don't need to be friends, but that |
116 // may change. | |
1988 | 117 |
20960
2a99b8b250cd
MArray macro removal without loss of functionality to improve maintainability.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
20791
diff
changeset
|
118 friend MDiagArray2<T> operator + <> (const MDiagArray2<T>&); |
2a99b8b250cd
MArray macro removal without loss of functionality to improve maintainability.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
20791
diff
changeset
|
119 friend MDiagArray2<T> operator - <> (const MDiagArray2<T>&); |
2a99b8b250cd
MArray macro removal without loss of functionality to improve maintainability.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
20791
diff
changeset
|
120 friend MDiagArray2<T> operator * <> (const MDiagArray2<T>&, const T&); |
2a99b8b250cd
MArray macro removal without loss of functionality to improve maintainability.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
20791
diff
changeset
|
121 friend MDiagArray2<T> operator / <> (const MDiagArray2<T>&, const T&); |
2a99b8b250cd
MArray macro removal without loss of functionality to improve maintainability.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
20791
diff
changeset
|
122 friend MDiagArray2<T> operator * <> (const T&, const MDiagArray2<T>&); |
2a99b8b250cd
MArray macro removal without loss of functionality to improve maintainability.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
20791
diff
changeset
|
123 friend MDiagArray2<T> operator + <> (const MDiagArray2<T>&, |
2a99b8b250cd
MArray macro removal without loss of functionality to improve maintainability.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
20791
diff
changeset
|
124 const MDiagArray2<T>&); |
2a99b8b250cd
MArray macro removal without loss of functionality to improve maintainability.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
20791
diff
changeset
|
125 friend MDiagArray2<T> operator - <> (const MDiagArray2<T>&, |
2a99b8b250cd
MArray macro removal without loss of functionality to improve maintainability.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
20791
diff
changeset
|
126 const MDiagArray2<T>&); |
2a99b8b250cd
MArray macro removal without loss of functionality to improve maintainability.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
20791
diff
changeset
|
127 friend MDiagArray2<T> product <> (const MDiagArray2<T>&, |
2a99b8b250cd
MArray macro removal without loss of functionality to improve maintainability.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
20791
diff
changeset
|
128 const MDiagArray2<T>&); |
3580 | 129 |
130 }; | |
1988 | 131 |
22197
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
132 #define MDIAGARRAY2_FORWARD_DEFS(B, R, T) \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
133 inline R \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
134 operator + (const R& x) \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
135 { \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
136 return R (operator + (dynamic_cast<const B<T>&> (x))); \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
137 } \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
138 inline R \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
139 operator - (const R& x) \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
140 { \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
141 return R (operator - (dynamic_cast<const B<T>&> (x))); \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
142 } \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
143 inline R \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
144 operator * (const R& x, const T& y) \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
145 { \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
146 return R (operator * (dynamic_cast<const B<T>&> (x), (y))); \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
147 } \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
148 inline R \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
149 operator / (const R& x, const T& y) \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
150 { \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
151 return R (operator / (dynamic_cast<const B<T>&> (x), (y))); \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
152 } \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
153 inline R \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
154 operator * (const T& x, const R& y) \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
155 { \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
156 return R (operator * ( (x), dynamic_cast<const B<T>&> (y))); \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
157 } \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
158 inline R \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
159 operator + (const R& x, const R& y) \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
160 { \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
161 return R (operator + (dynamic_cast<const B<T>&> (x), \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
162 dynamic_cast<const B<T>&> (y))); \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
163 } \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
164 inline R \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
165 operator - (const R& x, const R& y) \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
166 { \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
167 return R (operator - (dynamic_cast<const B<T>&> (x), \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
168 dynamic_cast<const B<T>&> (y))); \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
169 } \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
170 inline R \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
171 product (const R& x, const R& y) \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
172 { \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
173 return R (product (dynamic_cast<const B<T>&> (x), \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
174 dynamic_cast<const B<T>&> (y))); \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
175 } |
20960
2a99b8b250cd
MArray macro removal without loss of functionality to improve maintainability.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
20791
diff
changeset
|
176 |
1988 | 177 #endif |