Mercurial > hg > octave-lyh
annotate liboctave/MArray-defs.h @ 9612:66970dd627f6
further liboctave design improvements
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Fri, 04 Sep 2009 11:22:53 +0200 |
parents | a9b37bae1802 |
children | 12884915a8e4 |
rev | line source |
---|---|
7016 | 1 /* |
2 | |
8920 | 3 Copyright (C) 1996, 1999, 2000, 2003, 2005, 2006, 2007, 2008, |
4 2009 John W. Eaton | |
9601
a9b37bae1802
add a couple of missing copyright statements
Jaroslav Hajek <highegg@gmail.com>
parents:
9557
diff
changeset
|
5 Copyright (C) 2009 VZLU Prague, a.s. |
7016 | 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 | |
11 Free Software Foundation; either version 3 of the License, or (at your | |
12 option) any later version. | |
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 | |
20 along with Octave; see the file COPYING. If not, see | |
21 <http://www.gnu.org/licenses/>. | |
22 | |
23 */ | |
24 | |
3741 | 25 #if !defined (octave_MArray_defs_h) |
26 #define octave_MArray_defs_h 1 | |
27 | |
9612
66970dd627f6
further liboctave design improvements
Jaroslav Hajek <highegg@gmail.com>
parents:
9601
diff
changeset
|
28 #include "mx-inlines.cc" |
1988 | 29 |
3573 | 30 // Instantiate the OP= operators. |
6708 | 31 #define MARRAY_OP_ASSIGN_DEFS(A_T, E_T, RHS_T, API) \ |
32 MARRAY_OP_ASSIGN_DECLS (A_T, E_T, template, API, , RHS_T) | |
3573 | 33 |
9546
1beb23d2b892
optimize op= in common cases
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
34 #define MARRAY_OP_ASSIGN_DEFS1(A_T, E_T, RHS_T, API) \ |
1beb23d2b892
optimize op= in common cases
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
35 MARRAY_OP_ASSIGN_DECLS1 (A_T, E_T, template, API, , RHS_T) |
1beb23d2b892
optimize op= in common cases
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
36 |
3573 | 37 // Instantiate the unary operators. |
6708 | 38 #define MARRAY_UNOP_DEFS(A_T, E_T, API) \ |
39 MARRAY_UNOP_DECLS (A_T, E_T, template, API, ) | |
3573 | 40 |
41 // Instantiate the binary operators. | |
6708 | 42 #define MARRAY_BINOP_DEFS(A_T, E_T, API) \ |
43 MARRAY_BINOP_DECLS (A_T, E_T, template, API, , A_T<E_T>, E_T) \ | |
44 MARRAY_BINOP_DECLS (A_T, E_T, template, API, , E_T, A_T<E_T>) \ | |
45 MARRAY_AA_BINOP_DECLS (A_T, E_T, template, API, ) | |
3573 | 46 |
6708 | 47 #define MDIAGARRAY2_BINOP_DEFS(A_T, E_T, API) \ |
48 MDIAGARRAY2_DAS_BINOP_DECLS (A_T, E_T, template, API, , A_T<E_T>, E_T) \ | |
49 MDIAGARRAY2_SDA_BINOP_DECLS (A_T, E_T, template, API, , E_T, A_T<E_T>) \ | |
50 MDIAGARRAY2_DADA_BINOP_DECLS (A_T, E_T, template, API, ) | |
3580 | 51 |
3573 | 52 // The following macros are for external use. |
53 | |
54 // Instantiate all the MArray friends for MArray element type T. | |
6708 | 55 #define INSTANTIATE_MARRAY_FRIENDS(T, API) \ |
9546
1beb23d2b892
optimize op= in common cases
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
56 MARRAY_OP_ASSIGN_DEFS1 (MArray, T, T, API) \ |
6708 | 57 MARRAY_OP_ASSIGN_DEFS (MArray, T, MArray<T>, API) \ |
58 MARRAY_UNOP_DEFS (MArray, T, API) \ | |
59 MARRAY_BINOP_DEFS (MArray, T, API) | |
3573 | 60 |
4513 | 61 // Instantiate all the MArray2 friends for MArray2 element type T. |
6708 | 62 #define INSTANTIATE_MARRAY2_FRIENDS(T, API) \ |
9546
1beb23d2b892
optimize op= in common cases
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
63 MARRAY_OP_ASSIGN_DEFS1 (MArray2, T, T, API) \ |
6708 | 64 MARRAY_OP_ASSIGN_DEFS (MArray2, T, MArray2<T>, API) \ |
65 MARRAY_UNOP_DEFS (MArray2, T, API) \ | |
66 MARRAY_BINOP_DEFS (MArray2, T, API) | |
3573 | 67 |
4513 | 68 // Instantiate all the MArrayN friends for MArrayN element type T. |
6708 | 69 #define INSTANTIATE_MARRAYN_FRIENDS(T, API) \ |
9546
1beb23d2b892
optimize op= in common cases
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
70 MARRAY_OP_ASSIGN_DEFS1 (MArrayN, T, T, API) \ |
6708 | 71 MARRAY_OP_ASSIGN_DEFS (MArrayN, T, MArrayN<T>, API) \ |
72 MARRAY_UNOP_DEFS (MArrayN, T, API) \ | |
73 MARRAY_BINOP_DEFS (MArrayN, T, API) | |
4513 | 74 |
75 // Instantiate all the MDiagArray2 friends for MDiagArray2 element type T. | |
6708 | 76 #define INSTANTIATE_MDIAGARRAY2_FRIENDS(T, API) \ |
77 MARRAY_UNOP_DEFS (MDiagArray2, T, API) \ | |
78 MDIAGARRAY2_BINOP_DEFS (MDiagArray2, T, API) | |
3580 | 79 |
3573 | 80 // Now we have all the definitions we need. |
81 | |
3741 | 82 #endif |