annotate liboctave/MArray-defs.h @ 3649:3a067b216fd6

[project @ 2000-03-31 06:02:44 by jwe]
author jwe
date Fri, 31 Mar 2000 06:02:45 +0000
parents aa8f5aa90c25
children b65077dfa1b1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3649
3a067b216fd6 [project @ 2000-03-31 06:02:44 by jwe]
jwe
parents: 3581
diff changeset
1 // Nothing like a little CPP abuse to brighten everyone's day.
1988
7b56630a1e05 [project @ 1996-03-02 00:33:22 by jwe]
jwe
parents:
diff changeset
2
3504
5eef8a2294bd [project @ 2000-02-01 10:06:51 by jwe]
jwe
parents: 3243
diff changeset
3 #define DO_VS_OP(r, l, v, OP, s) \
1988
7b56630a1e05 [project @ 1996-03-02 00:33:22 by jwe]
jwe
parents:
diff changeset
4 if (l > 0) \
7b56630a1e05 [project @ 1996-03-02 00:33:22 by jwe]
jwe
parents:
diff changeset
5 { \
7b56630a1e05 [project @ 1996-03-02 00:33:22 by jwe]
jwe
parents:
diff changeset
6 for (int i = 0; i < l; i++) \
3504
5eef8a2294bd [project @ 2000-02-01 10:06:51 by jwe]
jwe
parents: 3243
diff changeset
7 r[i] = v[i] OP s; \
1988
7b56630a1e05 [project @ 1996-03-02 00:33:22 by jwe]
jwe
parents:
diff changeset
8 }
7b56630a1e05 [project @ 1996-03-02 00:33:22 by jwe]
jwe
parents:
diff changeset
9
3504
5eef8a2294bd [project @ 2000-02-01 10:06:51 by jwe]
jwe
parents: 3243
diff changeset
10 #define DO_SV_OP(r, l, s, OP, v) \
1988
7b56630a1e05 [project @ 1996-03-02 00:33:22 by jwe]
jwe
parents:
diff changeset
11 if (l > 0) \
7b56630a1e05 [project @ 1996-03-02 00:33:22 by jwe]
jwe
parents:
diff changeset
12 { \
7b56630a1e05 [project @ 1996-03-02 00:33:22 by jwe]
jwe
parents:
diff changeset
13 for (int i = 0; i < l; i++) \
3504
5eef8a2294bd [project @ 2000-02-01 10:06:51 by jwe]
jwe
parents: 3243
diff changeset
14 r[i] = s OP v[i]; \
1988
7b56630a1e05 [project @ 1996-03-02 00:33:22 by jwe]
jwe
parents:
diff changeset
15 }
7b56630a1e05 [project @ 1996-03-02 00:33:22 by jwe]
jwe
parents:
diff changeset
16
3504
5eef8a2294bd [project @ 2000-02-01 10:06:51 by jwe]
jwe
parents: 3243
diff changeset
17 #define DO_VV_OP(r, l, x, OP, y) \
1988
7b56630a1e05 [project @ 1996-03-02 00:33:22 by jwe]
jwe
parents:
diff changeset
18 if (l > 0) \
7b56630a1e05 [project @ 1996-03-02 00:33:22 by jwe]
jwe
parents:
diff changeset
19 { \
7b56630a1e05 [project @ 1996-03-02 00:33:22 by jwe]
jwe
parents:
diff changeset
20 for (int i = 0; i < l; i++) \
3504
5eef8a2294bd [project @ 2000-02-01 10:06:51 by jwe]
jwe
parents: 3243
diff changeset
21 r[i] = x[i] OP y[i]; \
1988
7b56630a1e05 [project @ 1996-03-02 00:33:22 by jwe]
jwe
parents:
diff changeset
22 }
7b56630a1e05 [project @ 1996-03-02 00:33:22 by jwe]
jwe
parents:
diff changeset
23
3504
5eef8a2294bd [project @ 2000-02-01 10:06:51 by jwe]
jwe
parents: 3243
diff changeset
24 #define NEG_V(r, l, x) \
1988
7b56630a1e05 [project @ 1996-03-02 00:33:22 by jwe]
jwe
parents:
diff changeset
25 if (l > 0) \
7b56630a1e05 [project @ 1996-03-02 00:33:22 by jwe]
jwe
parents:
diff changeset
26 { \
7b56630a1e05 [project @ 1996-03-02 00:33:22 by jwe]
jwe
parents:
diff changeset
27 for (int i = 0; i < l; i++) \
3504
5eef8a2294bd [project @ 2000-02-01 10:06:51 by jwe]
jwe
parents: 3243
diff changeset
28 r[i] = -x[i]; \
1988
7b56630a1e05 [project @ 1996-03-02 00:33:22 by jwe]
jwe
parents:
diff changeset
29 }
7b56630a1e05 [project @ 1996-03-02 00:33:22 by jwe]
jwe
parents:
diff changeset
30
7b56630a1e05 [project @ 1996-03-02 00:33:22 by jwe]
jwe
parents:
diff changeset
31 #define DO_VS_OP2(OP) \
7b56630a1e05 [project @ 1996-03-02 00:33:22 by jwe]
jwe
parents:
diff changeset
32 int l = a.length (); \
7b56630a1e05 [project @ 1996-03-02 00:33:22 by jwe]
jwe
parents:
diff changeset
33 if (l > 0) \
7b56630a1e05 [project @ 1996-03-02 00:33:22 by jwe]
jwe
parents:
diff changeset
34 { \
7b56630a1e05 [project @ 1996-03-02 00:33:22 by jwe]
jwe
parents:
diff changeset
35 T *tmp = a.fortran_vec (); \
7b56630a1e05 [project @ 1996-03-02 00:33:22 by jwe]
jwe
parents:
diff changeset
36 for (int i = 0; i < l; i++) \
7b56630a1e05 [project @ 1996-03-02 00:33:22 by jwe]
jwe
parents:
diff changeset
37 tmp[i] OP s; \
7b56630a1e05 [project @ 1996-03-02 00:33:22 by jwe]
jwe
parents:
diff changeset
38 }
7b56630a1e05 [project @ 1996-03-02 00:33:22 by jwe]
jwe
parents:
diff changeset
39
7b56630a1e05 [project @ 1996-03-02 00:33:22 by jwe]
jwe
parents:
diff changeset
40 #define DO_VV_OP2(OP) \
7b56630a1e05 [project @ 1996-03-02 00:33:22 by jwe]
jwe
parents:
diff changeset
41 do \
7b56630a1e05 [project @ 1996-03-02 00:33:22 by jwe]
jwe
parents:
diff changeset
42 { \
7b56630a1e05 [project @ 1996-03-02 00:33:22 by jwe]
jwe
parents:
diff changeset
43 T *a_tmp = a.fortran_vec (); \
7b56630a1e05 [project @ 1996-03-02 00:33:22 by jwe]
jwe
parents:
diff changeset
44 const T *b_tmp = b.data (); \
7b56630a1e05 [project @ 1996-03-02 00:33:22 by jwe]
jwe
parents:
diff changeset
45 for (int i = 0; i < l; i++) \
3243
dd00769643ae [project @ 1999-05-28 04:19:00 by jwe]
jwe
parents: 1988
diff changeset
46 a_tmp[i] OP b_tmp[i]; \
1988
7b56630a1e05 [project @ 1996-03-02 00:33:22 by jwe]
jwe
parents:
diff changeset
47 } \
7b56630a1e05 [project @ 1996-03-02 00:33:22 by jwe]
jwe
parents:
diff changeset
48 while (0)
7b56630a1e05 [project @ 1996-03-02 00:33:22 by jwe]
jwe
parents:
diff changeset
49
3573
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
50 // A macro that can be used to declare and instantiate OP= operators.
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
51 #define MARRAY_OP_ASSIGN_DECL(A_T, E_T, OP, PFX, LTGT, RHS_T) \
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
52 PFX A_T<E_T>& \
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
53 operator OP LTGT (A_T<E_T>&, const RHS_T&)
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
54
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
55 // All the OP= operators that we care about.
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
56 #define MARRAY_OP_ASSIGN_DECLS(A_T, E_T, PFX, LTGT, RHS_T) \
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
57 MARRAY_OP_ASSIGN_DECL (A_T, E_T, +=, PFX, LTGT, RHS_T); \
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
58 MARRAY_OP_ASSIGN_DECL (A_T, E_T, -=, PFX, LTGT, RHS_T);
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
59
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
60 // Generate forward declarations for OP= operators.
3580
2923f52d8fda [project @ 2000-02-05 07:14:21 by jwe]
jwe
parents: 3574
diff changeset
61 #define MARRAY_OP_ASSIGN_FWD_DECLS(A_T, RHS_T) \
2923f52d8fda [project @ 2000-02-05 07:14:21 by jwe]
jwe
parents: 3574
diff changeset
62 MARRAY_OP_ASSIGN_DECLS (A_T, T, template <typename T>, , RHS_T)
3573
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
63
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
64 // Generate friend declarations for the OP= operators.
3580
2923f52d8fda [project @ 2000-02-05 07:14:21 by jwe]
jwe
parents: 3574
diff changeset
65 #define MARRAY_OP_ASSIGN_FRIENDS(A_T, RHS_T) \
2923f52d8fda [project @ 2000-02-05 07:14:21 by jwe]
jwe
parents: 3574
diff changeset
66 MARRAY_OP_ASSIGN_DECLS (A_T, T, friend, <>, RHS_T)
3573
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
67
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
68 // Instantiate the OP= operators.
3580
2923f52d8fda [project @ 2000-02-05 07:14:21 by jwe]
jwe
parents: 3574
diff changeset
69 #define MARRAY_OP_ASSIGN_DEFS(A_T, E_T, RHS_T) \
2923f52d8fda [project @ 2000-02-05 07:14:21 by jwe]
jwe
parents: 3574
diff changeset
70 MARRAY_OP_ASSIGN_DECLS (A_T, E_T, template, , RHS_T)
3573
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
71
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
72 // A function that can be used to forward OP= operations from derived
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
73 // classes back to us.
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
74 #define MARRAY_OP_ASSIGN_FWD_FCN(R, F, T, C_X, X_T, C_Y, Y_T) \
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
75 inline R \
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
76 F (X_T& x, const Y_T& y) \
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
77 { \
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
78 return R (F (C_X (x), C_Y (y))); \
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
79 }
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
80
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
81 // All the OP= operators that we care about forwarding.
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
82 #define MARRAY_OP_ASSIGN_FWD_DEFS(R, T, C_X, X_T, C_Y, Y_T) \
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
83 MARRAY_OP_ASSIGN_FWD_FCN (R, operator +=, T, C_X, X_T, C_Y, Y_T) \
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
84 MARRAY_OP_ASSIGN_FWD_FCN (R, operator -=, T, C_X, X_T, C_Y, Y_T)
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
85
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
86 // A macro that can be used to declare and instantiate unary operators.
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
87 #define MARRAY_UNOP(A_T, E_T, F, PFX, LTGT) \
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
88 PFX A_T<E_T> \
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
89 F LTGT (const A_T<E_T>&)
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
90
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
91 // All the unary operators that we care about.
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
92 #define MARRAY_UNOP_DECLS(A_T, E_T, PFX, LTGT) \
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
93 MARRAY_UNOP (A_T, E_T, operator +, PFX, LTGT); \
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
94 MARRAY_UNOP (A_T, E_T, operator -, PFX, LTGT);
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
95
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
96 // Generate forward declarations for unary operators.
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
97 #define MARRAY_UNOP_FWD_DECLS(A_T) \
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
98 MARRAY_UNOP_DECLS (A_T, T, template <typename T>, )
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
99
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
100 // Generate friend declarations for the unary operators.
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
101 #define MARRAY_UNOP_FRIENDS(A_T) \
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
102 MARRAY_UNOP_DECLS (A_T, T, friend, <>)
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
103
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
104 // Instantiate the unary operators.
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
105 #define MARRAY_UNOP_DEFS(A_T, E_T) \
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
106 MARRAY_UNOP_DECLS (A_T, E_T, template, )
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
107
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
108 // A function that can be used to forward unary operations from derived
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
109 // classes back to us.
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
110 #define MARRAY_UNOP_FWD_FCN(R, F, T, C_X, X_T) \
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
111 inline R \
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
112 F (const X_T& x) \
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
113 { \
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
114 return R (F (C_X (x))); \
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
115 }
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
116
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
117 // All the unary operators that we care about forwarding.
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
118 #define MARRAY_UNOP_FWD_DEFS(R, T, C_X, X_T) \
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
119 MARRAY_UNOP_FWD_FCN (R, operator +, T, C_X, X_T) \
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
120 MARRAY_UNOP_FWD_FCN (R, operator -, T, C_X, X_T)
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
121
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
122 // A macro that can be used to declare and instantiate binary operators.
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
123 #define MARRAY_BINOP_DECL(A_T, E_T, F, PFX, LTGT, X_T, Y_T) \
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
124 PFX A_T<E_T> \
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
125 F LTGT (const X_T&, const Y_T&)
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
126
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
127 // All the binary operators that we care about. We have two
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
128 // sets of macros since the MArray OP MArray operations use functions
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
129 // (product and quotient) instead of operators (*, /).
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
130 #define MARRAY_BINOP_DECLS(A_T, E_T, PFX, LTGT, X_T, Y_T) \
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
131 MARRAY_BINOP_DECL (A_T, E_T, operator +, PFX, LTGT, X_T, Y_T); \
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
132 MARRAY_BINOP_DECL (A_T, E_T, operator -, PFX, LTGT, X_T, Y_T); \
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
133 MARRAY_BINOP_DECL (A_T, E_T, operator *, PFX, LTGT, X_T, Y_T); \
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
134 MARRAY_BINOP_DECL (A_T, E_T, operator /, PFX, LTGT, X_T, Y_T);
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
135
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
136 #define MARRAY_AA_BINOP_DECLS(A_T, E_T, PFX, LTGT) \
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
137 MARRAY_BINOP_DECL (A_T, E_T, operator +, PFX, LTGT, A_T<E_T>, A_T<E_T>); \
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
138 MARRAY_BINOP_DECL (A_T, E_T, operator -, PFX, LTGT, A_T<E_T>, A_T<E_T>); \
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
139 MARRAY_BINOP_DECL (A_T, E_T, quotient, PFX, LTGT, A_T<E_T>, A_T<E_T>); \
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
140 MARRAY_BINOP_DECL (A_T, E_T, product, PFX, LTGT, A_T<E_T>, A_T<E_T>);
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
141
3580
2923f52d8fda [project @ 2000-02-05 07:14:21 by jwe]
jwe
parents: 3574
diff changeset
142 #define MDIAGARRAY2_DAS_BINOP_DECLS(A_T, E_T, PFX, LTGT, X_T, Y_T) \
2923f52d8fda [project @ 2000-02-05 07:14:21 by jwe]
jwe
parents: 3574
diff changeset
143 MARRAY_BINOP_DECL (A_T, E_T, operator *, PFX, LTGT, X_T, Y_T); \
2923f52d8fda [project @ 2000-02-05 07:14:21 by jwe]
jwe
parents: 3574
diff changeset
144 MARRAY_BINOP_DECL (A_T, E_T, operator /, PFX, LTGT, X_T, Y_T);
2923f52d8fda [project @ 2000-02-05 07:14:21 by jwe]
jwe
parents: 3574
diff changeset
145
2923f52d8fda [project @ 2000-02-05 07:14:21 by jwe]
jwe
parents: 3574
diff changeset
146 #define MDIAGARRAY2_SDA_BINOP_DECLS(A_T, E_T, PFX, LTGT, X_T, Y_T) \
2923f52d8fda [project @ 2000-02-05 07:14:21 by jwe]
jwe
parents: 3574
diff changeset
147 MARRAY_BINOP_DECL (A_T, E_T, operator *, PFX, LTGT, X_T, Y_T);
2923f52d8fda [project @ 2000-02-05 07:14:21 by jwe]
jwe
parents: 3574
diff changeset
148
2923f52d8fda [project @ 2000-02-05 07:14:21 by jwe]
jwe
parents: 3574
diff changeset
149 #define MDIAGARRAY2_DADA_BINOP_DECLS(A_T, E_T, PFX, LTGT) \
2923f52d8fda [project @ 2000-02-05 07:14:21 by jwe]
jwe
parents: 3574
diff changeset
150 MARRAY_BINOP_DECL (A_T, E_T, operator +, PFX, LTGT, A_T<E_T>, A_T<E_T>); \
2923f52d8fda [project @ 2000-02-05 07:14:21 by jwe]
jwe
parents: 3574
diff changeset
151 MARRAY_BINOP_DECL (A_T, E_T, operator -, PFX, LTGT, A_T<E_T>, A_T<E_T>); \
2923f52d8fda [project @ 2000-02-05 07:14:21 by jwe]
jwe
parents: 3574
diff changeset
152 MARRAY_BINOP_DECL (A_T, E_T, product, PFX, LTGT, A_T<E_T>, A_T<E_T>);
2923f52d8fda [project @ 2000-02-05 07:14:21 by jwe]
jwe
parents: 3574
diff changeset
153
3573
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
154 // Generate forward declarations for binary operators.
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
155 #define MARRAY_BINOP_FWD_DECLS(A_T) \
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
156 MARRAY_BINOP_DECLS (A_T, T, template <typename T>, , A_T<T>, T) \
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
157 MARRAY_BINOP_DECLS (A_T, T, template <typename T>, , T, A_T<T>) \
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
158 MARRAY_AA_BINOP_DECLS (A_T, T, template <typename T>, )
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
159
3580
2923f52d8fda [project @ 2000-02-05 07:14:21 by jwe]
jwe
parents: 3574
diff changeset
160 #define MDIAGARRAY2_BINOP_FWD_DECLS(A_T) \
2923f52d8fda [project @ 2000-02-05 07:14:21 by jwe]
jwe
parents: 3574
diff changeset
161 MDIAGARRAY2_DAS_BINOP_DECLS (A_T, T, template <typename T>, , A_T<T>, T) \
2923f52d8fda [project @ 2000-02-05 07:14:21 by jwe]
jwe
parents: 3574
diff changeset
162 MDIAGARRAY2_SDA_BINOP_DECLS (A_T, T, template <typename T>, , T, A_T<T>) \
2923f52d8fda [project @ 2000-02-05 07:14:21 by jwe]
jwe
parents: 3574
diff changeset
163 MDIAGARRAY2_DADA_BINOP_DECLS (A_T, T, template <typename T>, )
2923f52d8fda [project @ 2000-02-05 07:14:21 by jwe]
jwe
parents: 3574
diff changeset
164
3573
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
165 // Generate friend declarations for the binary operators.
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
166 #define MARRAY_BINOP_FRIENDS(A_T) \
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
167 MARRAY_BINOP_DECLS (A_T, T, friend, <>, A_T<T>, T) \
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
168 MARRAY_BINOP_DECLS (A_T, T, friend, <>, T, A_T<T>) \
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
169 MARRAY_AA_BINOP_DECLS (A_T, T, friend, <>)
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
170
3580
2923f52d8fda [project @ 2000-02-05 07:14:21 by jwe]
jwe
parents: 3574
diff changeset
171 #define MDIAGARRAY2_BINOP_FRIENDS(A_T) \
2923f52d8fda [project @ 2000-02-05 07:14:21 by jwe]
jwe
parents: 3574
diff changeset
172 MDIAGARRAY2_DAS_BINOP_DECLS (A_T, T, friend, <>, A_T<T>, T) \
2923f52d8fda [project @ 2000-02-05 07:14:21 by jwe]
jwe
parents: 3574
diff changeset
173 MDIAGARRAY2_SDA_BINOP_DECLS (A_T, T, friend, <>, T, A_T<T>) \
2923f52d8fda [project @ 2000-02-05 07:14:21 by jwe]
jwe
parents: 3574
diff changeset
174 MDIAGARRAY2_DADA_BINOP_DECLS (A_T, T, friend, <>)
2923f52d8fda [project @ 2000-02-05 07:14:21 by jwe]
jwe
parents: 3574
diff changeset
175
3573
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
176 // Instantiate the binary operators.
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
177 #define MARRAY_BINOP_DEFS(A_T, E_T) \
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
178 MARRAY_BINOP_DECLS (A_T, E_T, template, , A_T<E_T>, E_T) \
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
179 MARRAY_BINOP_DECLS (A_T, E_T, template, , E_T, A_T<E_T>) \
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
180 MARRAY_AA_BINOP_DECLS (A_T, E_T, template, )
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
181
3580
2923f52d8fda [project @ 2000-02-05 07:14:21 by jwe]
jwe
parents: 3574
diff changeset
182 #define MDIAGARRAY2_BINOP_DEFS(A_T, E_T) \
2923f52d8fda [project @ 2000-02-05 07:14:21 by jwe]
jwe
parents: 3574
diff changeset
183 MDIAGARRAY2_DAS_BINOP_DECLS (A_T, E_T, template, , A_T<E_T>, E_T) \
2923f52d8fda [project @ 2000-02-05 07:14:21 by jwe]
jwe
parents: 3574
diff changeset
184 MDIAGARRAY2_SDA_BINOP_DECLS (A_T, E_T, template, , E_T, A_T<E_T>) \
2923f52d8fda [project @ 2000-02-05 07:14:21 by jwe]
jwe
parents: 3574
diff changeset
185 MDIAGARRAY2_DADA_BINOP_DECLS (A_T, E_T, template, )
2923f52d8fda [project @ 2000-02-05 07:14:21 by jwe]
jwe
parents: 3574
diff changeset
186
3573
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
187 // A function that can be used to forward binary operations from derived
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
188 // classes back to us.
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
189 #define MARRAY_BINOP_FWD_FCN(R, F, T, C_X, X_T, C_Y, Y_T) \
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
190 inline R \
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
191 F (const X_T& x, const Y_T& y) \
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
192 { \
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
193 return R (F (C_X (x), C_Y (y))); \
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
194 }
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
195
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
196 // The binary operators that we care about forwarding. We have two
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
197 // sets of macros since the MArray OP MArray operations use functions
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
198 // (product and quotient) instead of operators (*, /).
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
199 #define MARRAY_BINOP_FWD_DEFS(R, T, C_X, X_T, C_Y, Y_T) \
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
200 MARRAY_BINOP_FWD_FCN (R, operator +, T, C_X, X_T, C_Y, Y_T) \
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
201 MARRAY_BINOP_FWD_FCN (R, operator -, T, C_X, X_T, C_Y, Y_T) \
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
202 MARRAY_BINOP_FWD_FCN (R, operator *, T, C_X, X_T, C_Y, Y_T) \
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
203 MARRAY_BINOP_FWD_FCN (R, operator /, T, C_X, X_T, C_Y, Y_T)
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
204
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
205 #define MARRAY_AA_BINOP_FWD_DEFS(R, T, C_X, X_T, C_Y, Y_T) \
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
206 MARRAY_BINOP_FWD_FCN (R, operator +, T, C_X, X_T, C_Y, Y_T) \
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
207 MARRAY_BINOP_FWD_FCN (R, operator -, T, C_X, X_T, C_Y, Y_T) \
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
208 MARRAY_BINOP_FWD_FCN (R, product, T, C_X, X_T, C_Y, Y_T) \
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
209 MARRAY_BINOP_FWD_FCN (R, quotient, T, C_X, X_T, C_Y, Y_T)
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
210
3580
2923f52d8fda [project @ 2000-02-05 07:14:21 by jwe]
jwe
parents: 3574
diff changeset
211 #define MDIAGARRAY2_DAS_BINOP_FWD_DEFS(R, T, C_X, X_T, C_Y, Y_T) \
2923f52d8fda [project @ 2000-02-05 07:14:21 by jwe]
jwe
parents: 3574
diff changeset
212 MARRAY_BINOP_FWD_FCN (R, operator *, T, C_X, X_T, C_Y, Y_T) \
2923f52d8fda [project @ 2000-02-05 07:14:21 by jwe]
jwe
parents: 3574
diff changeset
213 MARRAY_BINOP_FWD_FCN (R, operator /, T, C_X, X_T, C_Y, Y_T)
2923f52d8fda [project @ 2000-02-05 07:14:21 by jwe]
jwe
parents: 3574
diff changeset
214
2923f52d8fda [project @ 2000-02-05 07:14:21 by jwe]
jwe
parents: 3574
diff changeset
215 #define MDIAGARRAY2_SDA_BINOP_FWD_DEFS(R, T, C_X, X_T, C_Y, Y_T) \
2923f52d8fda [project @ 2000-02-05 07:14:21 by jwe]
jwe
parents: 3574
diff changeset
216 MARRAY_BINOP_FWD_FCN (R, operator *, T, C_X, X_T, C_Y, Y_T)
2923f52d8fda [project @ 2000-02-05 07:14:21 by jwe]
jwe
parents: 3574
diff changeset
217
2923f52d8fda [project @ 2000-02-05 07:14:21 by jwe]
jwe
parents: 3574
diff changeset
218 #define MDIAGARRAY2_DADA_BINOP_FWD_DEFS(R, T, C_X, X_T, C_Y, Y_T) \
2923f52d8fda [project @ 2000-02-05 07:14:21 by jwe]
jwe
parents: 3574
diff changeset
219 MARRAY_BINOP_FWD_FCN (R, operator +, T, C_X, X_T, C_Y, Y_T) \
2923f52d8fda [project @ 2000-02-05 07:14:21 by jwe]
jwe
parents: 3574
diff changeset
220 MARRAY_BINOP_FWD_FCN (R, operator -, T, C_X, X_T, C_Y, Y_T) \
2923f52d8fda [project @ 2000-02-05 07:14:21 by jwe]
jwe
parents: 3574
diff changeset
221 MARRAY_BINOP_FWD_FCN (R, product, T, C_X, X_T, C_Y, Y_T)
2923f52d8fda [project @ 2000-02-05 07:14:21 by jwe]
jwe
parents: 3574
diff changeset
222
3573
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
223 // Forward declarations for the MArray operators.
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
224 #define MARRAY_OPS_FORWARD_DECLS(A_T) \
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
225 template <class T> \
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
226 class A_T; \
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
227 \
3580
2923f52d8fda [project @ 2000-02-05 07:14:21 by jwe]
jwe
parents: 3574
diff changeset
228 MARRAY_OP_ASSIGN_FWD_DECLS (A_T, T) \
2923f52d8fda [project @ 2000-02-05 07:14:21 by jwe]
jwe
parents: 3574
diff changeset
229 MARRAY_OP_ASSIGN_FWD_DECLS (A_T, A_T<T>) \
3573
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
230 MARRAY_UNOP_FWD_DECLS (A_T) \
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
231 MARRAY_BINOP_FWD_DECLS (A_T)
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
232
3580
2923f52d8fda [project @ 2000-02-05 07:14:21 by jwe]
jwe
parents: 3574
diff changeset
233 #define MDIAGARRAY2_OPS_FORWARD_DECLS(A_T) \
2923f52d8fda [project @ 2000-02-05 07:14:21 by jwe]
jwe
parents: 3574
diff changeset
234 template <class T> \
2923f52d8fda [project @ 2000-02-05 07:14:21 by jwe]
jwe
parents: 3574
diff changeset
235 class A_T; \
2923f52d8fda [project @ 2000-02-05 07:14:21 by jwe]
jwe
parents: 3574
diff changeset
236 \
2923f52d8fda [project @ 2000-02-05 07:14:21 by jwe]
jwe
parents: 3574
diff changeset
237 MARRAY_OP_ASSIGN_FWD_DECLS (A_T, A_T<T>) \
2923f52d8fda [project @ 2000-02-05 07:14:21 by jwe]
jwe
parents: 3574
diff changeset
238 MARRAY_UNOP_FWD_DECLS (A_T) \
2923f52d8fda [project @ 2000-02-05 07:14:21 by jwe]
jwe
parents: 3574
diff changeset
239 MDIAGARRAY2_BINOP_FWD_DECLS (A_T)
2923f52d8fda [project @ 2000-02-05 07:14:21 by jwe]
jwe
parents: 3574
diff changeset
240
3573
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
241 // Friend declarations for the MArray operators.
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
242 #define MARRAY_OPS_FRIEND_DECLS(A_T) \
3580
2923f52d8fda [project @ 2000-02-05 07:14:21 by jwe]
jwe
parents: 3574
diff changeset
243 MARRAY_OP_ASSIGN_FRIENDS (A_T, T) \
2923f52d8fda [project @ 2000-02-05 07:14:21 by jwe]
jwe
parents: 3574
diff changeset
244 MARRAY_OP_ASSIGN_FRIENDS (A_T, A_T<T>) \
3573
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
245 MARRAY_UNOP_FRIENDS (A_T) \
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
246 MARRAY_BINOP_FRIENDS (A_T)
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
247
3580
2923f52d8fda [project @ 2000-02-05 07:14:21 by jwe]
jwe
parents: 3574
diff changeset
248 #define MDIAGARRAY2_OPS_FRIEND_DECLS(A_T) \
2923f52d8fda [project @ 2000-02-05 07:14:21 by jwe]
jwe
parents: 3574
diff changeset
249 MARRAY_OP_ASSIGN_FRIENDS (A_T, A_T<T>) \
2923f52d8fda [project @ 2000-02-05 07:14:21 by jwe]
jwe
parents: 3574
diff changeset
250 MARRAY_UNOP_FRIENDS (A_T) \
2923f52d8fda [project @ 2000-02-05 07:14:21 by jwe]
jwe
parents: 3574
diff changeset
251 MDIAGARRAY2_BINOP_FRIENDS (A_T)
2923f52d8fda [project @ 2000-02-05 07:14:21 by jwe]
jwe
parents: 3574
diff changeset
252
3573
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
253 // The following macros are for external use.
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
254
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
255 // Instantiate all the MArray friends for MArray element type T.
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
256 #define INSTANTIATE_MARRAY_FRIENDS(T) \
3581
aa8f5aa90c25 [project @ 2000-02-05 08:00:20 by jwe]
jwe
parents: 3580
diff changeset
257 MARRAY_OP_ASSIGN_DEFS (MArray, T, T) \
aa8f5aa90c25 [project @ 2000-02-05 08:00:20 by jwe]
jwe
parents: 3580
diff changeset
258 MARRAY_OP_ASSIGN_DEFS (MArray, T, MArray<T>) \
3573
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
259 MARRAY_UNOP_DEFS (MArray, T) \
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
260 MARRAY_BINOP_DEFS (MArray, T)
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
261
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
262 // Instantiate all the MArray friends for MArray element type T.
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
263 #define INSTANTIATE_MARRAY2_FRIENDS(T) \
3580
2923f52d8fda [project @ 2000-02-05 07:14:21 by jwe]
jwe
parents: 3574
diff changeset
264 MARRAY_OP_ASSIGN_DEFS (MArray2, T, T) \
2923f52d8fda [project @ 2000-02-05 07:14:21 by jwe]
jwe
parents: 3574
diff changeset
265 MARRAY_OP_ASSIGN_DEFS (MArray2, T, MArray2<T>) \
3573
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
266 MARRAY_UNOP_DEFS (MArray2, T) \
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
267 MARRAY_BINOP_DEFS (MArray2, T)
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
268
3580
2923f52d8fda [project @ 2000-02-05 07:14:21 by jwe]
jwe
parents: 3574
diff changeset
269 // Instantiate all the MArray friends for MArray element type T.
2923f52d8fda [project @ 2000-02-05 07:14:21 by jwe]
jwe
parents: 3574
diff changeset
270 #define INSTANTIATE_MDIAGARRAY2_FRIENDS(T) \
3581
aa8f5aa90c25 [project @ 2000-02-05 08:00:20 by jwe]
jwe
parents: 3580
diff changeset
271 MARRAY_OP_ASSIGN_DEFS (MDiagArray2, T, MDiagArray2<T>) \
aa8f5aa90c25 [project @ 2000-02-05 08:00:20 by jwe]
jwe
parents: 3580
diff changeset
272 MARRAY_UNOP_DEFS (MDiagArray2, T) \
aa8f5aa90c25 [project @ 2000-02-05 08:00:20 by jwe]
jwe
parents: 3580
diff changeset
273 MDIAGARRAY2_BINOP_DEFS (MDiagArray2, T)
3580
2923f52d8fda [project @ 2000-02-05 07:14:21 by jwe]
jwe
parents: 3574
diff changeset
274
3573
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
275 // Define all the MArray forwarding functions for return type R and
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
276 // MArray element type T
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
277 #define MARRAY_FORWARD_DEFS(B, R, T) \
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
278 MARRAY_OP_ASSIGN_FWD_DEFS \
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
279 (R, T, dynamic_cast<B<T>&>, R, , T) \
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
280 \
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
281 MARRAY_OP_ASSIGN_FWD_DEFS \
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
282 (R, T, \
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
283 dynamic_cast<B<T>&>, R, dynamic_cast<const B<T>&>, R) \
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
284 \
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
285 MARRAY_UNOP_FWD_DEFS \
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
286 (R, T, dynamic_cast<const B<T>&>, R) \
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
287 \
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
288 MARRAY_BINOP_FWD_DEFS \
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
289 (R, T, dynamic_cast<const B<T>&>, R, , T) \
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
290 \
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
291 MARRAY_BINOP_FWD_DEFS \
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
292 (R, T, , T, dynamic_cast<const B<T>&>, R) \
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
293 \
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
294 MARRAY_AA_BINOP_FWD_DEFS \
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
295 (R, T, dynamic_cast<const B<T>&>, R, dynamic_cast<const B<T>&>, R)
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
296
3580
2923f52d8fda [project @ 2000-02-05 07:14:21 by jwe]
jwe
parents: 3574
diff changeset
297 #define MDIAGARRAY2_FORWARD_DEFS(B, R, T) \
2923f52d8fda [project @ 2000-02-05 07:14:21 by jwe]
jwe
parents: 3574
diff changeset
298 MARRAY_OP_ASSIGN_FWD_DEFS \
2923f52d8fda [project @ 2000-02-05 07:14:21 by jwe]
jwe
parents: 3574
diff changeset
299 (R, T, \
2923f52d8fda [project @ 2000-02-05 07:14:21 by jwe]
jwe
parents: 3574
diff changeset
300 dynamic_cast<B<T>&>, R, dynamic_cast<const B<T>&>, R) \
2923f52d8fda [project @ 2000-02-05 07:14:21 by jwe]
jwe
parents: 3574
diff changeset
301 \
2923f52d8fda [project @ 2000-02-05 07:14:21 by jwe]
jwe
parents: 3574
diff changeset
302 MARRAY_UNOP_FWD_DEFS \
2923f52d8fda [project @ 2000-02-05 07:14:21 by jwe]
jwe
parents: 3574
diff changeset
303 (R, T, dynamic_cast<const B<T>&>, R) \
2923f52d8fda [project @ 2000-02-05 07:14:21 by jwe]
jwe
parents: 3574
diff changeset
304 \
2923f52d8fda [project @ 2000-02-05 07:14:21 by jwe]
jwe
parents: 3574
diff changeset
305 MDIAGARRAY2_DAS_BINOP_FWD_DEFS \
2923f52d8fda [project @ 2000-02-05 07:14:21 by jwe]
jwe
parents: 3574
diff changeset
306 (R, T, dynamic_cast<const B<T>&>, R, , T) \
2923f52d8fda [project @ 2000-02-05 07:14:21 by jwe]
jwe
parents: 3574
diff changeset
307 \
2923f52d8fda [project @ 2000-02-05 07:14:21 by jwe]
jwe
parents: 3574
diff changeset
308 MDIAGARRAY2_SDA_BINOP_FWD_DEFS \
2923f52d8fda [project @ 2000-02-05 07:14:21 by jwe]
jwe
parents: 3574
diff changeset
309 (R, T, , T, dynamic_cast<const B<T>&>, R) \
2923f52d8fda [project @ 2000-02-05 07:14:21 by jwe]
jwe
parents: 3574
diff changeset
310 \
2923f52d8fda [project @ 2000-02-05 07:14:21 by jwe]
jwe
parents: 3574
diff changeset
311 MDIAGARRAY2_DADA_BINOP_FWD_DEFS \
2923f52d8fda [project @ 2000-02-05 07:14:21 by jwe]
jwe
parents: 3574
diff changeset
312 (R, T, dynamic_cast<const B<T>&>, R, dynamic_cast<const B<T>&>, R)
2923f52d8fda [project @ 2000-02-05 07:14:21 by jwe]
jwe
parents: 3574
diff changeset
313
3573
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
314 // Now we have all the definitions we need.
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
315