nmatrix-atlas 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/nmatrix/data/complex.h +183 -159
- data/ext/nmatrix/data/data.h +306 -292
- data/ext/nmatrix/data/ruby_object.h +193 -193
- data/ext/nmatrix/math/math.h +3 -2
- data/ext/nmatrix/math/trsm.h +152 -152
- data/ext/nmatrix/nmatrix.h +30 -0
- data/ext/nmatrix/ruby_constants.h +35 -35
- data/ext/nmatrix/storage/common.h +4 -3
- data/ext/nmatrix/storage/dense/dense.h +8 -7
- data/ext/nmatrix/storage/list/list.h +7 -6
- data/ext/nmatrix/storage/storage.h +12 -11
- data/ext/nmatrix/storage/yale/class.h +2 -2
- data/ext/nmatrix/storage/yale/iterators/base.h +2 -1
- data/ext/nmatrix/storage/yale/iterators/iterator.h +2 -1
- data/ext/nmatrix/storage/yale/iterators/row.h +2 -1
- data/ext/nmatrix/storage/yale/iterators/row_stored.h +2 -1
- data/ext/nmatrix/storage/yale/iterators/row_stored_nd.h +1 -0
- data/ext/nmatrix/storage/yale/iterators/stored_diagonal.h +2 -1
- data/ext/nmatrix/storage/yale/yale.h +7 -6
- data/ext/nmatrix/types.h +3 -2
- data/ext/nmatrix/util/sl_list.h +19 -18
- data/ext/nmatrix_atlas/extconf.rb +11 -9
- data/ext/nmatrix_atlas/math_atlas.cpp +7 -7
- data/spec/00_nmatrix_spec.rb +6 -0
- data/spec/math_spec.rb +77 -0
- data/spec/spec_helper.rb +9 -0
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 365cf6fb0704d032a5b8ee41339b56b052343504
|
4
|
+
data.tar.gz: e18c48556a092b7a5d1661738b93f5acf01cd208
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cc5946ff9f4bf0ce43b3357333c58eaf038dd6e6e83d107cff3d84559c56df3bb3917c94e02783da06ba1bd29a6cda1e2d1e860b8f755270ea419dce2ec7fb4b
|
7
|
+
data.tar.gz: e1381c43a6c4c04efabc41977e61ba98a7692698f58a98815d04f5622464b594b1bf8acda8bc2ae585f7a2b7757e3663863ba58711612aca636e024e361b4765
|
data/ext/nmatrix/data/complex.h
CHANGED
@@ -32,6 +32,7 @@
|
|
32
32
|
* Standard Includes
|
33
33
|
*/
|
34
34
|
|
35
|
+
#include <ruby.h>
|
35
36
|
#include <type_traits>
|
36
37
|
#include <iostream>
|
37
38
|
#include <cmath>
|
@@ -67,23 +68,39 @@ typedef Complex<float64_t> Complex128;
|
|
67
68
|
|
68
69
|
template <typename Type>
|
69
70
|
class Complex {
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
71
|
+
public:
|
72
|
+
// The real and immaginary parts of the complex number.
|
73
|
+
Type r;
|
74
|
+
Type i;
|
74
75
|
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
76
|
+
/*
|
77
|
+
* Default constructor.
|
78
|
+
*/
|
79
|
+
inline Complex(Type real = 0, Type imaginary = 0) : r(real), i(imaginary) {}
|
80
|
+
|
81
|
+
/*
|
82
|
+
* Copy constructors.
|
83
|
+
*/
|
84
|
+
template <typename ComplexType>
|
85
|
+
explicit inline Complex(const Complex<ComplexType>& other) : r(other.r), i(other.i) {}
|
79
86
|
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
87
|
+
template <typename ComplexType>
|
88
|
+
inline Complex<Type>& operator=(const Complex<ComplexType>& other) {
|
89
|
+
this->r = static_cast<Type>(other.r);
|
90
|
+
this->i = static_cast<Type>(other.i);
|
91
|
+
return *this;
|
92
|
+
}
|
93
|
+
|
94
|
+
explicit Complex(const RubyObject& other);
|
85
95
|
|
86
|
-
Complex(const RubyObject& other);
|
96
|
+
Complex<Type>& operator=(const RubyObject& other);
|
97
|
+
|
98
|
+
template<typename OtherType>
|
99
|
+
inline Complex<Type>& operator=(const OtherType& real) {
|
100
|
+
this->r = Type(real);
|
101
|
+
this->i = Type(0);
|
102
|
+
return *this;
|
103
|
+
}
|
87
104
|
|
88
105
|
/*
|
89
106
|
* Complex conjugate function -- creates a copy, but inverted.
|
@@ -103,20 +120,25 @@ class Complex {
|
|
103
120
|
return Complex<Type>(conj.r / denom, conj.i / denom);
|
104
121
|
}
|
105
122
|
|
123
|
+
// Negative operator
|
124
|
+
inline Complex<Type> operator-() const {
|
125
|
+
return Complex<Type>(-this->r, -this->i);
|
126
|
+
}
|
106
127
|
|
107
128
|
|
108
|
-
/*
|
109
|
-
* Binary operator definitions for various types.
|
110
|
-
*/
|
111
129
|
|
112
|
-
|
113
|
-
|
114
|
-
|
130
|
+
/*
|
131
|
+
* Binary operator definitions for various types.
|
132
|
+
*/
|
115
133
|
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
134
|
+
////////////////////////////////
|
135
|
+
// Complex-Complex Operations //
|
136
|
+
////////////////////////////////
|
137
|
+
|
138
|
+
template <typename OtherType>
|
139
|
+
inline Complex<Type> operator+(const Complex<OtherType>& other) const {
|
140
|
+
return Complex<Type>(this->r + other.r, this->i + other.i);
|
141
|
+
}
|
120
142
|
|
121
143
|
template <typename OtherType>
|
122
144
|
inline Complex<Type>& operator+=(const Complex<OtherType>& other) {
|
@@ -132,15 +154,15 @@ class Complex {
|
|
132
154
|
return *this;
|
133
155
|
}
|
134
156
|
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
157
|
+
template <typename OtherType>
|
158
|
+
inline Complex<Type> operator-(const Complex<OtherType>& other) const {
|
159
|
+
return Complex<Type>(this->r - other.r, this->i - other.i);
|
160
|
+
}
|
139
161
|
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
162
|
+
template <typename OtherType>
|
163
|
+
inline Complex<Type> operator*(const Complex<OtherType>& other) const {
|
164
|
+
return Complex<Type>(this->r * other.r - this->i * other.i, this->r * other.i + this->i * other.r);
|
165
|
+
}
|
144
166
|
|
145
167
|
template <typename OtherType>
|
146
168
|
inline Complex<Type>& operator*=(const Complex<OtherType>& other) {
|
@@ -149,123 +171,125 @@ class Complex {
|
|
149
171
|
return *this;
|
150
172
|
}
|
151
173
|
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
174
|
+
template <typename OtherType>
|
175
|
+
inline Complex<Type> operator/(const Complex<OtherType>& other) const {
|
176
|
+
Type new_r, new_i;
|
177
|
+
Type denom = other.i * other.i + other.r * other.r;
|
178
|
+
|
179
|
+
new_r = (this->r * other.r + this->i * other.i) / denom;
|
180
|
+
new_i = (this->i * other.r - this->r * other.i) / denom;
|
181
|
+
|
182
|
+
return Complex<Type>(new_r, new_i);
|
183
|
+
}
|
184
|
+
|
185
|
+
template <typename OtherType>
|
186
|
+
inline Complex<Type> operator/=(const Complex<OtherType>& other) {
|
187
|
+
Type new_r, new_i;
|
188
|
+
Type denom = other.i * other.i + other.r * other.r;
|
189
|
+
|
190
|
+
new_r = (this->r * other.r + this->i * other.i) / denom;
|
191
|
+
new_i = (this->i * other.r - this->r * other.i) / denom;
|
192
|
+
|
193
|
+
this->r = new_r;
|
194
|
+
this->i = new_i;
|
195
|
+
return *this;
|
196
|
+
}
|
197
|
+
|
198
|
+
template <typename OtherType>
|
199
|
+
inline bool operator<(const Complex<OtherType>& other) const {
|
200
|
+
return (this->r < other.r) || ((this->r <= other.r) && (this->i < other.i));
|
201
|
+
}
|
202
|
+
|
203
|
+
template <typename OtherType>
|
204
|
+
inline bool operator>(const Complex<OtherType>& other) const {
|
205
|
+
return (this->r > other.r) || ((this->r >= other.r) && (this->i > other.i));
|
206
|
+
}
|
207
|
+
|
208
|
+
template <typename OtherType>
|
209
|
+
inline bool operator==(const Complex<OtherType>& other) const {
|
210
|
+
return FP_EQUAL(this->r, other.r) && FP_EQUAL(this->i, other.i);
|
211
|
+
}
|
212
|
+
|
213
|
+
template <typename OtherType>
|
214
|
+
inline bool operator!=(const Complex<OtherType>& other) const {
|
215
|
+
return !(*this == other);
|
216
|
+
}
|
217
|
+
|
218
|
+
template <typename OtherType>
|
219
|
+
inline bool operator<=(const Complex<OtherType>& other) const {
|
220
|
+
return (*this < other) || (*this == other);
|
221
|
+
}
|
222
|
+
|
223
|
+
template <typename OtherType>
|
224
|
+
inline bool operator>=(const Complex<OtherType>& other) const {
|
225
|
+
return (*this > other) || (*this == other);
|
226
|
+
}
|
227
|
+
|
228
|
+
template <typename OtherType>
|
229
|
+
inline operator Complex<OtherType> () const {
|
230
|
+
return Complex<OtherType>((OtherType)this->r, (OtherType)this->i);
|
231
|
+
}
|
232
|
+
|
233
|
+
///////////////////////////////
|
234
|
+
// Complex-Native Operations //
|
235
|
+
///////////////////////////////
|
236
|
+
|
237
|
+
template <typename NativeType, typename = typename std::enable_if<std::is_arithmetic<NativeType>::value>::type>
|
238
|
+
inline Complex<Type> operator+(const NativeType& other) const {
|
239
|
+
return *this + Complex<Type>(other);
|
240
|
+
}
|
241
|
+
|
242
|
+
template <typename NativeType, typename = typename std::enable_if<std::is_arithmetic<NativeType>::value>::type>
|
243
|
+
inline Complex<Type> operator-(const NativeType& other) const {
|
244
|
+
return *this - Complex<Type>(other);
|
245
|
+
}
|
246
|
+
|
247
|
+
template <typename NativeType, typename = typename std::enable_if<std::is_arithmetic<NativeType>::value>::type>
|
248
|
+
inline Complex<Type> operator*(const NativeType& other) const {
|
249
|
+
return *this * Complex<Type>(other);
|
250
|
+
}
|
251
|
+
|
252
|
+
template <typename NativeType, typename = typename std::enable_if<std::is_arithmetic<NativeType>::value>::type>
|
253
|
+
inline Complex<Type> operator/(const NativeType& other) const {
|
254
|
+
return *this / Complex<Type>(other);
|
255
|
+
}
|
256
|
+
|
257
|
+
template <typename NativeType, typename = typename std::enable_if<std::is_arithmetic<NativeType>::value>::type>
|
258
|
+
inline bool operator<(const NativeType& other) const {
|
259
|
+
return *this < Complex<Type>(other);
|
260
|
+
}
|
261
|
+
|
262
|
+
template <typename NativeType, typename = typename std::enable_if<std::is_arithmetic<NativeType>::value>::type>
|
263
|
+
inline bool operator>(const NativeType& other) const {
|
264
|
+
return *this > Complex<Type>(other);
|
265
|
+
}
|
266
|
+
|
267
|
+
template <typename NativeType, typename = typename std::enable_if<std::is_arithmetic<NativeType>::value>::type>
|
268
|
+
inline bool operator==(const NativeType& other) const {
|
269
|
+
return *this == Complex<Type>(other);
|
270
|
+
}
|
271
|
+
|
272
|
+
template <typename NativeType, typename = typename std::enable_if<std::is_arithmetic<NativeType>::value>::type>
|
273
|
+
inline bool operator!=(const NativeType& other) const {
|
274
|
+
return *this != Complex<Type>(other);
|
275
|
+
}
|
276
|
+
|
277
|
+
template <typename NativeType, typename = typename std::enable_if<std::is_arithmetic<NativeType>::value>::type>
|
278
|
+
inline bool operator<=(const NativeType& other) const {
|
279
|
+
return *this <= Complex<Type>(other);
|
280
|
+
}
|
281
|
+
|
282
|
+
template <typename NativeType, typename = typename std::enable_if<std::is_arithmetic<NativeType>::value>::type>
|
283
|
+
inline bool operator>=(const NativeType& other) const {
|
284
|
+
return *this >= Complex<Type>(other);
|
285
|
+
}
|
286
|
+
|
287
|
+
template <typename NativeType, typename = typename std::enable_if<std::is_arithmetic<NativeType>::value>::type>
|
288
|
+
inline operator NativeType () const {
|
289
|
+
return (NativeType)this->r;
|
290
|
+
}
|
291
|
+
|
292
|
+
operator RubyObject () const;
|
269
293
|
};
|
270
294
|
|
271
295
|
///////////////////////////////
|
@@ -274,52 +298,52 @@ class Complex {
|
|
274
298
|
|
275
299
|
template <typename NativeType, typename ComplexType, typename = typename std::enable_if<std::is_arithmetic<NativeType>::value>::type>
|
276
300
|
inline Complex<ComplexType> operator+(const NativeType& left, const Complex<ComplexType>& right) {
|
277
|
-
|
301
|
+
return Complex<ComplexType>(left) + right;
|
278
302
|
}
|
279
303
|
|
280
304
|
template <typename NativeType, typename ComplexType, typename = typename std::enable_if<std::is_arithmetic<NativeType>::value>::type>
|
281
305
|
inline Complex<ComplexType> operator-(const NativeType& left, const Complex<ComplexType>& right) {
|
282
|
-
|
306
|
+
return Complex<ComplexType>(left) - right;
|
283
307
|
}
|
284
308
|
|
285
309
|
template <typename NativeType, typename ComplexType, typename = typename std::enable_if<std::is_arithmetic<NativeType>::value>::type>
|
286
310
|
inline Complex<ComplexType> operator*(const NativeType& left, const Complex<ComplexType>& right) {
|
287
|
-
|
311
|
+
return Complex<ComplexType>(left) * right;
|
288
312
|
}
|
289
313
|
|
290
314
|
template <typename NativeType, typename ComplexType, typename = typename std::enable_if<std::is_arithmetic<NativeType>::value>::type>
|
291
315
|
inline Complex<ComplexType> operator/(const NativeType& left, const Complex<ComplexType>& right) {
|
292
|
-
|
316
|
+
return Complex<ComplexType>(left) / right;
|
293
317
|
}
|
294
318
|
|
295
319
|
template <typename NativeType, typename ComplexType, typename = typename std::enable_if<std::is_arithmetic<NativeType>::value>::type>
|
296
320
|
inline bool operator<(const NativeType left, const Complex<ComplexType>& right) {
|
297
|
-
|
321
|
+
return Complex<ComplexType>(left) < right;
|
298
322
|
}
|
299
323
|
|
300
324
|
template <typename NativeType, typename ComplexType, typename = typename std::enable_if<std::is_arithmetic<NativeType>::value>::type>
|
301
325
|
inline bool operator>(const NativeType left, const Complex<ComplexType>& right) {
|
302
|
-
|
326
|
+
return Complex<ComplexType>(left) > right;
|
303
327
|
}
|
304
328
|
|
305
329
|
template <typename NativeType, typename ComplexType, typename = typename std::enable_if<std::is_arithmetic<NativeType>::value>::type>
|
306
330
|
inline bool operator==(const NativeType left, const Complex<ComplexType>& right) {
|
307
|
-
|
331
|
+
return Complex<ComplexType>(left) == right;
|
308
332
|
}
|
309
333
|
|
310
334
|
template <typename NativeType, typename ComplexType, typename = typename std::enable_if<std::is_arithmetic<NativeType>::value>::type>
|
311
335
|
inline bool operator!=(const NativeType left, const Complex<ComplexType>& right) {
|
312
|
-
|
336
|
+
return Complex<ComplexType>(left) != right;
|
313
337
|
}
|
314
338
|
|
315
339
|
template <typename NativeType, typename ComplexType, typename = typename std::enable_if<std::is_arithmetic<NativeType>::value>::type>
|
316
340
|
inline bool operator<=(const NativeType left, const Complex<ComplexType>& right) {
|
317
|
-
|
341
|
+
return Complex<ComplexType>(left) <= right;
|
318
342
|
}
|
319
343
|
|
320
344
|
template <typename NativeType, typename ComplexType, typename = typename std::enable_if<std::is_arithmetic<NativeType>::value>::type>
|
321
345
|
inline bool operator>=(const NativeType left, const Complex<ComplexType>& right) {
|
322
|
-
|
346
|
+
return Complex<ComplexType>(left) >= right;
|
323
347
|
}
|
324
348
|
|
325
349
|
template <typename Type>
|
data/ext/nmatrix/data/data.h
CHANGED
@@ -31,6 +31,8 @@
|
|
31
31
|
/*
|
32
32
|
* Standard Includes
|
33
33
|
*/
|
34
|
+
|
35
|
+
#include <ruby.h>
|
34
36
|
#include <string>
|
35
37
|
|
36
38
|
/*
|
@@ -51,11 +53,11 @@ namespace nm {
|
|
51
53
|
* Constants
|
52
54
|
*/
|
53
55
|
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
56
|
+
const int NUM_DTYPES = 10;
|
57
|
+
const int NUM_ITYPES = 4;
|
58
|
+
const int NUM_EWOPS = 12;
|
59
|
+
const int NUM_UNARYOPS = 24;
|
60
|
+
const int NUM_NONCOM_EWOPS = 3;
|
59
61
|
|
60
62
|
enum ewop_t {
|
61
63
|
EW_ADD,
|
@@ -114,32 +116,45 @@ namespace nm {
|
|
114
116
|
|
115
117
|
template <typename Type>
|
116
118
|
Complex<Type>::Complex(const RubyObject& other) {
|
119
|
+
*this = other;
|
120
|
+
}
|
121
|
+
|
122
|
+
template <typename Type>
|
123
|
+
Complex<Type>& Complex<Type>::operator=(const RubyObject& other) {
|
117
124
|
switch(TYPE(other.rval)) {
|
118
125
|
case T_COMPLEX:
|
119
|
-
r = NUM2DBL(rb_funcall(other.rval, rb_intern("real"), 0));
|
120
|
-
i = NUM2DBL(rb_funcall(other.rval, rb_intern("imag"), 0));
|
126
|
+
this->r = NUM2DBL(rb_funcall(other.rval, rb_intern("real"), 0));
|
127
|
+
this->i = NUM2DBL(rb_funcall(other.rval, rb_intern("imag"), 0));
|
121
128
|
break;
|
122
129
|
case T_FLOAT:
|
123
130
|
case T_FIXNUM:
|
124
131
|
case T_BIGNUM:
|
125
|
-
r = NUM2DBL(other.rval);
|
126
|
-
i = 0.0;
|
132
|
+
this->r = NUM2DBL(other.rval);
|
133
|
+
this->i = 0.0;
|
127
134
|
break;
|
128
135
|
default:
|
129
136
|
rb_raise(rb_eTypeError, "not sure how to convert this type of VALUE to a complex");
|
130
137
|
}
|
138
|
+
return *this;
|
139
|
+
}
|
140
|
+
|
141
|
+
template<typename Type>
|
142
|
+
Complex<Type>::operator RubyObject () const {
|
143
|
+
return RubyObject(*this);
|
131
144
|
}
|
145
|
+
|
146
|
+
nm::RubyObject rubyobj_from_cval(void* val, nm::dtype_t dtype);
|
132
147
|
} // end of namespace nm
|
133
148
|
|
134
149
|
/*
|
135
150
|
* Macros
|
136
151
|
*/
|
137
152
|
|
138
|
-
#define STYPE_MARK_TABLE(name)
|
139
|
-
static void (*(name)[nm::NUM_STYPES])(STORAGE*) = {
|
140
|
-
nm_dense_storage_mark,
|
141
|
-
nm_list_storage_mark,
|
142
|
-
nm_yale_storage_mark
|
153
|
+
#define STYPE_MARK_TABLE(name) \
|
154
|
+
static void (*(name)[nm::NUM_STYPES])(STORAGE*) = { \
|
155
|
+
nm_dense_storage_mark, \
|
156
|
+
nm_list_storage_mark, \
|
157
|
+
nm_yale_storage_mark \
|
143
158
|
};
|
144
159
|
|
145
160
|
#define STYPE_REGISTER_TABLE(name) \
|
@@ -170,45 +185,45 @@ namespace nm {
|
|
170
185
|
#define DTYPE_TEMPLATE_TABLE(fun, ret, ...) NAMED_DTYPE_TEMPLATE_TABLE(ttable, fun, ret, __VA_ARGS__)
|
171
186
|
|
172
187
|
#define NAMED_DTYPE_TEMPLATE_TABLE(name, fun, ret, ...) \
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
188
|
+
static ret (*(name)[nm::NUM_DTYPES])(__VA_ARGS__) = { \
|
189
|
+
fun<uint8_t>, \
|
190
|
+
fun<int8_t>, \
|
191
|
+
fun<int16_t>, \
|
192
|
+
fun<int32_t>, \
|
193
|
+
fun<int64_t>, \
|
194
|
+
fun<float32_t>, \
|
195
|
+
fun<float64_t>, \
|
196
|
+
fun<nm::Complex64>, \
|
197
|
+
fun<nm::Complex128>, \
|
198
|
+
fun<nm::RubyObject> \
|
199
|
+
};
|
185
200
|
|
186
201
|
#define DTYPE_OBJECT_STATIC_TABLE(obj, fun, ret, ...) \
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
202
|
+
static ret (*(ttable)[nm::NUM_DTYPES])(__VA_ARGS__) = { \
|
203
|
+
obj<uint8_t>::fun, \
|
204
|
+
obj<int8_t>::fun, \
|
205
|
+
obj<int16_t>::fun, \
|
206
|
+
obj<int32_t>::fun, \
|
207
|
+
obj<int64_t>::fun, \
|
208
|
+
obj<float32_t>::fun, \
|
209
|
+
obj<float64_t>::fun, \
|
210
|
+
obj<nm::Complex64>::fun, \
|
211
|
+
obj<nm::Complex128>::fun, \
|
212
|
+
obj<nm::RubyObject>::fun \
|
213
|
+
};
|
199
214
|
|
200
215
|
#define NAMED_DTYPE_TEMPLATE_TABLE_NO_ROBJ(name, fun, ret, ...) \
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
216
|
+
static ret (*(name)[nm::NUM_DTYPES])(__VA_ARGS__) = { \
|
217
|
+
fun<uint8_t>, \
|
218
|
+
fun<int8_t>, \
|
219
|
+
fun<int16_t>, \
|
220
|
+
fun<int32_t>, \
|
221
|
+
fun<int64_t>, \
|
222
|
+
fun<float32_t>, \
|
223
|
+
fun<float64_t>, \
|
224
|
+
fun<nm::Complex64>, \
|
225
|
+
fun<nm::Complex128> \
|
226
|
+
};
|
212
227
|
|
213
228
|
|
214
229
|
/*
|
@@ -221,9 +236,9 @@ namespace nm {
|
|
221
236
|
*/
|
222
237
|
#define LR_DTYPE_TEMPLATE_TABLE(fun, ret, ...) NAMED_LR_DTYPE_TEMPLATE_TABLE(ttable, fun, ret, __VA_ARGS__)
|
223
238
|
|
224
|
-
#define NAMED_LR_DTYPE_TEMPLATE_TABLE(name, fun, ret, ...)
|
225
|
-
|
226
|
-
|
239
|
+
#define NAMED_LR_DTYPE_TEMPLATE_TABLE(name, fun, ret, ...) \
|
240
|
+
static ret (*(name)[nm::NUM_DTYPES][nm::NUM_DTYPES])(__VA_ARGS__) = { \
|
241
|
+
{fun<uint8_t, uint8_t>, fun<uint8_t, int8_t>, fun<uint8_t, int16_t>, fun<uint8_t, int32_t>, fun<uint8_t, int64_t>, fun<uint8_t, float32_t>, fun<uint8_t, float64_t>, fun<uint8_t, nm::Complex64>, fun<uint8_t, nm::Complex128>, fun<uint8_t, nm::RubyObject>}, \
|
227
242
|
{fun<int8_t, uint8_t>, fun<int8_t, int8_t>, fun<int8_t, int16_t>, fun<int8_t, int32_t>, fun<int8_t, int64_t>, fun<int8_t, float32_t>, fun<int8_t, float64_t>, fun<int8_t, nm::Complex64>, fun<int8_t, nm::Complex128>, fun<int8_t, nm::RubyObject>}, \
|
228
243
|
{fun<int16_t, uint8_t>, fun<int16_t, int8_t>, fun<int16_t, int16_t>, fun<int16_t, int32_t>, fun<int16_t, int64_t>, fun<int16_t, float32_t>, fun<int16_t, float64_t>, fun<int16_t, nm::Complex64>, fun<int16_t, nm::Complex128>, fun<int16_t, nm::RubyObject>}, \
|
229
244
|
{fun<int32_t, uint8_t>, fun<int32_t, int8_t>, fun<int32_t, int16_t>, fun<int32_t, int32_t>, fun<int32_t, int64_t>, fun<int32_t, float32_t>, fun<int32_t, float64_t>, fun<int32_t, nm::Complex64>, fun<int32_t, nm::Complex128>, fun<int32_t, nm::RubyObject>}, \
|
@@ -241,252 +256,252 @@ namespace nm {
|
|
241
256
|
*/
|
242
257
|
#define OP_LR_DTYPE_TEMPLATE_TABLE(fun, ret, ...) NAMED_OP_LR_DTYPE_TEMPLATE_TABLE(ttable, fun, ret, __VA_ARGS__)
|
243
258
|
|
244
|
-
#define NAMED_OP_LR_DTYPE_TEMPLATE_TABLE(name, fun, ret, ...)
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
259
|
+
#define NAMED_OP_LR_DTYPE_TEMPLATE_TABLE(name, fun, ret, ...) \
|
260
|
+
static ret (*(name)[nm::NUM_EWOPS][nm::NUM_DTYPES][nm::NUM_DTYPES])(__VA_ARGS__) = { \
|
261
|
+
{ \
|
262
|
+
{fun<nm::EW_ADD, uint8_t, uint8_t>, fun<nm::EW_ADD, uint8_t, int8_t>, fun<nm::EW_ADD, uint8_t, int16_t>, fun<nm::EW_ADD, uint8_t, int32_t>, fun<nm::EW_ADD, uint8_t, int64_t>, \
|
263
|
+
fun<nm::EW_ADD, uint8_t, float32_t>, fun<nm::EW_ADD, uint8_t, float64_t>, fun<nm::EW_ADD, uint8_t, nm::Complex64>, fun<nm::EW_ADD, uint8_t, nm::Complex128>, \
|
264
|
+
fun<nm::EW_ADD, int8_t, float32_t>, fun<nm::EW_ADD, int8_t, float64_t>, fun<nm::EW_ADD, int8_t, nm::Complex64>, fun<nm::EW_ADD, int8_t, nm::Complex128>, \
|
265
|
+
NULL}, \
|
266
|
+
\
|
267
|
+
{fun<nm::EW_ADD, int16_t, uint8_t>, fun<nm::EW_ADD, int16_t, int8_t>, fun<nm::EW_ADD, int16_t, int16_t>, fun<nm::EW_ADD, int16_t, int32_t>, fun<nm::EW_ADD, int16_t, int64_t>, \
|
268
|
+
fun<nm::EW_ADD, int16_t, float32_t>, fun<nm::EW_ADD, int16_t, float64_t>, fun<nm::EW_ADD, int16_t, nm::Complex64>, fun<nm::EW_ADD, int16_t, nm::Complex128>, \
|
269
|
+
NULL}, \
|
270
|
+
\
|
271
|
+
{fun<nm::EW_ADD, int32_t, uint8_t>, fun<nm::EW_ADD, int32_t, int8_t>, fun<nm::EW_ADD, int32_t, int16_t>, fun<nm::EW_ADD, int32_t, int32_t>, fun<nm::EW_ADD, int32_t, int64_t>, \
|
272
|
+
fun<nm::EW_ADD, int32_t, float32_t>, fun<nm::EW_ADD, int32_t, float64_t>, fun<nm::EW_ADD, int32_t, nm::Complex64>, fun<nm::EW_ADD, int32_t, nm::Complex128>, \
|
273
|
+
NULL}, \
|
274
|
+
\
|
275
|
+
{fun<nm::EW_ADD, int64_t, uint8_t>, fun<nm::EW_ADD, int64_t, int8_t>, fun<nm::EW_ADD, int64_t, int16_t>, fun<nm::EW_ADD, int64_t, int32_t>, fun<nm::EW_ADD, int64_t, int64_t>, \
|
276
|
+
fun<nm::EW_ADD, int64_t, float32_t>, fun<nm::EW_ADD, int64_t, float64_t>, fun<nm::EW_ADD, int64_t, nm::Complex64>, fun<nm::EW_ADD, int64_t, nm::Complex128>, \
|
277
|
+
NULL}, \
|
278
|
+
\
|
279
|
+
{fun<nm::EW_ADD, float32_t, uint8_t>, fun<nm::EW_ADD, float32_t, int8_t>, fun<nm::EW_ADD, float32_t, int16_t>, fun<nm::EW_ADD, float32_t, int32_t>, fun<nm::EW_ADD, float32_t, int64_t>, \
|
280
|
+
fun<nm::EW_ADD, float32_t, float32_t>, fun<nm::EW_ADD, float32_t, float64_t>, fun<nm::EW_ADD, float32_t, nm::Complex64>, fun<nm::EW_ADD, float32_t, nm::Complex128>, \
|
281
|
+
NULL}, \
|
282
|
+
\
|
283
|
+
{fun<nm::EW_ADD, float64_t, uint8_t>, fun<nm::EW_ADD, float64_t, int8_t>, fun<nm::EW_ADD, float64_t, int16_t>, fun<nm::EW_ADD, float64_t, int32_t>, fun<nm::EW_ADD, float64_t, int64_t>, \
|
284
|
+
fun<nm::EW_ADD, float64_t, float32_t>, fun<nm::EW_ADD, float64_t, float64_t>, fun<nm::EW_ADD, float64_t, nm::Complex64>, fun<nm::EW_ADD, float64_t, nm::Complex128>, \
|
285
|
+
NULL}, \
|
286
|
+
\
|
287
|
+
{fun<nm::EW_ADD, nm::Complex64, uint8_t>, fun<nm::EW_ADD, nm::Complex64, int8_t>, fun<nm::EW_ADD, nm::Complex64, int16_t>, fun<nm::EW_ADD, nm::Complex64, int32_t>, \
|
288
|
+
fun<nm::EW_ADD, nm::Complex64, int64_t>, fun<nm::EW_ADD, nm::Complex64, float32_t>, fun<nm::EW_ADD, nm::Complex64, float64_t>, fun<nm::EW_ADD, nm::Complex64, nm::Complex64>, \
|
289
|
+
fun<nm::EW_ADD, nm::Complex64, nm::Complex128>, \
|
290
|
+
NULL}, \
|
291
|
+
\
|
292
|
+
{fun<nm::EW_ADD, nm::Complex128, uint8_t>, fun<nm::EW_ADD, nm::Complex128, int8_t>, fun<nm::EW_ADD, nm::Complex128, int16_t>, fun<nm::EW_ADD, nm::Complex128, int32_t>, \
|
293
|
+
fun<nm::EW_ADD, nm::Complex128, int64_t>, fun<nm::EW_ADD, nm::Complex128, float32_t>, fun<nm::EW_ADD, nm::Complex128, float64_t>, fun<nm::EW_ADD, nm::Complex128, nm::Complex64>, \
|
294
|
+
fun<nm::EW_ADD, nm::Complex128, nm::Complex128>, \
|
295
|
+
NULL}, \
|
296
|
+
{NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, fun<nm::EW_ADD, nm::RubyObject, nm::RubyObject>} \
|
297
|
+
}, \
|
298
|
+
\
|
299
|
+
{ \
|
300
|
+
{fun<nm::EW_SUB, uint8_t, uint8_t>, fun<nm::EW_SUB, uint8_t, int8_t>, fun<nm::EW_SUB, uint8_t, int16_t>, fun<nm::EW_SUB, uint8_t, int32_t>, fun<nm::EW_SUB, uint8_t, int64_t>, \
|
301
|
+
fun<nm::EW_SUB, uint8_t, float32_t>, fun<nm::EW_SUB, uint8_t, float64_t>, fun<nm::EW_SUB, uint8_t, nm::Complex64>, fun<nm::EW_SUB, uint8_t, nm::Complex128>, \
|
302
|
+
NULL}, \
|
303
|
+
\
|
304
|
+
{fun<nm::EW_SUB, int8_t, uint8_t>, fun<nm::EW_SUB, int8_t, int8_t>, fun<nm::EW_SUB, int8_t, int16_t>, fun<nm::EW_SUB, int8_t, int32_t>, fun<nm::EW_SUB, int8_t, int64_t>, \
|
305
|
+
fun<nm::EW_SUB, int8_t, float32_t>, fun<nm::EW_SUB, int8_t, float64_t>, fun<nm::EW_SUB, int8_t, nm::Complex64>, fun<nm::EW_SUB, int8_t, nm::Complex128>, \
|
306
|
+
NULL}, \
|
307
|
+
\
|
308
|
+
{fun<nm::EW_SUB, int16_t, uint8_t>, fun<nm::EW_SUB, int16_t, int8_t>, fun<nm::EW_SUB, int16_t, int16_t>, fun<nm::EW_SUB, int16_t, int32_t>, fun<nm::EW_SUB, int16_t, int64_t>, \
|
309
|
+
fun<nm::EW_SUB, int16_t, float32_t>, fun<nm::EW_SUB, int16_t, float64_t>, fun<nm::EW_SUB, int16_t, nm::Complex64>, fun<nm::EW_SUB, int16_t, nm::Complex128>, \
|
310
|
+
NULL}, \
|
311
|
+
\
|
312
|
+
{fun<nm::EW_SUB, int32_t, uint8_t>, fun<nm::EW_SUB, int32_t, int8_t>, fun<nm::EW_SUB, int32_t, int16_t>, fun<nm::EW_SUB, int32_t, int32_t>, fun<nm::EW_SUB, int32_t, int64_t>, \
|
313
|
+
fun<nm::EW_SUB, int32_t, float32_t>, fun<nm::EW_SUB, int32_t, float64_t>, fun<nm::EW_SUB, int32_t, nm::Complex64>, fun<nm::EW_SUB, int32_t, nm::Complex128>, \
|
314
|
+
NULL}, \
|
315
|
+
\
|
316
|
+
{fun<nm::EW_SUB, int64_t, uint8_t>, fun<nm::EW_SUB, int64_t, int8_t>, fun<nm::EW_SUB, int64_t, int16_t>, fun<nm::EW_SUB, int64_t, int32_t>, fun<nm::EW_SUB, int64_t, int64_t>, \
|
317
|
+
fun<nm::EW_SUB, int64_t, float32_t>, fun<nm::EW_SUB, int64_t, float64_t>, fun<nm::EW_SUB, int64_t, nm::Complex64>, fun<nm::EW_SUB, int64_t, nm::Complex128>, \
|
318
|
+
NULL}, \
|
319
|
+
\
|
320
|
+
{fun<nm::EW_SUB, float32_t, uint8_t>, fun<nm::EW_SUB, float32_t, int8_t>, fun<nm::EW_SUB, float32_t, int16_t>, fun<nm::EW_SUB, float32_t, int32_t>, fun<nm::EW_SUB, float32_t, int64_t>, \
|
321
|
+
fun<nm::EW_SUB, float32_t, float32_t>, fun<nm::EW_SUB, float32_t, float64_t>, fun<nm::EW_SUB, float32_t, nm::Complex64>, fun<nm::EW_SUB, float32_t, nm::Complex128>, \
|
322
|
+
NULL}, \
|
323
|
+
\
|
324
|
+
{fun<nm::EW_SUB, float64_t, uint8_t>, fun<nm::EW_SUB, float64_t, int8_t>, fun<nm::EW_SUB, float64_t, int16_t>, fun<nm::EW_SUB, float64_t, int32_t>, fun<nm::EW_SUB, float64_t, int64_t>, \
|
325
|
+
fun<nm::EW_SUB, float64_t, float32_t>, fun<nm::EW_SUB, float64_t, float64_t>, fun<nm::EW_SUB, float64_t, nm::Complex64>, fun<nm::EW_SUB, float64_t, nm::Complex128>, \
|
326
|
+
NULL}, \
|
327
|
+
\
|
328
|
+
{fun<nm::EW_SUB, nm::Complex64, uint8_t>, fun<nm::EW_SUB, nm::Complex64, int8_t>, fun<nm::EW_SUB, nm::Complex64, int16_t>, fun<nm::EW_SUB, nm::Complex64, int32_t>, \
|
329
|
+
fun<nm::EW_SUB, nm::Complex64, int64_t>, fun<nm::EW_SUB, nm::Complex64, float32_t>, fun<nm::EW_SUB, nm::Complex64, float64_t>, fun<nm::EW_SUB, nm::Complex64, nm::Complex64>, \
|
330
|
+
fun<nm::EW_SUB, nm::Complex64, nm::Complex128>, \
|
331
|
+
NULL}, \
|
332
|
+
\
|
333
|
+
{fun<nm::EW_SUB, nm::Complex128, uint8_t>, fun<nm::EW_SUB, nm::Complex128, int8_t>, fun<nm::EW_SUB, nm::Complex128, int16_t>, fun<nm::EW_SUB, nm::Complex128, int32_t>, \
|
334
|
+
fun<nm::EW_SUB, nm::Complex128, int64_t>, fun<nm::EW_SUB, nm::Complex128, float32_t>, fun<nm::EW_SUB, nm::Complex128, float64_t>, fun<nm::EW_SUB, nm::Complex128, nm::Complex64>, \
|
335
|
+
fun<nm::EW_SUB, nm::Complex128, nm::Complex128>, \
|
336
|
+
\
|
337
|
+
{NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, fun<nm::EW_SUB, nm::RubyObject, nm::RubyObject>} \
|
338
|
+
}, \
|
339
|
+
\
|
340
|
+
{ \
|
341
|
+
{fun<nm::EW_MUL, uint8_t, uint8_t>, fun<nm::EW_MUL, uint8_t, int8_t>, fun<nm::EW_MUL, uint8_t, int16_t>, fun<nm::EW_MUL, uint8_t, int32_t>, fun<nm::EW_MUL, uint8_t, int64_t>, \
|
342
|
+
fun<nm::EW_MUL, uint8_t, float32_t>, fun<nm::EW_MUL, uint8_t, float64_t>, fun<nm::EW_MUL, uint8_t, nm::Complex64>, fun<nm::EW_MUL, uint8_t, nm::Complex128>, \
|
343
|
+
NULL}, \
|
344
|
+
\
|
345
|
+
{fun<nm::EW_MUL, int8_t, uint8_t>, fun<nm::EW_MUL, int8_t, int8_t>, fun<nm::EW_MUL, int8_t, int16_t>, fun<nm::EW_MUL, int8_t, int32_t>, fun<nm::EW_MUL, int8_t, int64_t>, \
|
346
|
+
fun<nm::EW_MUL, int8_t, float32_t>, fun<nm::EW_MUL, int8_t, float64_t>, fun<nm::EW_MUL, int8_t, nm::Complex64>, fun<nm::EW_MUL, int8_t, nm::Complex128>, \
|
347
|
+
NULL}, \
|
348
|
+
\
|
349
|
+
{fun<nm::EW_MUL, int16_t, uint8_t>, fun<nm::EW_MUL, int16_t, int8_t>, fun<nm::EW_MUL, int16_t, int16_t>, fun<nm::EW_MUL, int16_t, int32_t>, fun<nm::EW_MUL, int16_t, int64_t>, \
|
350
|
+
fun<nm::EW_MUL, int16_t, float32_t>, fun<nm::EW_MUL, int16_t, float64_t>, fun<nm::EW_MUL, int16_t, nm::Complex64>, fun<nm::EW_MUL, int16_t, nm::Complex128>, \
|
351
|
+
NULL}, \
|
352
|
+
\
|
353
|
+
{fun<nm::EW_MUL, int32_t, uint8_t>, fun<nm::EW_MUL, int32_t, int8_t>, fun<nm::EW_MUL, int32_t, int16_t>, fun<nm::EW_MUL, int32_t, int32_t>, fun<nm::EW_MUL, int32_t, int64_t>, \
|
354
|
+
fun<nm::EW_MUL, int32_t, float32_t>, fun<nm::EW_MUL, int32_t, float64_t>, fun<nm::EW_MUL, int32_t, nm::Complex64>, fun<nm::EW_MUL, int32_t, nm::Complex128>, \
|
355
|
+
NULL}, \
|
356
|
+
\
|
357
|
+
{fun<nm::EW_MUL, int64_t, uint8_t>, fun<nm::EW_MUL, int64_t, int8_t>, fun<nm::EW_MUL, int64_t, int16_t>, fun<nm::EW_MUL, int64_t, int32_t>, fun<nm::EW_MUL, int64_t, int64_t>, \
|
358
|
+
fun<nm::EW_MUL, int64_t, float32_t>, fun<nm::EW_MUL, int64_t, float64_t>, fun<nm::EW_MUL, int64_t, nm::Complex64>, fun<nm::EW_MUL, int64_t, nm::Complex128>, \
|
359
|
+
NULL}, \
|
360
|
+
\
|
361
|
+
{fun<nm::EW_MUL, float32_t, uint8_t>, fun<nm::EW_MUL, float32_t, int8_t>, fun<nm::EW_MUL, float32_t, int16_t>, fun<nm::EW_MUL, float32_t, int32_t>, fun<nm::EW_MUL, float32_t, int64_t>, \
|
362
|
+
fun<nm::EW_MUL, float32_t, float32_t>, fun<nm::EW_MUL, float32_t, float64_t>, fun<nm::EW_MUL, float32_t, nm::Complex64>, fun<nm::EW_MUL, float32_t, nm::Complex128>, \
|
363
|
+
NULL}, \
|
364
|
+
\
|
365
|
+
{fun<nm::EW_MUL, float64_t, uint8_t>, fun<nm::EW_MUL, float64_t, int8_t>, fun<nm::EW_MUL, float64_t, int16_t>, fun<nm::EW_MUL, float64_t, int32_t>, fun<nm::EW_MUL, float64_t, int64_t>, \
|
366
|
+
fun<nm::EW_MUL, float64_t, float32_t>, fun<nm::EW_MUL, float64_t, float64_t>, fun<nm::EW_MUL, float64_t, nm::Complex64>, fun<nm::EW_MUL, float64_t, nm::Complex128>, \
|
367
|
+
NULL}, \
|
368
|
+
\
|
369
|
+
{fun<nm::EW_MUL, nm::Complex64, uint8_t>, fun<nm::EW_MUL, nm::Complex64, int8_t>, fun<nm::EW_MUL, nm::Complex64, int16_t>, fun<nm::EW_MUL, nm::Complex64, int32_t>, \
|
370
|
+
fun<nm::EW_MUL, nm::Complex64, int64_t>, fun<nm::EW_MUL, nm::Complex64, float32_t>, fun<nm::EW_MUL, nm::Complex64, float64_t>, fun<nm::EW_MUL, nm::Complex64, nm::Complex64>, \
|
371
|
+
fun<nm::EW_MUL, nm::Complex64, nm::Complex128>, \
|
372
|
+
NULL}, \
|
373
|
+
\
|
374
|
+
{fun<nm::EW_MUL, nm::Complex128, uint8_t>, fun<nm::EW_MUL, nm::Complex128, int8_t>, fun<nm::EW_MUL, nm::Complex128, int16_t>, fun<nm::EW_MUL, nm::Complex128, int32_t>, \
|
375
|
+
fun<nm::EW_MUL, nm::Complex128, int64_t>, fun<nm::EW_MUL, nm::Complex128, float32_t>, fun<nm::EW_MUL, nm::Complex128, float64_t>, fun<nm::EW_MUL, nm::Complex128, nm::Complex64>, \
|
376
|
+
fun<nm::EW_MUL, nm::Complex128, nm::Complex128>, \
|
377
|
+
\
|
378
|
+
{ \
|
379
|
+
{fun<nm::EW_DIV, uint8_t, uint8_t>, fun<nm::EW_DIV, uint8_t, int8_t>, fun<nm::EW_DIV, uint8_t, int16_t>, fun<nm::EW_DIV, uint8_t, int32_t>, fun<nm::EW_DIV, uint8_t, int64_t>, \
|
380
|
+
fun<nm::EW_DIV, uint8_t, float32_t>, fun<nm::EW_DIV, uint8_t, float64_t>, fun<nm::EW_DIV, uint8_t, nm::Complex64>, fun<nm::EW_DIV, uint8_t, nm::Complex128>, \
|
381
|
+
NULL}, \
|
382
|
+
\
|
383
|
+
{fun<nm::EW_DIV, int8_t, uint8_t>, fun<nm::EW_DIV, int8_t, int8_t>, fun<nm::EW_DIV, int8_t, int16_t>, fun<nm::EW_DIV, int8_t, int32_t>, fun<nm::EW_DIV, int8_t, int64_t>, \
|
384
|
+
fun<nm::EW_DIV, int8_t, float32_t>, fun<nm::EW_DIV, int8_t, float64_t>, fun<nm::EW_DIV, int8_t, nm::Complex64>, fun<nm::EW_DIV, int8_t, nm::Complex128>, \
|
385
|
+
NULL}, \
|
386
|
+
\
|
387
|
+
{fun<nm::EW_DIV, int16_t, uint8_t>, fun<nm::EW_DIV, int16_t, int8_t>, fun<nm::EW_DIV, int16_t, int16_t>, fun<nm::EW_DIV, int16_t, int32_t>, fun<nm::EW_DIV, int16_t, int64_t>, \
|
388
|
+
fun<nm::EW_DIV, int16_t, float32_t>, fun<nm::EW_DIV, int16_t, float64_t>, fun<nm::EW_DIV, int16_t, nm::Complex64>, fun<nm::EW_DIV, int16_t, nm::Complex128>, \
|
389
|
+
NULL}, \
|
390
|
+
\
|
391
|
+
{fun<nm::EW_DIV, int32_t, uint8_t>, fun<nm::EW_DIV, int32_t, int8_t>, fun<nm::EW_DIV, int32_t, int16_t>, fun<nm::EW_DIV, int32_t, int32_t>, fun<nm::EW_DIV, int32_t, int64_t>, \
|
392
|
+
fun<nm::EW_DIV, int32_t, float32_t>, fun<nm::EW_DIV, int32_t, float64_t>, fun<nm::EW_DIV, int32_t, nm::Complex64>, fun<nm::EW_DIV, int32_t, nm::Complex128>, \
|
393
|
+
NULL}, \
|
394
|
+
\
|
395
|
+
{fun<nm::EW_DIV, int64_t, uint8_t>, fun<nm::EW_DIV, int64_t, int8_t>, fun<nm::EW_DIV, int64_t, int16_t>, fun<nm::EW_DIV, int64_t, int32_t>, fun<nm::EW_DIV, int64_t, int64_t>, \
|
396
|
+
fun<nm::EW_DIV, int64_t, float32_t>, fun<nm::EW_DIV, int64_t, float64_t>, fun<nm::EW_DIV, int64_t, nm::Complex64>, fun<nm::EW_DIV, int64_t, nm::Complex128>, \
|
397
|
+
NULL}, \
|
398
|
+
\
|
399
|
+
{fun<nm::EW_DIV, float32_t, uint8_t>, fun<nm::EW_DIV, float32_t, int8_t>, fun<nm::EW_DIV, float32_t, int16_t>, fun<nm::EW_DIV, float32_t, int32_t>, fun<nm::EW_DIV, float32_t, int64_t>, \
|
400
|
+
fun<nm::EW_DIV, float32_t, float32_t>, fun<nm::EW_DIV, float32_t, float64_t>, fun<nm::EW_DIV, float32_t, nm::Complex64>, fun<nm::EW_DIV, float32_t, nm::Complex128>, \
|
401
|
+
NULL}, \
|
402
|
+
\
|
403
|
+
{fun<nm::EW_DIV, float64_t, uint8_t>, fun<nm::EW_DIV, float64_t, int8_t>, fun<nm::EW_DIV, float64_t, int16_t>, fun<nm::EW_DIV, float64_t, int32_t>, fun<nm::EW_DIV, float64_t, int64_t>, \
|
404
|
+
fun<nm::EW_DIV, float64_t, float32_t>, fun<nm::EW_DIV, float64_t, float64_t>, fun<nm::EW_DIV, float64_t, nm::Complex64>, fun<nm::EW_DIV, float64_t, nm::Complex128>, \
|
405
|
+
NULL}, \
|
406
|
+
\
|
407
|
+
{fun<nm::EW_DIV, nm::Complex64, uint8_t>, fun<nm::EW_DIV, nm::Complex64, int8_t>, fun<nm::EW_DIV, nm::Complex64, int16_t>, fun<nm::EW_DIV, nm::Complex64, int32_t>, \
|
408
|
+
fun<nm::EW_DIV, nm::Complex64, int64_t>, fun<nm::EW_DIV, nm::Complex64, float32_t>, fun<nm::EW_DIV, nm::Complex64, float64_t>, fun<nm::EW_DIV, nm::Complex64, nm::Complex64>, \
|
409
|
+
fun<nm::EW_DIV, nm::Complex64, nm::Complex128>, \
|
410
|
+
NULL}, \
|
411
|
+
\
|
412
|
+
{fun<nm::EW_DIV, nm::Complex128, uint8_t>, fun<nm::EW_DIV, nm::Complex128, int8_t>, fun<nm::EW_DIV, nm::Complex128, int16_t>, fun<nm::EW_DIV, nm::Complex128, int32_t>, \
|
413
|
+
fun<nm::EW_DIV, nm::Complex128, int64_t>, fun<nm::EW_DIV, nm::Complex128, float32_t>, fun<nm::EW_DIV, nm::Complex128, float64_t>, fun<nm::EW_DIV, nm::Complex128, nm::Complex64>, \
|
414
|
+
fun<nm::EW_DIV, nm::Complex128, nm::Complex128>, \
|
415
|
+
NULL}, \
|
401
416
|
\
|
402
|
-
|
403
|
-
|
404
|
-
|
417
|
+
{NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, fun<nm::EW_DIV, nm::RubyObject, nm::RubyObject>} \
|
418
|
+
}, \
|
419
|
+
\
|
405
420
|
{ \
|
406
|
-
{fun<nm::EW_POW, uint8_t, uint8_t>, fun<nm::EW_POW, uint8_t, int8_t>, fun<nm::EW_POW, uint8_t, int16_t>, fun<nm::EW_POW, uint8_t, int32_t>, fun<nm::EW_POW, uint8_t, int64_t>,
|
407
|
-
fun<nm::EW_POW, uint8_t, float32_t>, fun<nm::EW_POW, uint8_t, float64_t>, fun<nm::EW_POW, uint8_t, nm::Complex64>, fun<nm::EW_POW, uint8_t, nm::Complex128>,
|
408
|
-
NULL},
|
421
|
+
{fun<nm::EW_POW, uint8_t, uint8_t>, fun<nm::EW_POW, uint8_t, int8_t>, fun<nm::EW_POW, uint8_t, int16_t>, fun<nm::EW_POW, uint8_t, int32_t>, fun<nm::EW_POW, uint8_t, int64_t>, \
|
422
|
+
fun<nm::EW_POW, uint8_t, float32_t>, fun<nm::EW_POW, uint8_t, float64_t>, fun<nm::EW_POW, uint8_t, nm::Complex64>, fun<nm::EW_POW, uint8_t, nm::Complex128>, \
|
423
|
+
NULL}, \
|
409
424
|
\
|
410
|
-
{fun<nm::EW_POW, int8_t, uint8_t>, fun<nm::EW_POW, int8_t, int8_t>, fun<nm::EW_POW, int8_t, int16_t>, fun<nm::EW_POW, int8_t, int32_t>, fun<nm::EW_POW, int8_t, int64_t>,
|
411
|
-
fun<nm::EW_POW, int8_t, float32_t>, fun<nm::EW_POW, int8_t, float64_t>, fun<nm::EW_POW, int8_t, nm::Complex64>, fun<nm::EW_POW, int8_t, nm::Complex128>,
|
412
|
-
NULL},
|
425
|
+
{fun<nm::EW_POW, int8_t, uint8_t>, fun<nm::EW_POW, int8_t, int8_t>, fun<nm::EW_POW, int8_t, int16_t>, fun<nm::EW_POW, int8_t, int32_t>, fun<nm::EW_POW, int8_t, int64_t>, \
|
426
|
+
fun<nm::EW_POW, int8_t, float32_t>, fun<nm::EW_POW, int8_t, float64_t>, fun<nm::EW_POW, int8_t, nm::Complex64>, fun<nm::EW_POW, int8_t, nm::Complex128>, \
|
427
|
+
NULL}, \
|
413
428
|
\
|
414
|
-
{fun<nm::EW_POW, int16_t, uint8_t>, fun<nm::EW_POW, int16_t, int8_t>, fun<nm::EW_POW, int16_t, int16_t>, fun<nm::EW_POW, int16_t, int32_t>, fun<nm::EW_POW, int16_t, int64_t>,
|
415
|
-
fun<nm::EW_POW, int16_t, float32_t>, fun<nm::EW_POW, int16_t, float64_t>, fun<nm::EW_POW, int16_t, nm::Complex64>, fun<nm::EW_POW, int16_t, nm::Complex128>,
|
416
|
-
NULL},
|
429
|
+
{fun<nm::EW_POW, int16_t, uint8_t>, fun<nm::EW_POW, int16_t, int8_t>, fun<nm::EW_POW, int16_t, int16_t>, fun<nm::EW_POW, int16_t, int32_t>, fun<nm::EW_POW, int16_t, int64_t>, \
|
430
|
+
fun<nm::EW_POW, int16_t, float32_t>, fun<nm::EW_POW, int16_t, float64_t>, fun<nm::EW_POW, int16_t, nm::Complex64>, fun<nm::EW_POW, int16_t, nm::Complex128>, \
|
431
|
+
NULL}, \
|
417
432
|
\
|
418
|
-
{fun<nm::EW_POW, int32_t, uint8_t>, fun<nm::EW_POW, int32_t, int8_t>, fun<nm::EW_POW, int32_t, int16_t>, fun<nm::EW_POW, int32_t, int32_t>, fun<nm::EW_POW, int32_t, int64_t>,
|
419
|
-
fun<nm::EW_POW, int32_t, float32_t>, fun<nm::EW_POW, int32_t, float64_t>, fun<nm::EW_POW, int32_t, nm::Complex64>, fun<nm::EW_POW, int32_t, nm::Complex128>,
|
420
|
-
NULL},
|
433
|
+
{fun<nm::EW_POW, int32_t, uint8_t>, fun<nm::EW_POW, int32_t, int8_t>, fun<nm::EW_POW, int32_t, int16_t>, fun<nm::EW_POW, int32_t, int32_t>, fun<nm::EW_POW, int32_t, int64_t>, \
|
434
|
+
fun<nm::EW_POW, int32_t, float32_t>, fun<nm::EW_POW, int32_t, float64_t>, fun<nm::EW_POW, int32_t, nm::Complex64>, fun<nm::EW_POW, int32_t, nm::Complex128>, \
|
435
|
+
NULL}, \
|
421
436
|
\
|
422
|
-
{fun<nm::EW_POW, int64_t, uint8_t>, fun<nm::EW_POW, int64_t, int8_t>, fun<nm::EW_POW, int64_t, int16_t>, fun<nm::EW_POW, int64_t, int32_t>, fun<nm::EW_POW, int64_t, int64_t>,
|
423
|
-
fun<nm::EW_POW, int64_t, float32_t>, fun<nm::EW_POW, int64_t, float64_t>, fun<nm::EW_POW, int64_t, nm::Complex64>, fun<nm::EW_POW, int64_t, nm::Complex128>,
|
424
|
-
NULL},
|
437
|
+
{fun<nm::EW_POW, int64_t, uint8_t>, fun<nm::EW_POW, int64_t, int8_t>, fun<nm::EW_POW, int64_t, int16_t>, fun<nm::EW_POW, int64_t, int32_t>, fun<nm::EW_POW, int64_t, int64_t>, \
|
438
|
+
fun<nm::EW_POW, int64_t, float32_t>, fun<nm::EW_POW, int64_t, float64_t>, fun<nm::EW_POW, int64_t, nm::Complex64>, fun<nm::EW_POW, int64_t, nm::Complex128>, \
|
439
|
+
NULL}, \
|
425
440
|
\
|
426
|
-
{fun<nm::EW_POW, float32_t, uint8_t>, fun<nm::EW_POW, float32_t, int8_t>, fun<nm::EW_POW, float32_t, int16_t>, fun<nm::EW_POW, float32_t, int32_t>, fun<nm::EW_POW, float32_t, int64_t>,
|
427
|
-
fun<nm::EW_POW, float32_t, float32_t>, fun<nm::EW_POW, float32_t, float64_t>, fun<nm::EW_POW, float32_t, nm::Complex64>, fun<nm::EW_POW, float32_t, nm::Complex128>,
|
428
|
-
NULL},
|
441
|
+
{fun<nm::EW_POW, float32_t, uint8_t>, fun<nm::EW_POW, float32_t, int8_t>, fun<nm::EW_POW, float32_t, int16_t>, fun<nm::EW_POW, float32_t, int32_t>, fun<nm::EW_POW, float32_t, int64_t>, \
|
442
|
+
fun<nm::EW_POW, float32_t, float32_t>, fun<nm::EW_POW, float32_t, float64_t>, fun<nm::EW_POW, float32_t, nm::Complex64>, fun<nm::EW_POW, float32_t, nm::Complex128>, \
|
443
|
+
NULL}, \
|
429
444
|
\
|
430
|
-
{fun<nm::EW_POW, float64_t, uint8_t>, fun<nm::EW_POW, float64_t, int8_t>, fun<nm::EW_POW, float64_t, int16_t>, fun<nm::EW_POW, float64_t, int32_t>, fun<nm::EW_POW, float64_t, int64_t>,
|
431
|
-
fun<nm::EW_POW, float64_t, float32_t>, fun<nm::EW_POW, float64_t, float64_t>, fun<nm::EW_POW, float64_t, nm::Complex64>, fun<nm::EW_POW, float64_t, nm::Complex128>,
|
432
|
-
NULL},
|
445
|
+
{fun<nm::EW_POW, float64_t, uint8_t>, fun<nm::EW_POW, float64_t, int8_t>, fun<nm::EW_POW, float64_t, int16_t>, fun<nm::EW_POW, float64_t, int32_t>, fun<nm::EW_POW, float64_t, int64_t>, \
|
446
|
+
fun<nm::EW_POW, float64_t, float32_t>, fun<nm::EW_POW, float64_t, float64_t>, fun<nm::EW_POW, float64_t, nm::Complex64>, fun<nm::EW_POW, float64_t, nm::Complex128>, \
|
447
|
+
NULL}, \
|
433
448
|
\
|
434
|
-
{fun<nm::EW_POW, nm::Complex64, uint8_t>, fun<nm::EW_POW, nm::Complex64, int8_t>, fun<nm::EW_POW, nm::Complex64, int16_t>, fun<nm::EW_POW, nm::Complex64, int32_t>,
|
435
|
-
fun<nm::EW_POW, nm::Complex64, int64_t>, fun<nm::EW_POW, nm::Complex64, float32_t>, fun<nm::EW_POW, nm::Complex64, float64_t>, fun<nm::EW_POW, nm::Complex64, nm::Complex64>,
|
436
|
-
fun<nm::EW_POW, nm::Complex64, nm::Complex128>,
|
437
|
-
NULL},
|
449
|
+
{fun<nm::EW_POW, nm::Complex64, uint8_t>, fun<nm::EW_POW, nm::Complex64, int8_t>, fun<nm::EW_POW, nm::Complex64, int16_t>, fun<nm::EW_POW, nm::Complex64, int32_t>, \
|
450
|
+
fun<nm::EW_POW, nm::Complex64, int64_t>, fun<nm::EW_POW, nm::Complex64, float32_t>, fun<nm::EW_POW, nm::Complex64, float64_t>, fun<nm::EW_POW, nm::Complex64, nm::Complex64>, \
|
451
|
+
fun<nm::EW_POW, nm::Complex64, nm::Complex128>, \
|
452
|
+
NULL}, \
|
438
453
|
\
|
439
|
-
{fun<nm::EW_POW, nm::Complex128, uint8_t>, fun<nm::EW_POW, nm::Complex128, int8_t>, fun<nm::EW_POW, nm::Complex128, int16_t>, fun<nm::EW_POW, nm::Complex128, int32_t>,
|
440
|
-
fun<nm::EW_POW, nm::Complex128, int64_t>, fun<nm::EW_POW, nm::Complex128, float32_t>, fun<nm::EW_POW, nm::Complex128, float64_t>, fun<nm::EW_POW, nm::Complex128, nm::Complex64>,
|
441
|
-
fun<nm::EW_POW, nm::Complex128, nm::Complex128>,
|
442
|
-
NULL},
|
454
|
+
{fun<nm::EW_POW, nm::Complex128, uint8_t>, fun<nm::EW_POW, nm::Complex128, int8_t>, fun<nm::EW_POW, nm::Complex128, int16_t>, fun<nm::EW_POW, nm::Complex128, int32_t>, \
|
455
|
+
fun<nm::EW_POW, nm::Complex128, int64_t>, fun<nm::EW_POW, nm::Complex128, float32_t>, fun<nm::EW_POW, nm::Complex128, float64_t>, fun<nm::EW_POW, nm::Complex128, nm::Complex64>, \
|
456
|
+
fun<nm::EW_POW, nm::Complex128, nm::Complex128>, \
|
457
|
+
NULL}, \
|
443
458
|
\
|
444
|
-
{NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, fun<nm::EW_POW, nm::RubyObject, nm::RubyObject>}
|
459
|
+
{NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, fun<nm::EW_POW, nm::RubyObject, nm::RubyObject>} \
|
445
460
|
}, \
|
446
461
|
\
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
462
|
+
{ \
|
463
|
+
{fun<nm::EW_MOD, uint8_t, uint8_t>, fun<nm::EW_MOD, uint8_t, int8_t>, fun<nm::EW_MOD, uint8_t, int16_t>, fun<nm::EW_MOD, uint8_t, int32_t>, fun<nm::EW_MOD, uint8_t, int64_t>, \
|
464
|
+
fun<nm::EW_MOD, uint8_t, float32_t>, fun<nm::EW_MOD, uint8_t, float64_t>, fun<nm::EW_MOD, uint8_t, nm::Complex64>, fun<nm::EW_MOD, uint8_t, nm::Complex128>, \
|
465
|
+
NULL}, \
|
466
|
+
\
|
467
|
+
{fun<nm::EW_MOD, int8_t, uint8_t>, fun<nm::EW_MOD, int8_t, int8_t>, fun<nm::EW_MOD, int8_t, int16_t>, fun<nm::EW_MOD, int8_t, int32_t>, fun<nm::EW_MOD, int8_t, int64_t>, \
|
468
|
+
fun<nm::EW_MOD, int8_t, float32_t>, fun<nm::EW_MOD, int8_t, float64_t>, fun<nm::EW_MOD, int8_t, nm::Complex64>, fun<nm::EW_MOD, int8_t, nm::Complex128>, \
|
469
|
+
NULL}, \
|
470
|
+
\
|
471
|
+
{fun<nm::EW_MOD, int16_t, uint8_t>, fun<nm::EW_MOD, int16_t, int8_t>, fun<nm::EW_MOD, int16_t, int16_t>, fun<nm::EW_MOD, int16_t, int32_t>, fun<nm::EW_MOD, int16_t, int64_t>, \
|
472
|
+
fun<nm::EW_MOD, int16_t, float32_t>, fun<nm::EW_MOD, int16_t, float64_t>, fun<nm::EW_MOD, int16_t, nm::Complex64>, fun<nm::EW_MOD, int16_t, nm::Complex128>, \
|
473
|
+
NULL}, \
|
474
|
+
\
|
475
|
+
{fun<nm::EW_MOD, int32_t, uint8_t>, fun<nm::EW_MOD, int32_t, int8_t>, fun<nm::EW_MOD, int32_t, int16_t>, fun<nm::EW_MOD, int32_t, int32_t>, fun<nm::EW_MOD, int32_t, int64_t>, \
|
476
|
+
fun<nm::EW_MOD, int32_t, float32_t>, fun<nm::EW_MOD, int32_t, float64_t>, fun<nm::EW_MOD, int32_t, nm::Complex64>, fun<nm::EW_MOD, int32_t, nm::Complex128>, \
|
477
|
+
NULL}, \
|
478
|
+
\
|
479
|
+
{fun<nm::EW_MOD, int64_t, uint8_t>, fun<nm::EW_MOD, int64_t, int8_t>, fun<nm::EW_MOD, int64_t, int16_t>, fun<nm::EW_MOD, int64_t, int32_t>, fun<nm::EW_MOD, int64_t, int64_t>, \
|
480
|
+
fun<nm::EW_MOD, int64_t, float32_t>, fun<nm::EW_MOD, int64_t, float64_t>, fun<nm::EW_MOD, int64_t, nm::Complex64>, fun<nm::EW_MOD, int64_t, nm::Complex128>, \
|
481
|
+
NULL}, \
|
482
|
+
\
|
483
|
+
{fun<nm::EW_MOD, float32_t, uint8_t>, fun<nm::EW_MOD, float32_t, int8_t>, fun<nm::EW_MOD, float32_t, int16_t>, fun<nm::EW_MOD, float32_t, int32_t>, fun<nm::EW_MOD, float32_t, int64_t>, \
|
484
|
+
fun<nm::EW_MOD, float32_t, float32_t>, fun<nm::EW_MOD, float32_t, float64_t>, fun<nm::EW_MOD, float32_t, nm::Complex64>, fun<nm::EW_MOD, float32_t, nm::Complex128>, \
|
485
|
+
NULL}, \
|
486
|
+
\
|
487
|
+
{fun<nm::EW_MOD, float64_t, uint8_t>, fun<nm::EW_MOD, float64_t, int8_t>, fun<nm::EW_MOD, float64_t, int16_t>, fun<nm::EW_MOD, float64_t, int32_t>, fun<nm::EW_MOD, float64_t, int64_t>, \
|
488
|
+
fun<nm::EW_MOD, float64_t, float32_t>, fun<nm::EW_MOD, float64_t, float64_t>, fun<nm::EW_MOD, float64_t, nm::Complex64>, fun<nm::EW_MOD, float64_t, nm::Complex128>, \
|
489
|
+
NULL}, \
|
490
|
+
\
|
491
|
+
{fun<nm::EW_MOD, nm::Complex64, uint8_t>, fun<nm::EW_MOD, nm::Complex64, int8_t>, fun<nm::EW_MOD, nm::Complex64, int16_t>, fun<nm::EW_MOD, nm::Complex64, int32_t>, \
|
492
|
+
fun<nm::EW_MOD, nm::Complex64, int64_t>, fun<nm::EW_MOD, nm::Complex64, float32_t>, fun<nm::EW_MOD, nm::Complex64, float64_t>, fun<nm::EW_MOD, nm::Complex64, nm::Complex64>, \
|
493
|
+
fun<nm::EW_MOD, nm::Complex64, nm::Complex128>, \
|
494
|
+
NULL}, \
|
495
|
+
\
|
496
|
+
{fun<nm::EW_MOD, nm::Complex128, uint8_t>, fun<nm::EW_MOD, nm::Complex128, int8_t>, fun<nm::EW_MOD, nm::Complex128, int16_t>, fun<nm::EW_MOD, nm::Complex128, int32_t>, \
|
497
|
+
fun<nm::EW_MOD, nm::Complex128, int64_t>, fun<nm::EW_MOD, nm::Complex128, float32_t>, fun<nm::EW_MOD, nm::Complex128, float64_t>, fun<nm::EW_MOD, nm::Complex128, nm::Complex64>, \
|
498
|
+
fun<nm::EW_MOD, nm::Complex128, nm::Complex128>, \
|
499
|
+
NULL}, \
|
485
500
|
\
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
{
|
501
|
+
{NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, fun<nm::EW_MOD, nm::RubyObject, nm::RubyObject>} \
|
502
|
+
}, \
|
503
|
+
\
|
504
|
+
{ \
|
490
505
|
{fun<nm::EW_EQEQ, uint8_t, uint8_t>, fun<nm::EW_EQEQ, uint8_t, int8_t>, fun<nm::EW_EQEQ, uint8_t, int16_t>, fun<nm::EW_EQEQ, uint8_t, int32_t>, \
|
491
506
|
fun<nm::EW_EQEQ, uint8_t, int64_t>, fun<nm::EW_EQEQ, uint8_t, float32_t>, fun<nm::EW_EQEQ, uint8_t, float64_t>, fun<nm::EW_EQEQ, uint8_t, nm::Complex64>, \
|
492
507
|
fun<nm::EW_EQEQ, uint8_t, nm::Complex128>, \
|
@@ -552,7 +567,7 @@ namespace nm {
|
|
552
567
|
{fun<nm::EW_GEQ, nm::Complex128, uint8_t>, fun<nm::EW_GEQ, nm::Complex128, int8_t>, fun<nm::EW_GEQ, nm::Complex128, int16_t>, fun<nm::EW_GEQ, nm::Complex128, int32_t>, fun<nm::EW_GEQ, nm::Complex128, int64_t>, fun<nm::EW_GEQ, nm::Complex128, float32_t>, fun<nm::EW_GEQ, nm::Complex128, float64_t>, fun<nm::EW_GEQ, nm::Complex128, nm::Complex64>, fun<nm::EW_GEQ, nm::Complex128, nm::Complex128>, NULL}, \
|
553
568
|
{NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, fun<nm::EW_GEQ, nm::RubyObject, nm::RubyObject>} \
|
554
569
|
} \
|
555
|
-
|
570
|
+
};
|
556
571
|
|
557
572
|
/*
|
558
573
|
* Defines a static array that holds function pointers to an elementwise op,
|
@@ -561,8 +576,8 @@ namespace nm {
|
|
561
576
|
#define OP_ITYPE_DTYPE_TEMPLATE_TABLE(fun, ret, ...) NAMED_OP_ITYPE_DTYPE_TEMPLATE_TABLE(ttable, fun, ret, __VA_ARGS__)
|
562
577
|
|
563
578
|
#define NAMED_OP_ITYPE_DTYPE_TEMPLATE_TABLE(name, fun, ret, ...) \
|
564
|
-
|
565
|
-
|
579
|
+
static ret (*(name)[nm::NUM_EWOPS][nm::NUM_ITYPES][nm::NUM_DTYPES])(__VA_ARGS__) = \
|
580
|
+
{{{fun<nm::EW_ADD, uint8_t, uint8_t>,fun<nm::EW_ADD, uint8_t, int8_t>,fun<nm::EW_ADD, uint8_t, int16_t>,fun<nm::EW_ADD, uint8_t, int32_t>,fun<nm::EW_ADD, uint8_t, int64_t>,fun<nm::EW_ADD, uint8_t, float32_t>,fun<nm::EW_ADD, uint8_t, float64_t>,fun<nm::EW_ADD, uint8_t, nm::Complex64>,fun<nm::EW_ADD, uint8_t, nm::Complex128>,fun<nm::EW_ADD, uint8_t, nm::RubyObject>},\
|
566
581
|
{fun<nm::EW_ADD, uint16_t, uint8_t>,fun<nm::EW_ADD, uint16_t, int8_t>,fun<nm::EW_ADD, uint16_t, int16_t>,fun<nm::EW_ADD, uint16_t, int32_t>,fun<nm::EW_ADD, uint16_t, int64_t>,fun<nm::EW_ADD, uint16_t, float32_t>,fun<nm::EW_ADD, uint16_t, float64_t>,fun<nm::EW_ADD, uint16_t, nm::Complex64>,fun<nm::EW_ADD, uint16_t, nm::Complex128>,fun<nm::EW_ADD, uint16_t, nm::RubyObject>},\
|
567
582
|
{fun<nm::EW_ADD, uint32_t, uint8_t>,fun<nm::EW_ADD, uint32_t, int8_t>,fun<nm::EW_ADD, uint32_t, int16_t>,fun<nm::EW_ADD, uint32_t, int32_t>,fun<nm::EW_ADD, uint32_t, int64_t>,fun<nm::EW_ADD, uint32_t, float32_t>,fun<nm::EW_ADD, uint32_t, float64_t>,fun<nm::EW_ADD, uint32_t, nm::Complex64>,fun<nm::EW_ADD, uint32_t, nm::Complex128>,fun<nm::EW_ADD, uint32_t, nm::RubyObject>},\
|
568
583
|
{fun<nm::EW_ADD, uint64_t, uint8_t>,fun<nm::EW_ADD, uint64_t, int8_t>,fun<nm::EW_ADD, uint64_t, int16_t>,fun<nm::EW_ADD, uint64_t, int32_t>,fun<nm::EW_ADD, uint64_t, int64_t>,fun<nm::EW_ADD, uint64_t, float32_t>,fun<nm::EW_ADD, uint64_t, float64_t>,fun<nm::EW_ADD, uint64_t, nm::Complex64>,fun<nm::EW_ADD, uint64_t, nm::Complex128>,fun<nm::EW_ADD, uint64_t, nm::RubyObject>}},\
|
@@ -616,8 +631,8 @@ extern "C" {
|
|
616
631
|
*/
|
617
632
|
|
618
633
|
// regular data types
|
619
|
-
extern const char* const
|
620
|
-
extern const size_t
|
634
|
+
extern const char* const DTYPE_NAMES[nm::NUM_DTYPES];
|
635
|
+
extern const size_t DTYPE_SIZES[nm::NUM_DTYPES];
|
621
636
|
|
622
637
|
extern const nm::dtype_t Upcast[nm::NUM_DTYPES][nm::NUM_DTYPES];
|
623
638
|
|
@@ -627,9 +642,8 @@ extern const nm::dtype_t Upcast[nm::NUM_DTYPES][nm::NUM_DTYPES];
|
|
627
642
|
*/
|
628
643
|
|
629
644
|
|
630
|
-
void*
|
631
|
-
void
|
632
|
-
nm::RubyObject rubyobj_from_cval(void* val, nm::dtype_t dtype);
|
645
|
+
void* rubyobj_to_cval(VALUE val, nm::dtype_t dtype);
|
646
|
+
void rubyval_to_cval(VALUE val, nm::dtype_t dtype, void* loc);
|
633
647
|
|
634
648
|
void nm_init_data();
|
635
649
|
|