annotate liboctave/MArray-defs.h @ 6108:143b556ce725

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