Mercurial > octave
annotate liboctave/array/MArray.h @ 32628:ae4e19c0a2b1
maint: Place class name and class keyword on one line.
* libinterp/corefcn/Cell.h, libinterp/corefcn/__magick_read__.cc,
libinterp/corefcn/auto-shlib.h, libinterp/corefcn/base-text-renderer.h,
libinterp/corefcn/c-file-ptr-stream.h, libinterp/corefcn/call-stack.h,
libinterp/corefcn/dynamic-ld.h, libinterp/corefcn/event-manager.h,
libinterp/corefcn/event-queue.h, libinterp/corefcn/ft-text-renderer.cc,
libinterp/corefcn/gl-render.cc, libinterp/corefcn/gl-render.h,
libinterp/corefcn/gl2ps-print.cc, libinterp/corefcn/graphics.cc,
libinterp/corefcn/graphics.in.h, libinterp/corefcn/input.cc,
libinterp/corefcn/latex-text-renderer.cc, libinterp/corefcn/load-path.h,
libinterp/corefcn/mx-type-traits.h, libinterp/corefcn/oct-errno.h,
libinterp/corefcn/oct-fstrm.h, libinterp/corefcn/oct-iostrm.h,
libinterp/corefcn/oct-prcstrm.h, libinterp/corefcn/oct-procbuf.h,
libinterp/corefcn/oct-process.h, libinterp/corefcn/oct-stdstrm.h,
libinterp/corefcn/oct-stream.cc, libinterp/corefcn/oct-stream.h,
libinterp/corefcn/oct-strstrm.h, libinterp/corefcn/pager.h,
libinterp/corefcn/pr-flt-fmt.h, libinterp/corefcn/pr-output.cc,
libinterp/corefcn/pr-output.h, libinterp/corefcn/procstream.h,
libinterp/corefcn/syminfo.h, libinterp/corefcn/text-engine.h,
libinterp/corefcn/text-renderer.h, libinterp/corefcn/utils.h,
libinterp/octave-value/cdef-class.h, libinterp/octave-value/cdef-manager.h,
libinterp/octave-value/cdef-method.h, libinterp/octave-value/cdef-object.h,
libinterp/octave-value/cdef-package.h, libinterp/octave-value/cdef-property.h,
libinterp/octave-value/ov-base-diag.h, libinterp/octave-value/ov-base-int.h,
libinterp/octave-value/ov-base-mat.h, libinterp/octave-value/ov-base-scalar.h,
libinterp/octave-value/ov-base-sparse.h, libinterp/octave-value/ov-base.h,
libinterp/octave-value/ov-bool-mat.h, libinterp/octave-value/ov-bool-sparse.h,
libinterp/octave-value/ov-bool.h, libinterp/octave-value/ov-builtin.h,
libinterp/octave-value/ov-cell.h, libinterp/octave-value/ov-ch-mat.h,
libinterp/octave-value/ov-class.cc, libinterp/octave-value/ov-class.h,
libinterp/octave-value/ov-classdef.h, libinterp/octave-value/ov-colon.h,
libinterp/octave-value/ov-complex.h, libinterp/octave-value/ov-cs-list.h,
libinterp/octave-value/ov-cx-diag.h, libinterp/octave-value/ov-cx-mat.h,
libinterp/octave-value/ov-cx-sparse.h, libinterp/octave-value/ov-dld-fcn.h,
libinterp/octave-value/ov-fcn-handle.h, libinterp/octave-value/ov-fcn.h,
libinterp/octave-value/ov-float.h, libinterp/octave-value/ov-flt-complex.h,
libinterp/octave-value/ov-flt-cx-diag.h,
libinterp/octave-value/ov-flt-cx-mat.h,
libinterp/octave-value/ov-flt-re-diag.h,
libinterp/octave-value/ov-flt-re-mat.h, libinterp/octave-value/ov-int-traits.h,
libinterp/octave-value/ov-intx.h, libinterp/octave-value/ov-lazy-idx.h,
libinterp/octave-value/ov-legacy-range.cc,
libinterp/octave-value/ov-legacy-range.h,
libinterp/octave-value/ov-magic-int.h, libinterp/octave-value/ov-mex-fcn.h,
libinterp/octave-value/ov-null-mat.h, libinterp/octave-value/ov-perm.h,
libinterp/octave-value/ov-range-traits.h, libinterp/octave-value/ov-range.h,
libinterp/octave-value/ov-re-diag.h, libinterp/octave-value/ov-re-mat.h,
libinterp/octave-value/ov-re-sparse.h, libinterp/octave-value/ov-scalar.h,
libinterp/octave-value/ov-str-mat.h, libinterp/octave-value/ov-struct.h,
libinterp/octave-value/ov-typeinfo.h, libinterp/octave-value/ov-usr-fcn.h,
libinterp/octave-value/ov.h, libinterp/octave-value/ovl.h,
libinterp/parse-tree/comment-list.h, libinterp/parse-tree/lex.h,
libinterp/parse-tree/profiler.h, libinterp/parse-tree/pt-anon-scopes.h,
liboctave/array/Array.h, liboctave/array/CColVector.h,
liboctave/array/CDiagMatrix.h, liboctave/array/CMatrix.h,
liboctave/array/CNDArray.h, liboctave/array/CRowVector.h,
liboctave/array/CSparse.h, liboctave/array/DiagArray2.h,
liboctave/array/MArray.h, liboctave/array/MDiagArray2.h,
liboctave/array/MSparse.h, liboctave/array/MatrixType.h,
liboctave/array/Range.h, liboctave/array/Sparse.h,
liboctave/array/boolMatrix.h, liboctave/array/boolNDArray.h,
liboctave/array/boolSparse.h, liboctave/array/chMatrix.h,
liboctave/array/chNDArray.h, liboctave/array/dColVector.h,
liboctave/array/dDiagMatrix.h, liboctave/array/dMatrix.h,
liboctave/array/dNDArray.h, liboctave/array/dRowVector.h,
liboctave/array/dSparse.h, liboctave/array/dim-vector.h,
liboctave/array/fCColVector.h, liboctave/array/fCDiagMatrix.h,
liboctave/array/fCMatrix.h, liboctave/array/fCNDArray.h,
liboctave/array/fCRowVector.h, liboctave/array/fColVector.h,
liboctave/array/fDiagMatrix.h, liboctave/array/fMatrix.h,
liboctave/array/fNDArray.h, liboctave/array/fRowVector.h,
liboctave/array/idx-vector.h, liboctave/array/intNDArray.h,
liboctave/numeric/DAE.h, liboctave/numeric/DAEFunc.h,
liboctave/numeric/DAERT.h, liboctave/numeric/DAERTFunc.h,
liboctave/numeric/DASPK.h, liboctave/numeric/DASRT.h,
liboctave/numeric/DASSL.h, liboctave/numeric/DET.h, liboctave/numeric/EIG.h,
liboctave/numeric/LSODE.h, liboctave/numeric/ODE.h,
liboctave/numeric/ODEFunc.h, liboctave/numeric/ODES.h,
liboctave/numeric/ODESFunc.h, liboctave/numeric/Quad.h,
liboctave/numeric/aepbalance.h, liboctave/numeric/base-dae.h,
liboctave/numeric/base-de.h, liboctave/numeric/chol.h,
liboctave/numeric/fEIG.h, liboctave/numeric/gepbalance.h,
liboctave/numeric/gsvd.h, liboctave/numeric/hess.h, liboctave/numeric/lu.h,
liboctave/numeric/oct-fftw.h, liboctave/numeric/qr.h, liboctave/numeric/qrp.h,
liboctave/numeric/schur.h, liboctave/numeric/sparse-chol.h,
liboctave/numeric/sparse-lu.h, liboctave/numeric/sparse-qr.cc,
liboctave/numeric/sparse-qr.h, liboctave/numeric/svd.cc,
liboctave/numeric/svd.h, liboctave/system/dir-ops.h,
liboctave/system/file-stat.h, liboctave/system/oct-env.h,
liboctave/system/oct-group.h, liboctave/system/oct-password.h,
liboctave/system/oct-time.h, liboctave/system/oct-uname.h,
liboctave/util/action-container.h, liboctave/util/base-list.h,
liboctave/util/cmd-edit.cc, liboctave/util/cmd-edit.h,
liboctave/util/cmd-hist.cc, liboctave/util/cmd-hist.h,
liboctave/util/data-conv.h, liboctave/util/glob-match.h,
liboctave/util/lo-regexp.h, liboctave/util/oct-inttypes.h,
liboctave/util/oct-mutex.cc, liboctave/util/oct-mutex.h,
liboctave/util/oct-shlib.cc, liboctave/util/oct-shlib.h,
liboctave/util/oct-sort.h, liboctave/util/oct-string.h,
liboctave/util/octave-preserve-stream-state.h, liboctave/util/pathsearch.h,
liboctave/util/singleton-cleanup.h, liboctave/util/str-vec.h,
liboctave/util/unwind-prot.h, liboctave/util/url-transfer.h:
Place class name and class keyword on one line.
author | Rik <rik@octave.org> |
---|---|
date | Thu, 21 Dec 2023 11:22:26 -0800 |
parents | 21f9b34eb893 |
children | 4b601ca024d5 |
rev | line source |
---|---|
27923
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
1 //////////////////////////////////////////////////////////////////////// |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
2 // |
31706
597f3ee61a48
update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents:
30564
diff
changeset
|
3 // Copyright (C) 1993-2023 The Octave Project Developers |
27923
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
4 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
5 // See the file COPYRIGHT.md in the top-level directory of this |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
6 // distribution or <https://octave.org/copyright/>. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
7 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
8 // This file is part of Octave. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
9 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
10 // Octave is free software: you can redistribute it and/or modify it |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
11 // under the terms of the GNU General Public License as published by |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
12 // the Free Software Foundation, either version 3 of the License, or |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
13 // (at your option) any later version. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
14 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
15 // Octave is distributed in the hope that it will be useful, but |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
16 // WITHOUT ANY WARRANTY; without even the implied warranty of |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
18 // GNU General Public License for more details. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
19 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
20 // You should have received a copy of the GNU General Public License |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
21 // along with Octave; see the file COPYING. If not, see |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
22 // <https://www.gnu.org/licenses/>. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
23 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
24 //////////////////////////////////////////////////////////////////////// |
237 | 25 |
20791
f7084eae3318
maint: Use Octave coding conventions for #if statements.
Rik <rik@octave.org>
parents:
19697
diff
changeset
|
26 #if ! defined (octave_MArray_h) |
382 | 27 #define octave_MArray_h 1 |
28 | |
21244
1473547f50f5
include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents:
21139
diff
changeset
|
29 #include "octave-config.h" |
1473547f50f5
include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents:
21139
diff
changeset
|
30 |
237 | 31 #include "Array.h" |
30489
bd67d0045e21
use separate files for MArray, intNDArray, and range template forward decls
John W. Eaton <jwe@octave.org>
parents:
29949
diff
changeset
|
32 #include "MArray-fwd.h" |
20960
2a99b8b250cd
MArray macro removal without loss of functionality to improve maintainability.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
20791
diff
changeset
|
33 #include "mx-inlines.cc" |
237 | 34 |
30489
bd67d0045e21
use separate files for MArray, intNDArray, and range template forward decls
John W. Eaton <jwe@octave.org>
parents:
29949
diff
changeset
|
35 template <typename T> OCTARRAY_API MArray<T>& operator += (MArray<T>&, const T&); |
bd67d0045e21
use separate files for MArray, intNDArray, and range template forward decls
John W. Eaton <jwe@octave.org>
parents:
29949
diff
changeset
|
36 template <typename T> OCTARRAY_API MArray<T>& operator -= (MArray<T>&, const T&); |
bd67d0045e21
use separate files for MArray, intNDArray, and range template forward decls
John W. Eaton <jwe@octave.org>
parents:
29949
diff
changeset
|
37 template <typename T> OCTARRAY_API MArray<T>& operator *= (MArray<T>&, const T&); |
bd67d0045e21
use separate files for MArray, intNDArray, and range template forward decls
John W. Eaton <jwe@octave.org>
parents:
29949
diff
changeset
|
38 template <typename T> OCTARRAY_API MArray<T>& operator /= (MArray<T>&, const T&); |
bd67d0045e21
use separate files for MArray, intNDArray, and range template forward decls
John W. Eaton <jwe@octave.org>
parents:
29949
diff
changeset
|
39 template <typename T> OCTARRAY_API MArray<T>& operator += (MArray<T>&, const MArray<T>&); |
bd67d0045e21
use separate files for MArray, intNDArray, and range template forward decls
John W. Eaton <jwe@octave.org>
parents:
29949
diff
changeset
|
40 template <typename T> OCTARRAY_API MArray<T>& operator -= (MArray<T>&, const MArray<T>&); |
bd67d0045e21
use separate files for MArray, intNDArray, and range template forward decls
John W. Eaton <jwe@octave.org>
parents:
29949
diff
changeset
|
41 template <typename T> OCTARRAY_API MArray<T>& product_eq (MArray<T>&, const MArray<T>&); |
bd67d0045e21
use separate files for MArray, intNDArray, and range template forward decls
John W. Eaton <jwe@octave.org>
parents:
29949
diff
changeset
|
42 template <typename T> OCTARRAY_API MArray<T>& quotient_eq (MArray<T>&, const MArray<T>&); |
bd67d0045e21
use separate files for MArray, intNDArray, and range template forward decls
John W. Eaton <jwe@octave.org>
parents:
29949
diff
changeset
|
43 template <typename T> OCTARRAY_API MArray<T> operator + (const MArray<T>&); |
bd67d0045e21
use separate files for MArray, intNDArray, and range template forward decls
John W. Eaton <jwe@octave.org>
parents:
29949
diff
changeset
|
44 template <typename T> OCTARRAY_API MArray<T> operator - (const MArray<T>&); |
bd67d0045e21
use separate files for MArray, intNDArray, and range template forward decls
John W. Eaton <jwe@octave.org>
parents:
29949
diff
changeset
|
45 template <typename T> OCTARRAY_API MArray<T> operator + (const MArray<T>&, const T&); |
bd67d0045e21
use separate files for MArray, intNDArray, and range template forward decls
John W. Eaton <jwe@octave.org>
parents:
29949
diff
changeset
|
46 template <typename T> OCTARRAY_API MArray<T> operator - (const MArray<T>&, const T&); |
bd67d0045e21
use separate files for MArray, intNDArray, and range template forward decls
John W. Eaton <jwe@octave.org>
parents:
29949
diff
changeset
|
47 template <typename T> OCTARRAY_API MArray<T> operator * (const MArray<T>&, const T&); |
bd67d0045e21
use separate files for MArray, intNDArray, and range template forward decls
John W. Eaton <jwe@octave.org>
parents:
29949
diff
changeset
|
48 template <typename T> OCTARRAY_API MArray<T> operator / (const MArray<T>&, const T&); |
bd67d0045e21
use separate files for MArray, intNDArray, and range template forward decls
John W. Eaton <jwe@octave.org>
parents:
29949
diff
changeset
|
49 template <typename T> OCTARRAY_API MArray<T> operator + (const T&, const MArray<T>&); |
bd67d0045e21
use separate files for MArray, intNDArray, and range template forward decls
John W. Eaton <jwe@octave.org>
parents:
29949
diff
changeset
|
50 template <typename T> OCTARRAY_API MArray<T> operator - (const T&, const MArray<T>&); |
bd67d0045e21
use separate files for MArray, intNDArray, and range template forward decls
John W. Eaton <jwe@octave.org>
parents:
29949
diff
changeset
|
51 template <typename T> OCTARRAY_API MArray<T> operator * (const T&, const MArray<T>&); |
bd67d0045e21
use separate files for MArray, intNDArray, and range template forward decls
John W. Eaton <jwe@octave.org>
parents:
29949
diff
changeset
|
52 template <typename T> OCTARRAY_API MArray<T> operator / (const T&, const MArray<T>&); |
bd67d0045e21
use separate files for MArray, intNDArray, and range template forward decls
John W. Eaton <jwe@octave.org>
parents:
29949
diff
changeset
|
53 template <typename T> OCTARRAY_API MArray<T> operator + (const MArray<T>&, const MArray<T>&); |
bd67d0045e21
use separate files for MArray, intNDArray, and range template forward decls
John W. Eaton <jwe@octave.org>
parents:
29949
diff
changeset
|
54 template <typename T> OCTARRAY_API MArray<T> operator - (const MArray<T>&, const MArray<T>&); |
bd67d0045e21
use separate files for MArray, intNDArray, and range template forward decls
John W. Eaton <jwe@octave.org>
parents:
29949
diff
changeset
|
55 template <typename T> OCTARRAY_API MArray<T> quotient (const MArray<T>&, const MArray<T>&); |
bd67d0045e21
use separate files for MArray, intNDArray, and range template forward decls
John W. Eaton <jwe@octave.org>
parents:
29949
diff
changeset
|
56 template <typename T> OCTARRAY_API MArray<T> product (const MArray<T>&, const MArray<T>&); |
3107 | 57 |
20960
2a99b8b250cd
MArray macro removal without loss of functionality to improve maintainability.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
20791
diff
changeset
|
58 //! Template for N-dimensional array classes with like-type math operators. |
21139
538b57866b90
consistently use "typename" intead of "class" in template declarations
John W. Eaton <jwe@octave.org>
parents:
20960
diff
changeset
|
59 template <typename T> |
32628
ae4e19c0a2b1
maint: Place class name and class keyword on one line.
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
60 class OCTARRAY_API MArray : public Array<T> |
237 | 61 { |
62 public: | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11570
diff
changeset
|
63 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
64 MArray () : Array<T> () { } |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11570
diff
changeset
|
65 |
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11570
diff
changeset
|
66 explicit MArray (const dim_vector& dv) |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10158
diff
changeset
|
67 : Array<T> (dv) { } |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11570
diff
changeset
|
68 |
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11570
diff
changeset
|
69 explicit MArray (const dim_vector& dv, const T& val) |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10158
diff
changeset
|
70 : Array<T> (dv, val) { } |
3585 | 71 |
72 MArray (const MArray<T>& a) : Array<T> (a) { } | |
73 | |
21139
538b57866b90
consistently use "typename" intead of "class" in template declarations
John W. Eaton <jwe@octave.org>
parents:
20960
diff
changeset
|
74 template <typename U> |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10158
diff
changeset
|
75 MArray (const Array<U>& a) : Array<T> (a) { } |
237 | 76 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
77 ~MArray () = default; |
1230 | 78 |
237 | 79 MArray<T>& operator = (const MArray<T>& a) |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
80 { |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
81 Array<T>::operator = (a); |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
82 return *this; |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
83 } |
3573 | 84 |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10158
diff
changeset
|
85 MArray<T> reshape (const dim_vector& new_dims) const |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
86 { return Array<T>::reshape (new_dims); } |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10158
diff
changeset
|
87 |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11570
diff
changeset
|
88 MArray<T> permute (const Array<octave_idx_type>& vec, |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
89 bool inv = false) const |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
90 { return Array<T>::permute (vec, inv); } |
9612
66970dd627f6
further liboctave design improvements
Jaroslav Hajek <highegg@gmail.com>
parents:
8934
diff
changeset
|
91 |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10158
diff
changeset
|
92 MArray<T> ipermute (const Array<octave_idx_type>& vec) const |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
93 { return Array<T>::ipermute (vec); } |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7503
diff
changeset
|
94 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
95 MArray squeeze () const { return Array<T>::squeeze (); } |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10158
diff
changeset
|
96 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
97 MArray<T> transpose () const |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
98 { return Array<T>::transpose (); } |
5602 | 99 |
23795
980f39c3ab90
Use C++11 nullptr rather than 0 in code (bug #51565).
Rik <rik@octave.org>
parents:
23220
diff
changeset
|
100 MArray<T> hermitian (T (*fcn) (const T&) = nullptr) const |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
101 { return Array<T>::hermitian (fcn); } |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10158
diff
changeset
|
102 |
20960
2a99b8b250cd
MArray macro removal without loss of functionality to improve maintainability.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
20791
diff
changeset
|
103 //! Performs indexed accumulative addition. |
2a99b8b250cd
MArray macro removal without loss of functionality to improve maintainability.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
20791
diff
changeset
|
104 //@{ |
30489
bd67d0045e21
use separate files for MArray, intNDArray, and range template forward decls
John W. Eaton <jwe@octave.org>
parents:
29949
diff
changeset
|
105 OCTARRAY_API void idx_add (const octave::idx_vector& idx, T val); |
bd67d0045e21
use separate files for MArray, intNDArray, and range template forward decls
John W. Eaton <jwe@octave.org>
parents:
29949
diff
changeset
|
106 OCTARRAY_API void |
29646
3e8bc8bee8e9
liboctave/array: Add visibility flags to functions declared in headers (bug #60567).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29569
diff
changeset
|
107 idx_add (const octave::idx_vector& idx, const MArray<T>& vals); |
20960
2a99b8b250cd
MArray macro removal without loss of functionality to improve maintainability.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
20791
diff
changeset
|
108 //@} |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10158
diff
changeset
|
109 |
30489
bd67d0045e21
use separate files for MArray, intNDArray, and range template forward decls
John W. Eaton <jwe@octave.org>
parents:
29949
diff
changeset
|
110 OCTARRAY_API void |
29646
3e8bc8bee8e9
liboctave/array: Add visibility flags to functions declared in headers (bug #60567).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29569
diff
changeset
|
111 idx_min (const octave::idx_vector& idx, const MArray<T>& vals); |
7503
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
112 |
30489
bd67d0045e21
use separate files for MArray, intNDArray, and range template forward decls
John W. Eaton <jwe@octave.org>
parents:
29949
diff
changeset
|
113 OCTARRAY_API void |
29646
3e8bc8bee8e9
liboctave/array: Add visibility flags to functions declared in headers (bug #60567).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29569
diff
changeset
|
114 idx_max (const octave::idx_vector& idx, const MArray<T>& vals); |
3573 | 115 |
30489
bd67d0045e21
use separate files for MArray, intNDArray, and range template forward decls
John W. Eaton <jwe@octave.org>
parents:
29949
diff
changeset
|
116 OCTARRAY_API void |
29646
3e8bc8bee8e9
liboctave/array: Add visibility flags to functions declared in headers (bug #60567).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29569
diff
changeset
|
117 idx_add_nd (const octave::idx_vector& idx, const MArray<T>& vals, |
3e8bc8bee8e9
liboctave/array: Add visibility flags to functions declared in headers (bug #60567).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29569
diff
changeset
|
118 int dim = -1); |
10396
a0b51ac0f88a
optimize accumdim with summation
Jaroslav Hajek <highegg@gmail.com>
parents:
10364
diff
changeset
|
119 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
120 OCTARRAY_API void changesign (); |
30489
bd67d0045e21
use separate files for MArray, intNDArray, and range template forward decls
John W. Eaton <jwe@octave.org>
parents:
29949
diff
changeset
|
121 |
bd67d0045e21
use separate files for MArray, intNDArray, and range template forward decls
John W. Eaton <jwe@octave.org>
parents:
29949
diff
changeset
|
122 private: |
bd67d0045e21
use separate files for MArray, intNDArray, and range template forward decls
John W. Eaton <jwe@octave.org>
parents:
29949
diff
changeset
|
123 OCTARRAY_API static void instantiation_guard (); |
237 | 124 }; |
125 | |
20960
2a99b8b250cd
MArray macro removal without loss of functionality to improve maintainability.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
20791
diff
changeset
|
126 // Define all the MArray forwarding functions for return type R and |
2a99b8b250cd
MArray macro removal without loss of functionality to improve maintainability.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
20791
diff
changeset
|
127 // MArray element type T |
22197
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
128 #define MARRAY_FORWARD_DEFS(B, R, T) \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
129 inline R operator += (R& x, const T& y) \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
130 { \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
131 return R (operator += (dynamic_cast<B<T>&> (x), (y))); \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
132 } \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
133 inline R operator -= (R& x, const T& y) \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
134 { \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
135 return R (operator -= (dynamic_cast<B<T>&> (x), (y))); \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
136 } \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
137 inline R operator *= (R& x, const T& y) \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
138 { \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
139 return R (operator *= (dynamic_cast<B<T>&> (x), (y))); \ |
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 inline R operator /= (R& x, const T& y) \ |
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 return R (operator /= (dynamic_cast<B<T>&> (x), (y))); \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
144 } \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
145 inline R operator += (R& x, const R& y) \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
146 { \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
147 return R (operator += (dynamic_cast<B<T>&> (x), \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
148 dynamic_cast<const B<T>&> (y))); \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
149 } \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
150 inline R operator -= (R& x, const R& y) \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
151 { \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
152 return R (operator -= (dynamic_cast<B<T>&> (x), \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
153 dynamic_cast<const B<T>&> (y))); \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
154 } \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
155 inline R product_eq (R& x, const R& y) \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
156 { \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
157 return R (product_eq (dynamic_cast<B<T>&> (x), \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
158 dynamic_cast<const B<T>&> (y))); \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
159 } \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
160 inline R quotient_eq (R& x, const R& y) \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
161 { \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
162 return R (quotient_eq (dynamic_cast<B<T>&> (x), \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
163 dynamic_cast<const B<T>&> (y))); \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
164 } \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
165 inline R operator + (const R& x) \ |
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 } \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
169 inline R operator - (const R& x) \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
170 { \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
171 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
|
172 } \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
173 inline R operator + (const R& x, const T& y) \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
174 { \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
175 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
|
176 } \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
177 inline R operator - (const R& x, const T& y) \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
178 { \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
179 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
|
180 } \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
181 inline R operator * (const R& x, const T& y) \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
182 { \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
183 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
|
184 } \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
185 inline R operator / (const R& x, const T& y) \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
186 { \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
187 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
|
188 } \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
189 inline R operator + (const T& x, const R& y) \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
190 { \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
191 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
|
192 } \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
193 inline R operator - (const T& x, const R& y) \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
194 { \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
195 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
|
196 } \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
197 inline R operator * (const T& x, const R& y) \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
198 { \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
199 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
|
200 } \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
201 inline R operator / (const T& x, const R& y) \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
202 { \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
203 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
|
204 } \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
205 inline R operator + (const R& x, const R& y) \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
206 { \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
207 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
|
208 dynamic_cast<const B<T>&> (y))); \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
209 } \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
210 inline R operator - (const R& x, const R& y) \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
211 { \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
212 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
|
213 dynamic_cast<const B<T>&> (y))); \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
214 } \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
215 inline R product (const R& x, const R& y) \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
216 { \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
217 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
|
218 dynamic_cast<const B<T>&> (y))); \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
219 } \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
220 inline R quotient (const R& x, const R& y) \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
221 { \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
222 return R (quotient (dynamic_cast<const B<T>&> (x), \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
223 dynamic_cast<const B<T>&> (y))); \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
224 } |
20960
2a99b8b250cd
MArray macro removal without loss of functionality to improve maintainability.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
20791
diff
changeset
|
225 |
2a99b8b250cd
MArray macro removal without loss of functionality to improve maintainability.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
20791
diff
changeset
|
226 // Instantiate all the MArray friends for MArray element type T. |
22197
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
227 #define INSTANTIATE_MARRAY_FRIENDS(T, API) \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
228 template API MArray<T>& operator += (MArray<T>&, const T&); \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
229 template API MArray<T>& operator -= (MArray<T>&, const T&); \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
230 template API MArray<T>& operator *= (MArray<T>&, const T&); \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
231 template API MArray<T>& operator /= (MArray<T>&, const T&); \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
232 template API MArray<T>& operator += (MArray<T>&, const MArray<T>&); \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
233 template API MArray<T>& operator -= (MArray<T>&, const MArray<T>&); \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
234 template API MArray<T>& product_eq (MArray<T>&, const MArray<T>&); \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
235 template API MArray<T>& quotient_eq (MArray<T>&, const MArray<T>&); \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
236 template API MArray<T> operator + (const MArray<T>&); \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
237 template API MArray<T> operator - (const MArray<T>&); \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
238 template API MArray<T> operator + (const MArray<T>&, const T&); \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
239 template API MArray<T> operator - (const MArray<T>&, const T&); \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
240 template API MArray<T> operator * (const MArray<T>&, const T&); \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
241 template API MArray<T> operator / (const MArray<T>&, const T&); \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
242 template API MArray<T> operator + (const T&, const MArray<T>&); \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
243 template API MArray<T> operator - (const T&, const MArray<T>&); \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
244 template API MArray<T> operator * (const T&, const MArray<T>&); \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
245 template API MArray<T> operator / (const T&, const MArray<T>&); \ |
20960
2a99b8b250cd
MArray macro removal without loss of functionality to improve maintainability.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
20791
diff
changeset
|
246 template API MArray<T> operator + (const MArray<T>&, const MArray<T>&); \ |
2a99b8b250cd
MArray macro removal without loss of functionality to improve maintainability.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
20791
diff
changeset
|
247 template API MArray<T> operator - (const MArray<T>&, const MArray<T>&); \ |
2a99b8b250cd
MArray macro removal without loss of functionality to improve maintainability.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
20791
diff
changeset
|
248 template API MArray<T> quotient (const MArray<T>&, const MArray<T>&); \ |
2a99b8b250cd
MArray macro removal without loss of functionality to improve maintainability.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
20791
diff
changeset
|
249 template API MArray<T> product (const MArray<T>&, const MArray<T>&); |
2a99b8b250cd
MArray macro removal without loss of functionality to improve maintainability.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
20791
diff
changeset
|
250 |
2a99b8b250cd
MArray macro removal without loss of functionality to improve maintainability.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
20791
diff
changeset
|
251 // Instantiate all the MDiagArray2 friends for MDiagArray2 element type T. |
22197
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
252 #define INSTANTIATE_MDIAGARRAY2_FRIENDS(T, API) \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
253 template API MDiagArray2<T> operator + (const MDiagArray2<T>&); \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
254 template API MDiagArray2<T> operator - (const MDiagArray2<T>&); \ |
20960
2a99b8b250cd
MArray macro removal without loss of functionality to improve maintainability.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
20791
diff
changeset
|
255 template API 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
|
256 template API 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
|
257 template API MDiagArray2<T> operator * (const T&, const MDiagArray2<T>&); \ |
22197
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
258 template API MDiagArray2<T> operator + (const MDiagArray2<T>&, \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
259 const MDiagArray2<T>&); \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
260 template API MDiagArray2<T> operator - (const MDiagArray2<T>&, \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
261 const MDiagArray2<T>&); \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
262 template API MDiagArray2<T> product (const MDiagArray2<T>&, \ |
20960
2a99b8b250cd
MArray macro removal without loss of functionality to improve maintainability.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
20791
diff
changeset
|
263 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
|
264 |
237 | 265 #endif |