nmatrix 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. data/.gitignore +27 -0
  2. data/.rspec +2 -0
  3. data/Gemfile +3 -5
  4. data/Guardfile +6 -0
  5. data/History.txt +33 -0
  6. data/Manifest.txt +41 -38
  7. data/README.rdoc +88 -11
  8. data/Rakefile +35 -53
  9. data/ext/nmatrix/data/complex.h +372 -0
  10. data/ext/nmatrix/data/data.cpp +275 -0
  11. data/ext/nmatrix/data/data.h +707 -0
  12. data/ext/nmatrix/data/rational.h +421 -0
  13. data/ext/nmatrix/data/ruby_object.h +446 -0
  14. data/ext/nmatrix/extconf.rb +101 -51
  15. data/ext/nmatrix/new_extconf.rb +56 -0
  16. data/ext/nmatrix/nmatrix.cpp +1609 -0
  17. data/ext/nmatrix/nmatrix.h +265 -849
  18. data/ext/nmatrix/ruby_constants.cpp +134 -0
  19. data/ext/nmatrix/ruby_constants.h +103 -0
  20. data/ext/nmatrix/storage/common.cpp +70 -0
  21. data/ext/nmatrix/storage/common.h +170 -0
  22. data/ext/nmatrix/storage/dense.cpp +665 -0
  23. data/ext/nmatrix/storage/dense.h +116 -0
  24. data/ext/nmatrix/storage/list.cpp +1088 -0
  25. data/ext/nmatrix/storage/list.h +129 -0
  26. data/ext/nmatrix/storage/storage.cpp +658 -0
  27. data/ext/nmatrix/storage/storage.h +99 -0
  28. data/ext/nmatrix/storage/yale.cpp +1601 -0
  29. data/ext/nmatrix/storage/yale.h +208 -0
  30. data/ext/nmatrix/ttable_helper.rb +126 -0
  31. data/ext/nmatrix/{yale/smmp1_header.template.c → types.h} +36 -9
  32. data/ext/nmatrix/util/io.cpp +295 -0
  33. data/ext/nmatrix/util/io.h +117 -0
  34. data/ext/nmatrix/util/lapack.h +1175 -0
  35. data/ext/nmatrix/util/math.cpp +557 -0
  36. data/ext/nmatrix/util/math.h +1363 -0
  37. data/ext/nmatrix/util/sl_list.cpp +475 -0
  38. data/ext/nmatrix/util/sl_list.h +255 -0
  39. data/ext/nmatrix/util/util.h +78 -0
  40. data/lib/nmatrix/blas.rb +70 -0
  41. data/lib/nmatrix/io/mat5_reader.rb +567 -0
  42. data/lib/nmatrix/io/mat_reader.rb +162 -0
  43. data/lib/{string.rb → nmatrix/monkeys.rb} +49 -2
  44. data/lib/nmatrix/nmatrix.rb +199 -0
  45. data/lib/nmatrix/nvector.rb +103 -0
  46. data/lib/nmatrix/version.rb +27 -0
  47. data/lib/nmatrix.rb +22 -230
  48. data/nmatrix.gemspec +59 -0
  49. data/scripts/mac-brew-gcc.sh +47 -0
  50. data/spec/4x4_sparse.mat +0 -0
  51. data/spec/4x5_dense.mat +0 -0
  52. data/spec/blas_spec.rb +47 -0
  53. data/spec/elementwise_spec.rb +164 -0
  54. data/spec/io_spec.rb +60 -0
  55. data/spec/lapack_spec.rb +52 -0
  56. data/spec/math_spec.rb +96 -0
  57. data/spec/nmatrix_spec.rb +93 -89
  58. data/spec/nmatrix_yale_spec.rb +52 -36
  59. data/spec/nvector_spec.rb +1 -1
  60. data/spec/slice_spec.rb +257 -0
  61. data/spec/spec_helper.rb +51 -0
  62. data/spec/utm5940.mtx +83844 -0
  63. metadata +113 -71
  64. data/.autotest +0 -23
  65. data/.gemtest +0 -0
  66. data/ext/nmatrix/cblas.c +0 -150
  67. data/ext/nmatrix/dense/blas_header.template.c +0 -52
  68. data/ext/nmatrix/dense/elementwise.template.c +0 -107
  69. data/ext/nmatrix/dense/gemm.template.c +0 -159
  70. data/ext/nmatrix/dense/gemv.template.c +0 -130
  71. data/ext/nmatrix/dense/rationalmath.template.c +0 -68
  72. data/ext/nmatrix/dense.c +0 -307
  73. data/ext/nmatrix/depend +0 -18
  74. data/ext/nmatrix/generator/syntax_tree.rb +0 -481
  75. data/ext/nmatrix/generator.rb +0 -594
  76. data/ext/nmatrix/list.c +0 -774
  77. data/ext/nmatrix/nmatrix.c +0 -1977
  78. data/ext/nmatrix/rational.c +0 -98
  79. data/ext/nmatrix/yale/complexmath.template.c +0 -71
  80. data/ext/nmatrix/yale/elementwise.template.c +0 -46
  81. data/ext/nmatrix/yale/elementwise_op.template.c +0 -73
  82. data/ext/nmatrix/yale/numbmm.template.c +0 -94
  83. data/ext/nmatrix/yale/smmp1.template.c +0 -21
  84. data/ext/nmatrix/yale/smmp2.template.c +0 -43
  85. data/ext/nmatrix/yale/smmp2_header.template.c +0 -46
  86. data/ext/nmatrix/yale/sort_columns.template.c +0 -56
  87. data/ext/nmatrix/yale/symbmm.template.c +0 -54
  88. data/ext/nmatrix/yale/transp.template.c +0 -68
  89. data/ext/nmatrix/yale.c +0 -726
  90. data/lib/array.rb +0 -67
  91. data/spec/syntax_tree_spec.rb +0 -46
@@ -23,890 +23,306 @@
23
23
  //
24
24
  // == nmatrix.h
25
25
  //
26
+ // C and C++ API for NMatrix, and main header file.
26
27
 
27
28
  #ifndef NMATRIX_H
28
29
  #define NMATRIX_H
29
30
 
30
- #include "nmatrix_config.h"
31
-
32
- #include <cblas.h>
33
-
34
- #include <math.h>
31
+ /*
32
+ * Standard Includes
33
+ */
35
34
 
36
- #include <stdlib.h>
37
- #include <stdio.h>
38
- #include <string.h>
39
35
  #include <ruby.h>
40
- #define RUBY_ZERO INT2FIX(0)
41
36
 
42
- #ifdef BENCHMARK // SOURCE: http://stackoverflow.com/questions/2349776/how-can-i-benchmark-a-c-program-easily
43
- # include <sys/time.h>
44
- # include <sys/resource.h>
37
+ #ifdef __cplusplus
38
+ #include <cmath>
39
+ #include <cstring>
40
+ #else
41
+ #include <math.h>
42
+ #include <string.h>
45
43
  #endif
46
44
 
47
- #include "dtypes.h"
48
45
 
49
- #include <stddef.h>
50
- #ifdef HAVE_STDINT_H
51
- # include <stdint.h>
46
+
47
+ #ifdef BENCHMARK
48
+ // SOURCE: http://stackoverflow.com/questions/2349776/how-can-i-benchmark-a-c-program-easily
49
+ #ifdef __cplusplus
50
+ #include <sys/ctime>
51
+ #include <sys/cresource>
52
+ #else
53
+ #include <sys/time.h>
54
+ #include <sys/resource.h>
55
+ #endif
52
56
  #endif
53
57
 
54
58
  /*
55
- Data types used in NArray / NMatrix :
56
- Please modify these types if your system has any different type.
57
- */
58
-
59
-
60
- /* NM_BYTE : unsigned 8-bit integer */
61
- #ifndef HAVE_U_INT8_T
62
- # ifdef HAVE_UINT8_T
63
- typedef uint8_t u_int8_t;
64
- # else
65
- typedef unsigned char u_int8_t;
66
- # endif
67
- #endif
59
+ * Project Includes
60
+ */
68
61
 
69
- //#ifndef HAVE_INT8_T
70
- //typedef char int8_t;
71
- //#endif
72
-
73
- #ifndef HAVE_INT16_T
74
- # if SIZEOF_SHORT == 2
75
- typedef short int16_t;
76
- # else
77
- ---->> Please define int16_t manually because sizeof(short) != 2. <<----
78
- # endif
79
- #endif /* HAVE_INT16_T */
80
-
81
- #ifndef HAVE_INT32_T
82
- # if SIZEOF_LONG == 4
83
- typedef long int32_t;
84
- # else
85
- # if SIZEOF_INT == 4
86
- typedef int int32_t;
87
- # else
88
- ---->> Please define int32_t manually because sizeof(long) != 4. <<----
89
- # endif
90
- # endif
91
- #endif /* HAVE_INT32_T */
92
-
93
- /* unsigned 32-bit integer */
94
- #ifndef HAVE_U_INT32_T
95
- # ifdef HAVE_UINT32_T
96
- typedef uint32_t u_int32_t;
97
- # else
98
- # if SIZEOF_LONG == 4
99
- typedef unsigned long u_int32_t;
100
- # else
101
- # if SIZEOF_INT == 4
102
- typedef unsigned int u_int32_t;
103
- # else
104
- ---->> Please define u_int32_t manually because sizeof(long) != 4. <<----
105
- # endif
106
- # endif
107
- # endif
108
- #endif /* HAVE_U_INT32_T */
109
-
110
- #ifndef HAVE_INT64_T
111
- # if SIZEOF_QUAD == 8
112
- typedef quad int64_t;
113
- # else
114
- # if SIZEOF_LONG == 8
115
- typedef long int64_t;
116
- # else
117
- ---->> Please define int64_t manually because sizeof(quad) != 8. <<----
118
- # endif
119
- # endif
120
- #endif /* HAVE_INT64_T */
121
-
122
- /* unsigned 64-bit integer */
123
- #ifndef HAVE_U_INT64_T
124
- # ifdef HAVE_UINT64_T
125
- typedef uint64_t u_int64_t;
126
- # else
127
- # if SIZEOF_QUAD == 8
128
- typedef unsigned quad u_int64_t;
129
- # else
130
- # if SIZEOF_LONG == 8
131
- typedef unsigned long u_int64_t;
132
- # else
133
- ---->> Please define u_int64_t manually because sizeof(quad) != 8. <<----
134
- # endif
135
- # endif
136
- # endif
137
- #endif /* HAVE_U_INT64_T */
138
-
139
-
140
- #ifndef HAVE_SIZE_T /// If you modify this, make sure to modify the definition of y_size_t and Y_SIZE_T!
141
- typedef u_int64_t size_t;
142
- # define NM_SIZE_T NM_INT64
143
- #else
144
- # if SIZEOF_SIZE_T == 8
145
- # define NM_SIZE_T NM_INT64
146
- # else
147
- # if SIZEOF_SIZE_T == 4
148
- # define NM_SIZE_T NM_INT32
149
- # else
150
- ---->> Please define size_t and y_size_t manually because sizeof(size_t) is neither 8 nor 4. <<----
151
- # endif
152
- # endif
153
- #endif
154
62
 
155
- // for when we need to return array indices.
156
- // This must never be larger than size_t
157
- typedef uint32_t y_size_t;
158
- #define Y_SIZE_T NM_INT32
63
+ /*
64
+ * Macros
65
+ */
66
+
159
67
 
68
+ #define RUBY_ZERO INT2FIX(0)
160
69
 
161
- #ifdef HAVE_STDBOOL_H
162
- # include <stdbool.h>
70
+ #ifndef SIZEOF_INT
71
+ #error SIZEOF_INT undefined
163
72
  #else
164
- typedef char bool;
165
- # define true 1;
166
- # define false 0;
73
+ #if SIZEOF_INT == 8
74
+ #define DEFAULT_DTYPE INT64
75
+ #define SIZE_T INT64
76
+ #else
77
+ #if SIZEOF_INT == 4
78
+ #define DEFAULT_DTYPE INT32
79
+ #define SIZE_T INT32
80
+ #else
81
+ #if SIZEOF_INT == 2
82
+ #define DEFAULT_DTYPE INT16
83
+ #define SIZE_T INT16
84
+ #else
85
+ #error Unhandled SIZEOF_INT -- please #define SIZE_T and DEFAULT_DTYPE manually.
86
+ #endif
87
+ #endif
88
+ #endif
167
89
  #endif
168
90
 
91
+ /*
92
+ * == Macros for Concurrent C and C++ Header Maintenance
93
+ *
94
+ * These macros look complicated, but they're really not so bad. They're also important: they ensure that whether our
95
+ * header file (nmatrix.h) is read by a C++ or a C compiler, all the same data structures and enumerators exist, albeit
96
+ * with slightly different names.
97
+ *
98
+ * "But wait," you say, "You use structs. Structs exist in C and C++. Why use a macro to set them up?"
99
+ *
100
+ * Well, in C, you have to be explicit about what a struct is. You can actually get around that requirement by using a
101
+ * typedef:
102
+ *
103
+ * typedef struct STORAGE { ... } STORAGE;
104
+ *
105
+ * Also, we use C++ inheritance, which is obviously not allowed in C. So we have to ensure that the base class's members
106
+ * are exposed properly to our child classes.
107
+ *
108
+ * The macros also allow us to put all of our C++ types into namespaces. For C, we prefix everything with either nm_ or
109
+ * NM_ to distinguish our declarations from those in other libraries.
110
+ */
111
+
169
112
 
170
- typedef struct { float r,i; } complex64;
171
- typedef struct { double r,i; } complex128;
172
- typedef struct { int16_t n,d; } rational32;
173
- typedef struct { int32_t n,d; } rational64;
174
- typedef struct { int64_t n,d; } rational128;
113
+ #ifdef __cplusplus /* These are the C++ versions of the macros. */
175
114
 
115
+ #define NM_DECL_ENUM(enum_type, name) enum_type name;
116
+ #define NM_DECL_STRUCT(type, name) type name;
176
117
 
177
- #if SIZEOF_INT == 8
178
- # define DEFAULT_DTYPE NM_INT64
179
- #else
180
- # if SIZEOF_INT == 4
181
- # define DEFAULT_DTYPE NM_INT32
182
- # else
183
- # define DEFAULT_DTYPE NM_INT16
184
- # endif
185
- #endif
118
+ #define NM_DEF_STORAGE_ELEMENTS \
119
+ NM_DECL_ENUM(dtype_t, dtype); \
120
+ size_t dim; \
121
+ size_t* shape; \
122
+ size_t* offset; \
123
+ int count; \
124
+ STORAGE* src;
125
+
126
+ #define NM_DEF_STORAGE_CHILD_STRUCT_PRE(name) struct name : STORAGE {
127
+ #define NM_DEF_STORAGE_STRUCT_POST(name) };
128
+
129
+ #define NM_DEF_STORAGE_STRUCT \
130
+ struct STORAGE { \
131
+ NM_DEF_STORAGE_ELEMENTS; \
132
+ };
133
+
134
+ #define NM_DEF_STRUCT_PRE(name) struct name {
135
+ #define NM_DEF_STRUCT_POST(name) };
136
+
137
+ #define NM_DEF_ENUM(name, ...) \
138
+ enum name { \
139
+ __VA_ARGS__ \
140
+ };
141
+
142
+ #else /* These are the C versions of the macros. */
143
+
144
+ #define NM_DECL_ENUM(enum_type, name) nm_ ## enum_type name;
145
+ #define NM_DECL_STRUCT(type, name) NM_ ## type name;
146
+
147
+ #define NM_DEF_STORAGE_ELEMENTS \
148
+ NM_DECL_ENUM(dtype_t, dtype); \
149
+ size_t dim; \
150
+ size_t* shape; \
151
+ size_t* offset; \
152
+ int count; \
153
+ STORAGE* src;
154
+ #define NM_DEF_STORAGE_CHILD_STRUCT_PRE(name) typedef struct NM_ ## name { \
155
+ NM_DEF_STORAGE_ELEMENTS;
156
+
157
+ #define NM_DEF_STORAGE_STRUCT_POST(name) } NM_ ## name;
158
+
159
+ #define NM_DEF_STORAGE_STRUCT \
160
+ typedef struct NM_STORAGE { \
161
+ NM_DEF_STORAGE_ELEMENTS; \
162
+ } NM_STORAGE;
163
+ >>>>>>> compile_point
164
+
165
+ #define NM_DEF_STRUCT_PRE(name) typedef struct NM_ ## name {
166
+ #define NM_DEF_STRUCT_POST(name) } NM_ ## name;
167
+
168
+ #define NM_DEF_ENUM(name, ...) \
169
+ typedef enum nm_ ## name { \
170
+ __VA_ARGS__ \
171
+ } nm_ ## name;
172
+
173
+ #endif /* End of C/C++ Parallel Header Macro Definitions */
186
174
 
187
175
 
188
- #define YALE_GROWTH_CONSTANT 1.5
189
-
190
-
191
- enum NMatrix_STypes {
192
- S_DENSE,
193
- S_LIST,
194
- S_YALE,
195
- S_TYPES
196
- };
197
-
198
-
199
- // Element-wise operations (see blas/elementwise.template.c)
200
- enum NMatrix_Ops {
201
- NM_OP_ADD = '+',
202
- NM_OP_SUB = '-',
203
- NM_OP_MUL = '*',
204
- NM_OP_DIV = '/',
205
- NM_OP_MOD = '%',
206
- NM_OP_BANG = '!',
207
- NM_OP_NEG, // unary minus
208
- NM_OP_EQEQ, // ==
209
- NM_OP_NEQ, // !=
210
- NM_OP_GT = '>', // >
211
- NM_OP_LT = '<', // <
212
- NM_OP_GTE = ',', // >=
213
- NM_OP_LTE = '.', // <=
214
- NM_OP_NOT = '~',
215
- NM_OP_AND = '&',
216
- NM_OP_OR = '|',
217
- NM_OP_XOR = '^',
218
- NM_OP_LSH, // <<
219
- NM_OP_RSH // >>
220
- };
221
-
222
-
223
- /* Singly-linked ordered list
224
- * - holds keys and values
225
- * - no duplicate keys
226
- * - keys are ordered
227
- * - values may be lists themselves
176
+ /*
177
+ * Types
228
178
  */
229
- typedef struct l_node { /* Linked list node */
179
+
180
+ #define NM_NUM_DTYPES 13 // data/data.h
181
+ #define NM_NUM_ITYPES 4 // data/data.h
182
+ #define NM_NUM_STYPES 3 // storage/storage.h
183
+
184
+ #ifndef __cplusplus
185
+ //namespace nm {
186
+ #else
187
+
188
+ #endif
189
+
190
+ /* Storage Type -- Dense or Sparse */
191
+ NM_DEF_ENUM(stype_t, DENSE_STORE = 0,
192
+ LIST_STORE = 1,
193
+ YALE_STORE = 2);
194
+
195
+ /* Data Type */
196
+ NM_DEF_ENUM(dtype_t, BYTE = 0, // unsigned char
197
+ INT8 = 1, // char
198
+ INT16 = 2, // short
199
+ INT32 = 3, // int
200
+ INT64 = 4, // long
201
+ FLOAT32 = 5, // float
202
+ FLOAT64 = 6, // double
203
+ COMPLEX64 = 7, // Complex64 class
204
+ COMPLEX128 = 8, // Complex128 class
205
+ RATIONAL32 = 9, // Rational32 class
206
+ RATIONAL64 = 10, // Rational64 class
207
+ RATIONAL128 = 11, // Rational128 class
208
+ RUBYOBJ = 12); // Ruby VALUE type
209
+
210
+ /* Index Type for Yale Matrices */
211
+ NM_DEF_ENUM(itype_t, UINT8 = 0,
212
+ UINT16 = 1,
213
+ UINT32 = 2,
214
+ UINT64 = 3);
215
+
216
+ /* struct STORAGE */
217
+ NM_DEF_STORAGE_STRUCT;
218
+
219
+ /* Dense Storage */
220
+ NM_DEF_STORAGE_CHILD_STRUCT_PRE(DENSE_STORAGE); // struct DENSE_STORAGE : STORAGE {
221
+ size_t* stride;
222
+ void* elements;
223
+ NM_DEF_STORAGE_STRUCT_POST(DENSE_STORAGE); // };
224
+
225
+ /* Yale Storage */
226
+ NM_DEF_STORAGE_CHILD_STRUCT_PRE(YALE_STORAGE);
227
+ void* a; // should go first
228
+ size_t ndnz; // Strictly non-diagonal non-zero count!
229
+ size_t capacity;
230
+ itype_t itype;
231
+ void* ija;
232
+ NM_DEF_STORAGE_STRUCT_POST(YALE_STORAGE);
233
+
234
+ // FIXME: NODE and LIST should be put in some kind of namespace or something, at least in C++.
235
+ NM_DEF_STRUCT_PRE(NODE); // struct NODE {
230
236
  size_t key;
231
237
  void* val;
232
- struct l_node * next; // next
233
- } NODE;
234
-
235
- typedef struct l_list {
236
- NODE* first;
237
- } LIST;
238
-
239
-
240
- // two vectors and a capacity
241
- typedef struct y_vector {
242
- void* ija;
243
- void* a;
244
- size_t capacity;
245
- } VECTOR;
246
-
247
-
248
- typedef struct common_s { // Common elements found in all _s types.
249
- int8_t dtype;
250
- size_t rank;
251
- size_t* shape;
252
- } STORAGE;
253
-
254
-
255
- typedef struct list_s {
256
- int8_t dtype;
257
- size_t rank;
258
- size_t* shape;
259
- void* default_val;
260
- LIST* rows;
261
- } LIST_STORAGE;
262
-
263
-
264
- typedef struct dense_s {
265
- int8_t dtype;
266
- size_t rank;
267
- size_t* shape;
268
- void* elements;
269
- } DENSE_STORAGE;
270
-
271
-
272
- typedef struct yale_s {
273
- int8_t dtype;
274
- size_t rank;
275
- size_t* shape;
276
- size_t ndnz; // strictly non-diagonal non-zero count!
277
- size_t capacity;
278
- int8_t index_dtype;
279
- void* ija;
280
- void* a;
281
- } YALE_STORAGE;
282
-
283
-
284
- typedef struct numeric_matrix {
285
- int8_t stype; /* method of storage (csc, dense, etc) */
286
- STORAGE* storage; /* pointer to storage struct */
287
- } NMATRIX;
288
-
289
-
290
- /* Local */
291
-
292
- typedef union {
293
- u_int8_t b[2];
294
- int16_t s;
295
- } nm_size16_t;
296
-
297
- typedef union {
298
- u_int8_t b[4];
299
- int32_t i;
300
- float f;
301
- } nm_size32_t;
302
-
303
- typedef union {
304
- u_int8_t b[8];
305
- int64_t q;
306
- float f[2];
307
- double d;
308
- complex64 c;
309
- } nm_size64_t;
310
-
311
- typedef union {
312
- u_int8_t b[16];
313
- int64_t i[2];
314
- double d[2];
315
- float f[4];
316
- complex64 c[2];
317
- complex128 z;
318
- rational32 r[4];
319
- rational64 ra[2];
320
- rational128 rat;
321
- VALUE v[2];
322
- } nm_size128_t;
323
-
324
-
325
- // For calling cblas_gemm functions (see cblas.c)
326
- typedef struct cblas_param_t {
327
- int M, N, K, lda, ldb, ldc;
328
- void *A, *B, *C;
329
- nm_size128_t alpha, beta;
330
- } DENSE_PARAM;
331
-
332
-
333
- // Formerly in smmp.h:
334
- typedef struct smmp_param_t {
335
- void *ia, *ja, *a;
336
- bool diag;
337
- } YALE_PARAM;
338
-
339
- // Shouldn't be necessary, as they're defined in nmatrix.h:
340
- // (Oddly, though, these fix the error.)
341
- /*typedef uint8_t u_int8_t;
342
- typedef uint16_t u_int16_t;
343
- typedef uint32_t u_int32_t;
344
- typedef uint64_t u_int64_t; */
345
-
346
-
347
- // rational.c
348
- int64_t nmrb_gcd(int64_t x, int64_t y);
349
-
350
- // BLAS functions
351
- #define SMMP_MAX_THREE(a,b,c) ((a)>(b) ? ( (a)>(c) ? (a) : (c) ) : ( (b)>(c) ? (b) : (c) ))
352
- #define SMMP_MIN(a,b) ((a)>(b) ? (b) : (a))
353
- #define SMMP_MAX(a,b) ((a)>(b) ? (a) : (b))
354
-
355
- void transp(y_size_t n, y_size_t m, void* ia, void* ja, bool diaga, void* a, void* ib, void* jb, void* b, bool move, int8_t itype, int8_t dtype);
356
-
357
- void i8_symbmm_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
358
- void i16_symbmm_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
359
- void i32_symbmm_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
360
- void i64_symbmm_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
361
-
362
- void i8_b_smmp_sort_columns_(y_size_t, YALE_PARAM);
363
- void i16_b_smmp_sort_columns_(y_size_t, YALE_PARAM);
364
- void i32_b_smmp_sort_columns_(y_size_t, YALE_PARAM);
365
- void i64_b_smmp_sort_columns_(y_size_t, YALE_PARAM);
366
- void i8_i8_smmp_sort_columns_(y_size_t, YALE_PARAM);
367
- void i16_i8_smmp_sort_columns_(y_size_t, YALE_PARAM);
368
- void i32_i8_smmp_sort_columns_(y_size_t, YALE_PARAM);
369
- void i64_i8_smmp_sort_columns_(y_size_t, YALE_PARAM);
370
- void i8_i16_smmp_sort_columns_(y_size_t, YALE_PARAM);
371
- void i16_i16_smmp_sort_columns_(y_size_t, YALE_PARAM);
372
- void i32_i16_smmp_sort_columns_(y_size_t, YALE_PARAM);
373
- void i64_i16_smmp_sort_columns_(y_size_t, YALE_PARAM);
374
- void i8_i32_smmp_sort_columns_(y_size_t, YALE_PARAM);
375
- void i16_i32_smmp_sort_columns_(y_size_t, YALE_PARAM);
376
- void i32_i32_smmp_sort_columns_(y_size_t, YALE_PARAM);
377
- void i64_i32_smmp_sort_columns_(y_size_t, YALE_PARAM);
378
- void i8_i64_smmp_sort_columns_(y_size_t, YALE_PARAM);
379
- void i16_i64_smmp_sort_columns_(y_size_t, YALE_PARAM);
380
- void i32_i64_smmp_sort_columns_(y_size_t, YALE_PARAM);
381
- void i64_i64_smmp_sort_columns_(y_size_t, YALE_PARAM);
382
- void i8_f32_smmp_sort_columns_(y_size_t, YALE_PARAM);
383
- void i16_f32_smmp_sort_columns_(y_size_t, YALE_PARAM);
384
- void i32_f32_smmp_sort_columns_(y_size_t, YALE_PARAM);
385
- void i64_f32_smmp_sort_columns_(y_size_t, YALE_PARAM);
386
- void i8_f64_smmp_sort_columns_(y_size_t, YALE_PARAM);
387
- void i16_f64_smmp_sort_columns_(y_size_t, YALE_PARAM);
388
- void i32_f64_smmp_sort_columns_(y_size_t, YALE_PARAM);
389
- void i64_f64_smmp_sort_columns_(y_size_t, YALE_PARAM);
390
- void i8_c64_smmp_sort_columns_(y_size_t, YALE_PARAM);
391
- void i16_c64_smmp_sort_columns_(y_size_t, YALE_PARAM);
392
- void i32_c64_smmp_sort_columns_(y_size_t, YALE_PARAM);
393
- void i64_c64_smmp_sort_columns_(y_size_t, YALE_PARAM);
394
- void i8_c128_smmp_sort_columns_(y_size_t, YALE_PARAM);
395
- void i16_c128_smmp_sort_columns_(y_size_t, YALE_PARAM);
396
- void i32_c128_smmp_sort_columns_(y_size_t, YALE_PARAM);
397
- void i64_c128_smmp_sort_columns_(y_size_t, YALE_PARAM);
398
- void i8_r32_smmp_sort_columns_(y_size_t, YALE_PARAM);
399
- void i16_r32_smmp_sort_columns_(y_size_t, YALE_PARAM);
400
- void i32_r32_smmp_sort_columns_(y_size_t, YALE_PARAM);
401
- void i64_r32_smmp_sort_columns_(y_size_t, YALE_PARAM);
402
- void i8_r64_smmp_sort_columns_(y_size_t, YALE_PARAM);
403
- void i16_r64_smmp_sort_columns_(y_size_t, YALE_PARAM);
404
- void i32_r64_smmp_sort_columns_(y_size_t, YALE_PARAM);
405
- void i64_r64_smmp_sort_columns_(y_size_t, YALE_PARAM);
406
- void i8_r128_smmp_sort_columns_(y_size_t, YALE_PARAM);
407
- void i16_r128_smmp_sort_columns_(y_size_t, YALE_PARAM);
408
- void i32_r128_smmp_sort_columns_(y_size_t, YALE_PARAM);
409
- void i64_r128_smmp_sort_columns_(y_size_t, YALE_PARAM);
410
- void i8_v_smmp_sort_columns_(y_size_t, YALE_PARAM);
411
- void i16_v_smmp_sort_columns_(y_size_t, YALE_PARAM);
412
- void i32_v_smmp_sort_columns_(y_size_t, YALE_PARAM);
413
- void i64_v_smmp_sort_columns_(y_size_t, YALE_PARAM);
414
-
415
- void i8_b_smmp(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
416
- void i16_b_smmp(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
417
- void i32_b_smmp(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
418
- void i64_b_smmp(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
419
- void i8_i8_smmp(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
420
- void i16_i8_smmp(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
421
- void i32_i8_smmp(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
422
- void i64_i8_smmp(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
423
- void i8_i16_smmp(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
424
- void i16_i16_smmp(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
425
- void i32_i16_smmp(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
426
- void i64_i16_smmp(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
427
- void i8_i32_smmp(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
428
- void i16_i32_smmp(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
429
- void i32_i32_smmp(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
430
- void i64_i32_smmp(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
431
- void i8_i64_smmp(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
432
- void i16_i64_smmp(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
433
- void i32_i64_smmp(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
434
- void i64_i64_smmp(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
435
- void i8_f32_smmp(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
436
- void i16_f32_smmp(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
437
- void i32_f32_smmp(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
438
- void i64_f32_smmp(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
439
- void i8_f64_smmp(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
440
- void i16_f64_smmp(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
441
- void i32_f64_smmp(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
442
- void i64_f64_smmp(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
443
- void i8_c64_smmp(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
444
- void i16_c64_smmp(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
445
- void i32_c64_smmp(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
446
- void i64_c64_smmp(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
447
- void i8_c128_smmp(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
448
- void i16_c128_smmp(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
449
- void i32_c128_smmp(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
450
- void i64_c128_smmp(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
451
- void i8_r32_smmp(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
452
- void i16_r32_smmp(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
453
- void i32_r32_smmp(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
454
- void i64_r32_smmp(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
455
- void i8_r64_smmp(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
456
- void i16_r64_smmp(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
457
- void i32_r64_smmp(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
458
- void i64_r64_smmp(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
459
- void i8_r128_smmp(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
460
- void i16_r128_smmp(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
461
- void i32_r128_smmp(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
462
- void i64_r128_smmp(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
463
- void i8_v_smmp(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
464
- void i16_v_smmp(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
465
- void i32_v_smmp(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
466
- void i64_v_smmp(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
467
-
468
- void i8_b_numbmm_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
469
- void i16_b_numbmm_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
470
- void i32_b_numbmm_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
471
- void i64_b_numbmm_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
472
- void i8_i8_numbmm_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
473
- void i16_i8_numbmm_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
474
- void i32_i8_numbmm_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
475
- void i64_i8_numbmm_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
476
- void i8_i16_numbmm_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
477
- void i16_i16_numbmm_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
478
- void i32_i16_numbmm_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
479
- void i64_i16_numbmm_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
480
- void i8_i32_numbmm_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
481
- void i16_i32_numbmm_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
482
- void i32_i32_numbmm_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
483
- void i64_i32_numbmm_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
484
- void i8_i64_numbmm_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
485
- void i16_i64_numbmm_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
486
- void i32_i64_numbmm_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
487
- void i64_i64_numbmm_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
488
- void i8_f32_numbmm_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
489
- void i16_f32_numbmm_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
490
- void i32_f32_numbmm_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
491
- void i64_f32_numbmm_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
492
- void i8_f64_numbmm_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
493
- void i16_f64_numbmm_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
494
- void i32_f64_numbmm_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
495
- void i64_f64_numbmm_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
496
- void i8_c64_numbmm_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
497
- void i16_c64_numbmm_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
498
- void i32_c64_numbmm_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
499
- void i64_c64_numbmm_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
500
- void i8_c128_numbmm_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
501
- void i16_c128_numbmm_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
502
- void i32_c128_numbmm_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
503
- void i64_c128_numbmm_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
504
- void i8_r32_numbmm_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
505
- void i16_r32_numbmm_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
506
- void i32_r32_numbmm_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
507
- void i64_r32_numbmm_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
508
- void i8_r64_numbmm_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
509
- void i16_r64_numbmm_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
510
- void i32_r64_numbmm_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
511
- void i64_r64_numbmm_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
512
- void i8_r128_numbmm_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
513
- void i16_r128_numbmm_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
514
- void i32_r128_numbmm_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
515
- void i64_r128_numbmm_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
516
- void i8_v_numbmm_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
517
- void i16_v_numbmm_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
518
- void i32_v_numbmm_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
519
- void i64_v_numbmm_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, YALE_PARAM);
520
-
521
- void i8_b_transp_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, bool);
522
- void i16_b_transp_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, bool);
523
- void i32_b_transp_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, bool);
524
- void i64_b_transp_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, bool);
525
- void i8_i8_transp_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, bool);
526
- void i16_i8_transp_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, bool);
527
- void i32_i8_transp_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, bool);
528
- void i64_i8_transp_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, bool);
529
- void i8_i16_transp_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, bool);
530
- void i16_i16_transp_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, bool);
531
- void i32_i16_transp_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, bool);
532
- void i64_i16_transp_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, bool);
533
- void i8_i32_transp_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, bool);
534
- void i16_i32_transp_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, bool);
535
- void i32_i32_transp_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, bool);
536
- void i64_i32_transp_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, bool);
537
- void i8_i64_transp_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, bool);
538
- void i16_i64_transp_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, bool);
539
- void i32_i64_transp_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, bool);
540
- void i64_i64_transp_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, bool);
541
- void i8_f32_transp_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, bool);
542
- void i16_f32_transp_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, bool);
543
- void i32_f32_transp_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, bool);
544
- void i64_f32_transp_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, bool);
545
- void i8_f64_transp_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, bool);
546
- void i16_f64_transp_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, bool);
547
- void i32_f64_transp_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, bool);
548
- void i64_f64_transp_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, bool);
549
- void i8_c64_transp_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, bool);
550
- void i16_c64_transp_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, bool);
551
- void i32_c64_transp_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, bool);
552
- void i64_c64_transp_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, bool);
553
- void i8_c128_transp_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, bool);
554
- void i16_c128_transp_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, bool);
555
- void i32_c128_transp_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, bool);
556
- void i64_c128_transp_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, bool);
557
- void i8_r32_transp_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, bool);
558
- void i16_r32_transp_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, bool);
559
- void i32_r32_transp_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, bool);
560
- void i64_r32_transp_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, bool);
561
- void i8_r64_transp_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, bool);
562
- void i16_r64_transp_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, bool);
563
- void i32_r64_transp_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, bool);
564
- void i64_r64_transp_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, bool);
565
- void i8_r128_transp_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, bool);
566
- void i16_r128_transp_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, bool);
567
- void i32_r128_transp_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, bool);
568
- void i64_r128_transp_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, bool);
569
- void i8_v_transp_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, bool);
570
- void i16_v_transp_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, bool);
571
- void i32_v_transp_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, bool);
572
- void i64_v_transp_(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, bool);
573
-
574
-
575
-
576
- // For binary operations involving matrices that need to be casted.
577
- typedef struct storage_pair_t {
578
- STORAGE* left;
579
- STORAGE* right;
580
- } STORAGE_PAIR;
581
-
582
-
583
- #ifndef NMATRIX_C
584
- extern VALUE cNMatrix;
585
-
586
- extern const int nm_sizeof[NM_TYPES+1];
587
- #endif
238
+ NM_DECL_STRUCT(NODE*, next); // NODE* next;
239
+ NM_DEF_STRUCT_POST(NODE); // };
588
240
 
241
+ NM_DEF_STRUCT_PRE(LIST); // struct LIST {
242
+ NM_DECL_STRUCT(NODE*, first); // NODE* first;
243
+ NM_DEF_STRUCT_POST(LIST); // };
244
+
245
+ /* List-of-Lists Storage */
246
+ NM_DEF_STORAGE_CHILD_STRUCT_PRE(LIST_STORAGE); // struct LIST_STORAGE : STORAGE {
247
+ // List storage specific elements.
248
+ void* default_val;
249
+ NM_DECL_STRUCT(LIST*, rows); // LIST* rows;
250
+ NM_DEF_STORAGE_STRUCT_POST(LIST_STORAGE); // };
251
+
252
+
253
+
254
+ /* NMATRIX Object */
255
+ NM_DEF_STRUCT_PRE(NMATRIX); // struct NMATRIX {
256
+ NM_DECL_ENUM(stype_t, stype); // stype_t stype; // Method of storage (csc, dense, etc).
257
+ NM_DECL_STRUCT(STORAGE*, storage); // STORAGE* storage; // Pointer to storage struct.
258
+ NM_DEF_STRUCT_POST(NMATRIX); // };
589
259
 
590
260
  #define NM_MAX_RANK 15
591
261
 
592
- #define UnwrapNMatrix(obj,var) Data_Get_Struct(obj, struct numeric_matrix, var)
593
- #define IsNMatrix(obj) (rb_obj_is_kind_of(obj, CNMatrix)==Qtrue)
594
-
595
- #define NM_STORAGE(val) (((struct numeric_matrix*)DATA_PTR(val))->storage)
596
- //#define NM_PTR(a, p) ((a)->ptr+(p)*nm_sizeof[(a)->type])
597
- #define NM_STRUCT(val) ((struct numeric_matrix*)DATA_PTR(val))
598
- //#define NM_PTR_TYPE(val,type) (type)(((struct numeric_matrix*)DATA_PTR(val))->ptr)
599
- #define NM_RANK(val) (((STORAGE*)(NM_STORAGE(val)))->rank)
600
- #define NM_DTYPE(val) (((STORAGE*)(NM_STORAGE(val)))->dtype)
601
- #define NM_STYPE(val) (((struct numeric_matrix*)DATA_PTR(val))->stype)
602
- #define NM_SHAPE(val,i) (((STORAGE*)(NM_STORAGE(val)))->shape[(i)])
603
- #define NM_SHAPE0(val) (((struct numeric_matrix*)DATA_PTR(val))->shape[0])
604
- #define NM_SHAPE1(val) (((struct numeric_matrix*)DATA_PTR(val))->shape[1])
605
- #define NM_SIZEOF_DTYPE(val) (nm_sizeof[NM_DTYPE(val)])
606
- #define NM_REF(val,coords) (RefFuncs[NM_STYPE(val)]( NM_STORAGE(val), coords, NM_SIZEOF_DTYPE(val) ))
607
-
608
- #define NM_IsNMatrix(obj) (rb_obj_is_kind_of(obj, cNMatrix)==Qtrue)
609
- #define NM_IsArray(obj) (TYPE(obj)==T_ARRAY || rb_obj_is_kind_of(obj,cNMatrix)==Qtrue)
610
- #define NM_IsROBJ(d) ((d)->dtype==NM_ROBJ)
611
- #define NM_IsINTEGER(a) \
612
- (NM_DTYPE(a)==NM_BYTE || NM_DTYPE(a)==NM_INT8 || NM_DTYPE(a)==NM_INT16 || NM_DTYPE(a)==NM_INT32 || NM_DTYPE(a)==NM_INT64)
613
- #define NM_IsCOMPLEX(a) \
614
- (NM_DTYPE(a)==NM_COMPLEX32 || NM_DTYPE(a)==NM_COMPLEX64)
262
+ #define UnwrapNMatrix(obj,var) Data_Get_Struct(obj, NMATRIX, var)
263
+
264
+ #define NM_STORAGE(val) (NM_STRUCT(val)->storage)
265
+ #ifdef __cplusplus
266
+ #define NM_STRUCT(val) ((NMATRIX*)(DATA_PTR(val)))
267
+ #define NM_STORAGE_LIST(val) ((LIST_STORAGE*)(NM_STORAGE(val)))
268
+ #define NM_STORAGE_YALE(val) ((YALE_STORAGE*)(NM_STORAGE(val)))
269
+ #define NM_STORAGE_DENSE(val) ((DENSE_STORAGE*)(NM_STORAGE(val)))
270
+ #else
271
+ #define NM_STRUCT(val) ((struct NM_NMATRIX*)(DATA_PTR(val)))
272
+ #define NM_STORAGE_LIST(val) ((struct NM_LIST_STORAGE*)(NM_STORAGE(val)))
273
+ #define NM_STORAGE_YALE(val) ((struct NM_YALE_STORAGE*)(NM_STORAGE(val)))
274
+ #define NM_STORAGE_DENSE(val) ((struct NM_DENSE_STORAGE*)(NM_STORAGE(val)))
275
+ #endif
276
+
277
+ #define NM_DENSE_SRC(val) (NM_STORAGE_DENSE(val)->src)
278
+ #define NM_LIST_SRC(val) (NM_STORAGE_LIST(val)->src)
279
+ #define NM_DIM(val) (NM_STORAGE(val)->dim)
280
+ #define NM_DTYPE(val) (NM_STORAGE(val)->dtype)
281
+ #define NM_ITYPE(val) (NM_STORAGE_YALE(val)->itype)
282
+ #define NM_STYPE(val) (NM_STRUCT(val)->stype)
283
+ #define NM_SHAPE(val,i) (NM_STORAGE(val)->shape[(i)])
284
+ #define NM_SHAPE0(val) (NM_STORAGE(val)->shape[0])
285
+ #define NM_SHAPE1(val) (NM_STORAGE(val)->shape[1])
286
+
287
+ #define NM_DENSE_COUNT(val) (storage_count_max_elements(NM_STORAGE_DENSE(val)))
288
+ #define NM_SIZEOF_DTYPE(val) (DTYPE_SIZES[NM_DTYPE(val)])
289
+ #define NM_REF(val,slice) (RefFuncs[NM_STYPE(val)]( NM_STORAGE(val), slice, NM_SIZEOF_DTYPE(val) ))
290
+
615
291
  #define NM_MAX(a,b) (((a)>(b))?(a):(b))
292
+ #define NM_MIN(a,b) (((a)>(b))?(b):(a))
616
293
  #define NM_SWAP(a,b,tmp) {(tmp)=(a);(a)=(b);(b)=(tmp);}
617
294
 
618
- //#define NUM2REAL(v) NUM2DBL( rb_funcall((v),nm_id_real,0) ) // deprecated
619
- #define REAL2DBL(v) NUM2DBL( rb_funcall((v),nm_id_real,0) )
620
- //#define NUM2IMAG(v) NUM2DBL( rb_funcall((v),nm_id_imag,0) ) // deprecated
621
- #define IMAG2DBL(v) NUM2DBL( rb_funcall((v),nm_id_imag,0) )
622
-
623
- #define NUM2NUMER(v) NUM2INT( rb_funcall((v), nm_id_numer,0) ) // deprecated
624
- #define NUMER2INT(v) NUM2INT( rb_funcall((v), nm_id_numer,0) )
625
- #define NUM2DENOM(v) NUM2INT( rb_funcall((v), nm_id_denom,0) ) // deprecated
626
- #define DENOM2INT(v) NUM2INT( rb_funcall((v), nm_id_denom,0) )
627
-
628
- #define IS_NUMERIC(v) (FIXNUM_P(v) || TYPE(v) == T_FLOAT || TYPE(v) == T_COMPLEX || TYPE(v) == T_RATIONAL)
629
- #define IS_STRING(v) (TYPE(v) == T_STRING)
630
-
631
- #define CheckNMatrixType(v) if (TYPE(v) != T_DATA || RDATA(v)->dfree != (RUBY_DATA_FUNC)nm_delete) rb_raise(rb_eTypeError, "expected NMatrix on left-hand side of operation");
632
-
633
- //#define YALE_JA_START(sptr) (((YALE_STORAGE*)(sptr))->shape[0]+1)
634
- #define YALE_IJA(sptr,elem_size,i) (void*)( (char*)(((YALE_STORAGE*)(sptr))->ija) + i * elem_size )
635
- //#define YALE_JA(sptr,dtype,j) ((((dtype)*)((YALE_STORAGE*)(sptr))->ija)[(YALE_JA_START(sptr))+j])
636
- #define YALE_ROW_LENGTH(sptr,elem_size,i) (*(size_t*)YALE_IA((sptr),(elem_size),(i)+1) - *(size_t*)YALE_IJA((sptr),(elem_size),(i)))
637
- #define YALE_A(sptr,elem_size,i) (void*)((char*)(((YALE_STORAGE*)(sptr))->a) + elem_size * i)
638
- #define YALE_DIAG(sptr, elem_size, i) ( YALE_A((sptr),(elem_size),(i)) )
639
- //#define YALE_LU(sptr,dtype,i,j) (((dtype)*)(((YALE_STORAGE*)(sptr))->a)[ YALE_JA_START(sptr) + ])
640
- #define YALE_MINIMUM(sptr) (((YALE_STORAGE*)(sptr))->shape[0]*2 + 1) // arbitrarily defined
641
- #define YALE_SIZE_PTR(sptr,elem_size) (void*)((char*)((YALE_STORAGE*)(sptr))->ija + ((YALE_STORAGE*)(sptr))->shape[0]*elem_size )
642
- #define YALE_MAX_SIZE(sptr) (((YALE_STORAGE*)(sptr))->shape[0] * ((YALE_STORAGE*)(sptr))->shape[1] + 1)
643
- #define YALE_IA_SIZE(sptr) ((YALE_STORAGE*)(sptr))->shape[0]
644
-
645
- // None of these next three return anything. They set a reference directly.
646
- #define YaleGetIJA(victim,s,i) (SetFuncs[Y_SIZE_T][(s)->index_dtype](1, &(victim), 0, YALE_IJA((s), nm_sizeof[s->index_dtype], (i)), 0))
647
- #define YaleSetIJA(i,s,from) (SetFuncs[s->index_dtype][Y_SIZE_T](1, YALE_IJA((s), nm_sizeof[s->index_dtype], (i)), 0, &(from), 0))
648
- #define YaleGetSize(sz,s) (SetFuncs[Y_SIZE_T][(s)->index_dtype](1, &sz, 0, (YALE_SIZE_PTR((s), nm_sizeof[(s)->index_dtype])), 0))
649
- //#define YALE_FIRST_NZ_ROW_ENTRY(sptr,elem_size,i)
650
-
651
-
652
- #if !defined RSTRING_LEN
653
- #define RSTRING_LEN(a) RSTRING(a)->len
654
- #endif
655
- #if !defined RSTRING_PTR
656
- #define RSTRING_PTR(a) RSTRING(a)->ptr
657
- #endif
658
- #if !defined RARRAY_LEN
659
- #define RARRAY_LEN(a) RARRAY(a)->len
660
- #endif
661
- #if !defined RARRAY_PTR
662
- #define RARRAY_PTR(a) RARRAY(a)->ptr
663
- #endif
295
+ #define NM_CHECK_ALLOC(x) if (!x) rb_raise(rb_eNoMemError, "insufficient memory");
296
+
297
+ #define CheckNMatrixType(v) if (TYPE(v) != T_DATA || (RDATA(v)->dfree != (RUBY_DATA_FUNC)nm_delete && RDATA(v)->dfree != (RUBY_DATA_FUNC)nm_delete_ref)) rb_raise(rb_eTypeError, "expected NMatrix on left-hand side of operation");
298
+
299
+ #define NM_IsNMatrix(obj) \
300
+ (rb_obj_is_kind_of(obj, cNMatrix) == Qtrue)
301
+
302
+ #define NM_IsNVector(obj) \
303
+ (rb_obj_is_kind_of(obj, cNVector) == Qtrue)
304
+
664
305
 
665
- #define NM_INDEX_TYPES NM_FLOAT32
666
-
667
-
668
- typedef void (*nm_setfunc_t[NM_TYPES][NM_TYPES])(); // copy functions
669
- typedef void (*nm_incfunc_t[NM_TYPES])(); // increment functions
670
- typedef void* (*nm_stype_ref_t[S_TYPES])(STORAGE*, size_t*); // get/ref
671
- typedef VALUE (*nm_stype_ins_t[S_TYPES])(STORAGE*, size_t*, VALUE); // insert
672
- typedef STORAGE* (*nm_create_storage_t[S_TYPES])();
673
- typedef STORAGE* (*nm_cast_copy_storage_t[S_TYPES])();
674
- typedef STORAGE* (*nm_scast_copy_storage_t[S_TYPES][S_TYPES])();
675
- typedef NMATRIX* (*nm_matrix_multiply_op_t[S_TYPES])();
676
- typedef NMATRIX* (*nm_elementwise_binary_op_casted_t[S_TYPES])();
677
- typedef int (*nm_d_elementwise_binary_op_t[NM_TYPES])();
678
- typedef int (*nm_y_elementwise_binary_op_t[NM_TYPES][NM_INDEX_TYPES])();
679
- typedef bool (*nm_compare_t[S_TYPES])();
680
- typedef void (*nm_delete_t[S_TYPES])();
681
- typedef void (*nm_mark_t[S_TYPES])(void*);
682
- typedef void (*nm_gemm_t[NM_TYPES])(); // general matrix/matrix multiply
683
- typedef void (*nm_dense_transpose_t[NM_TYPES])(); // dense transpose
684
- typedef void (*nm_gemv_t[NM_TYPES])(); // general matrix/vector multiply
685
- typedef void (*nm_smmp_t[NM_TYPES][NM_INDEX_TYPES])(); // sparse (yale) multiply
686
- typedef void (*nm_smmp_transpose_t[NM_TYPES][NM_INDEX_TYPES])(y_size_t, y_size_t, YALE_PARAM, YALE_PARAM, bool); // sparse (yale) transpose
687
- //typedef void (*nm_setsf_t[S_TYPES][S_TYPES])();
688
- //typedef void (*nm_setdf_t[NM_DTYPES][NM_DTYPES])();
689
-
690
- extern nm_setfunc_t SetFuncs;
691
- extern nm_incfunc_t Increment;
692
- extern ID nm_id_real, nm_id_imag;
693
- extern ID nm_id_denom, nm_id_numer;
694
- extern ID nm_id_mult, nm_id_multeq, nm_id_add;
695
-
696
- /* blas.c */
697
- int r32gemm(enum CBLAS_TRANSPOSE TransA, enum CBLAS_TRANSPOSE TransB, const int M, const int N, const int K, const rational32 alpha, const rational32* A, const int lda, const rational32* B, const int ldb, const rational32 beta, rational32* C, const int ldc);
698
- int r32gemv(enum CBLAS_TRANSPOSE Trans, const size_t M, const size_t N, const rational32 alpha, const rational32* A, const size_t lda, const rational32* X, const int incX, const rational32 beta, rational32* Y, const int incY);
699
- int r64gemm(enum CBLAS_TRANSPOSE TransA, enum CBLAS_TRANSPOSE TransB, const int M, const int N, const int K, const rational64 alpha, const rational64* A, const int lda, const rational64* B, const int ldb, const rational64 beta, rational64* C, const int ldc);
700
- int r64gemv(enum CBLAS_TRANSPOSE Trans, const size_t M, const size_t N, const rational64 alpha, const rational64* A, const size_t lda, const rational64* X, const int incX, const rational64 beta, rational64* Y, const int incY);
701
- int r128gemm(enum CBLAS_TRANSPOSE TransA, enum CBLAS_TRANSPOSE TransB, const int M, const int N, const int K, const rational128 alpha, const rational128* A, const int lda, const rational128* B, const int ldb, const rational128 beta, rational128* C, const int ldc);
702
- int r128gemv(enum CBLAS_TRANSPOSE Trans, const size_t M, const size_t N, const rational128 alpha, const rational128* A, const size_t lda, const rational128* X, const int incX, const rational128 beta, rational128* Y, const int incY);
703
- int bgemm(enum CBLAS_TRANSPOSE TransA, enum CBLAS_TRANSPOSE TransB, const int M, const int N, const int K, const u_int8_t alpha, const u_int8_t* A, const int lda, const u_int8_t* B, const int ldb, const u_int8_t beta, u_int8_t* C, const int ldc);
704
- int bgemv(enum CBLAS_TRANSPOSE Trans, const size_t M, const size_t N, const u_int8_t alpha, const u_int8_t* A, const size_t lda, const u_int8_t* X, const int incX, const u_int8_t beta, u_int8_t* Y, const int incY);
705
- int i8gemm(enum CBLAS_TRANSPOSE TransA, enum CBLAS_TRANSPOSE TransB, const int M, const int N, const int K, const int8_t alpha, const int8_t* A, const int lda, const int8_t* B, const int ldb, const int8_t beta, int8_t* C, const int ldc);
706
- int i8gemv(enum CBLAS_TRANSPOSE Trans, const size_t M, const size_t N, const int8_t alpha, const int8_t* A, const size_t lda, const int8_t* X, const int incX, const int8_t beta, int8_t* Y, const int incY);
707
- int i16gemm(enum CBLAS_TRANSPOSE TransA, enum CBLAS_TRANSPOSE TransB, const int M, const int N, const int K, const int16_t alpha, const int16_t* A, const int lda, const int16_t* B, const int ldb, const int16_t beta, int16_t* C, const int ldc);
708
- int i16gemv(enum CBLAS_TRANSPOSE Trans, const size_t M, const size_t N, const int16_t alpha, const int16_t* A, const size_t lda, const int16_t* X, const int incX, const int16_t beta, int16_t* Y, const int incY);
709
- int i32gemm(enum CBLAS_TRANSPOSE TransA, enum CBLAS_TRANSPOSE TransB, const int M, const int N, const int K, const int32_t alpha, const int32_t* A, const int lda, const int32_t* B, const int ldb, const int32_t beta, int32_t* C, const int ldc);
710
- int i32gemv(enum CBLAS_TRANSPOSE Trans, const size_t M, const size_t N, const int32_t alpha, const int32_t* A, const size_t lda, const int32_t* X, const int incX, const int32_t beta, int32_t* Y, const int incY);
711
- int i64gemm(enum CBLAS_TRANSPOSE TransA, enum CBLAS_TRANSPOSE TransB, const int M, const int N, const int K, const int64_t alpha, const int64_t* A, const int lda, const int64_t* B, const int ldb, const int64_t beta, int64_t* C, const int ldc);
712
- int i64gemv(enum CBLAS_TRANSPOSE Trans, const size_t M, const size_t N, const int64_t alpha, const int64_t* A, const size_t lda, const int64_t* X, const int incX, const int64_t beta, int64_t* Y, const int incY);
713
- int vgemm(enum CBLAS_TRANSPOSE TransA, enum CBLAS_TRANSPOSE TransB, const int M, const int N, const int K, const VALUE alpha, const VALUE* A, const int lda, const VALUE* B, const int ldb, const VALUE beta, VALUE* C, const int ldc);
714
-
715
- // void %%TYPE_ABBREV%%transp(unsigned int M, unsigned int N, const %%TYPE%%* A, int lda, %%TYPE%%* B, int ldb);
716
- void btransp(const unsigned int, const unsigned int, const u_int8_t*, const int, u_int8_t*, const int);
717
- void i8transp(const unsigned int, const unsigned int, const int8_t*, const int, int8_t*, const int);
718
- void i16transp(const unsigned int, const unsigned int, const int16_t*, const int, int16_t*, const int);
719
- void i32transp(const unsigned int, const unsigned int, const int32_t*, const int, int32_t*, const int);
720
- void i64transp(const unsigned int, const unsigned int, const int64_t*, const int, int64_t*, const int);
721
- void f32transp(const unsigned int, const unsigned int, const float*, const int, float*, const int);
722
- void f64transp(const unsigned int, const unsigned int, const double*, const int, double*, const int);
723
- void c64transp(const unsigned int, const unsigned int, const complex64*, const int, complex64*, const int);
724
- void c128transp(const unsigned int, const unsigned int, const complex128*, const int, complex128*, const int);
725
- void r32transp(const unsigned int, const unsigned int, const rational32*, const int, rational32*, const int);
726
- void r64transp(const unsigned int, const unsigned int, const rational64*, const int, rational64*, const int);
727
- void r128transp(const unsigned int, const unsigned int, const rational128*, const int, rational128*, const int);
728
- void vtransp(const unsigned int, const unsigned int, const VALUE*, const int, VALUE*, const int);
729
-
730
- int nm_d_b_elementwise(const u_int8_t* A, const u_int8_t* B, u_int8_t* C, size_t n, enum NMatrix_Ops op);
731
- int nm_d_i8_elementwise(const int8_t* A, const int8_t* B, int8_t* C, size_t n, enum NMatrix_Ops op);
732
- int nm_d_i16_elementwise(const int16_t* A, const int16_t* B, int16_t* C, size_t n, enum NMatrix_Ops op);
733
- int nm_d_i32_elementwise(const int32_t* A, const int32_t* B, int32_t* C, size_t n, enum NMatrix_Ops op);
734
- int nm_d_i64_elementwise(const int64_t* A, const int64_t* B, int64_t* C, size_t n, enum NMatrix_Ops op);
735
- int nm_d_f32_elementwise(const float* A, const float* B, float* C, size_t n, enum NMatrix_Ops op);
736
- int nm_d_f64_elementwise(const double* A, const double* B, double* C, size_t n, enum NMatrix_Ops op);
737
- int nm_d_c64_elementwise(const complex64* A, const complex64* B, complex64* C, size_t n, enum NMatrix_Ops op);
738
- int nm_d_c128_elementwise(const complex128* A, const complex128* B, complex128* C, size_t n, enum NMatrix_Ops op);
739
- int nm_d_r32_elementwise(const rational32* A, const rational32* B, rational32* C, size_t n, enum NMatrix_Ops op);
740
- int nm_d_r64_elementwise(const rational64* A, const rational64* B, rational64* C, size_t n, enum NMatrix_Ops op);
741
- int nm_d_r128_elementwise(const rational128* A, const rational128* B, rational128* C, size_t n, enum NMatrix_Ops op);
742
- int nm_d_v_elementwise(const VALUE* A, const VALUE* B, VALUE* C, size_t n, enum NMatrix_Ops op);
743
-
744
- // These are in blas.c but are needed by smmp2.c (the smmp template stuff)
745
- rational128 r128_muldiv(int64_t anum, int64_t aden, int64_t bnum, int64_t bden, char k);
746
- rational128 r128_addsub(int64_t anum, int64_t aden, int64_t bnum, int64_t bden, char k);
747
- rational128 r128_mod(int64_t anum, int64_t aden, int64_t bnum, int64_t bden);
748
- rational128 r128_bang(int64_t, int64_t);
749
- rational128 r128_negate(int64_t, int64_t);
750
- rational64 r64_muldiv(int64_t anum, int64_t aden, int64_t bnum, int64_t bden, char k);
751
- rational64 r64_addsub(int64_t anum, int64_t aden, int64_t bnum, int64_t bden, char k);
752
- rational64 r64_mod(int32_t anum, int32_t aden, int32_t bnum, int32_t bden);
753
- rational64 r64_bang(int32_t, int32_t);
754
- rational64 r64_negate(int32_t, int32_t);
755
- rational32 r32_muldiv(int64_t anum, int64_t aden, int64_t bnum, int64_t bden, char k);
756
- rational32 r32_addsub(int64_t anum, int64_t aden, int64_t bnum, int64_t bden, char k);
757
- rational32 r32_mod(int16_t anum, int16_t aden, int16_t bnum, int16_t bden);
758
- rational32 r32_bang(int16_t, int16_t);
759
- rational32 r32_negate(int16_t, int16_t);
760
-
761
- rational32 BOOL2R32(bool);
762
- rational64 BOOL2R64(bool);
763
- rational128 BOOL2R128(bool);
764
-
765
-
766
- /* cblas.c */
767
- DENSE_PARAM init_cblas_params_for_nm_multiply_matrix(int8_t dtype);
768
- void cblas_bgemm_(enum CBLAS_ORDER Order, enum CBLAS_TRANSPOSE TransA, enum CBLAS_TRANSPOSE TransB, DENSE_PARAM p);
769
- void cblas_bgemv_(enum CBLAS_ORDER Order, enum CBLAS_TRANSPOSE TransA, DENSE_PARAM p);
770
- void cblas_i8gemm_(enum CBLAS_ORDER Order, enum CBLAS_TRANSPOSE TransA, enum CBLAS_TRANSPOSE TransB, DENSE_PARAM p);
771
- void cblas_i8gemv_(enum CBLAS_ORDER Order, enum CBLAS_TRANSPOSE TransA, DENSE_PARAM p);
772
- void cblas_i16gemm_(enum CBLAS_ORDER Order, enum CBLAS_TRANSPOSE TransA, enum CBLAS_TRANSPOSE TransB, DENSE_PARAM p);
773
- void cblas_i16gemv_(enum CBLAS_ORDER Order, enum CBLAS_TRANSPOSE TransA, DENSE_PARAM p);
774
- void cblas_i32gemm_(enum CBLAS_ORDER Order, enum CBLAS_TRANSPOSE TransA, enum CBLAS_TRANSPOSE TransB, DENSE_PARAM p);
775
- void cblas_i32gemv_(enum CBLAS_ORDER Order, enum CBLAS_TRANSPOSE TransA, DENSE_PARAM p);
776
- void cblas_i64gemm_(enum CBLAS_ORDER Order, enum CBLAS_TRANSPOSE TransA, enum CBLAS_TRANSPOSE TransB, DENSE_PARAM p);
777
- void cblas_i64gemv_(enum CBLAS_ORDER Order, enum CBLAS_TRANSPOSE TransA, DENSE_PARAM p);
778
- void cblas_sgemm_(const enum CBLAS_ORDER Order, const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_TRANSPOSE TransB, DENSE_PARAM p);
779
- void cblas_sgemv_(const enum CBLAS_ORDER Order, const enum CBLAS_TRANSPOSE TransA, DENSE_PARAM p);
780
- void cblas_dgemm_(const enum CBLAS_ORDER Order, const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_TRANSPOSE TransB, DENSE_PARAM p);
781
- void cblas_dgemv_(const enum CBLAS_ORDER Order, const enum CBLAS_TRANSPOSE TransA, DENSE_PARAM p);
782
- void cblas_cgemm_(const enum CBLAS_ORDER Order, const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_TRANSPOSE TransB, DENSE_PARAM p);
783
- void cblas_cgemv_(const enum CBLAS_ORDER Order, const enum CBLAS_TRANSPOSE TransA, DENSE_PARAM p);
784
- void cblas_zgemm_(const enum CBLAS_ORDER Order, const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_TRANSPOSE TransB, DENSE_PARAM p);
785
- void cblas_zgemv_(const enum CBLAS_ORDER Order, const enum CBLAS_TRANSPOSE TransA, DENSE_PARAM p);
786
- void cblas_r32gemm_(const enum CBLAS_ORDER Order, const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_TRANSPOSE TransB, DENSE_PARAM p);
787
- void cblas_r32gemv_(const enum CBLAS_ORDER Order, const enum CBLAS_TRANSPOSE TransA, DENSE_PARAM p);
788
- void cblas_r64gemm_(const enum CBLAS_ORDER Order, const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_TRANSPOSE TransB, DENSE_PARAM p);
789
- void cblas_r64gemv_(const enum CBLAS_ORDER Order, const enum CBLAS_TRANSPOSE TransA, DENSE_PARAM p);
790
- void cblas_r128gemm_(const enum CBLAS_ORDER Order, const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_TRANSPOSE TransB, DENSE_PARAM p);
791
- void cblas_r128gemv_(const enum CBLAS_ORDER Order, const enum CBLAS_TRANSPOSE TransA, DENSE_PARAM p);
792
- void cblas_vgemm_(const enum CBLAS_ORDER Order, const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_TRANSPOSE TransB, DENSE_PARAM p);
793
-
794
-
795
- /* smmp2.c */
796
- int i8_b_ew(y_size_t n, y_size_t m, enum NMatrix_Ops op, const u_int8_t* ija, const u_int8_t* ijb, const u_int8_t* ijc, u_int8_t* a, u_int8_t* b, u_int8_t* c);
797
- int i16_b_ew(y_size_t n, y_size_t m, enum NMatrix_Ops op, const u_int16_t* ija, const u_int16_t* ijb, const u_int16_t* ijc, u_int8_t* a, u_int8_t* b, u_int8_t* c);
798
- int i32_b_ew(y_size_t n, y_size_t m, enum NMatrix_Ops op, const u_int32_t* ija, const u_int32_t* ijb, const u_int32_t* ijc, u_int8_t* a, u_int8_t* b, u_int8_t* c);
799
- int i64_b_ew(y_size_t n, y_size_t m, enum NMatrix_Ops op, const u_int64_t* ija, const u_int64_t* ijb, const u_int64_t* ijc, u_int8_t* a, u_int8_t* b, u_int8_t* c);
800
- int i8_i8_ew(y_size_t n, y_size_t m, enum NMatrix_Ops op, const u_int8_t* ija, const u_int8_t* ijb, const u_int8_t* ijc, int8_t* a, int8_t* b, int8_t* c);
801
- int i16_i8_ew(y_size_t n, y_size_t m, enum NMatrix_Ops op, const u_int16_t* ija, const u_int16_t* ijb, const u_int16_t* ijc, int8_t* a, int8_t* b, int8_t* c);
802
- int i32_i8_ew(y_size_t n, y_size_t m, enum NMatrix_Ops op, const u_int32_t* ija, const u_int32_t* ijb, const u_int32_t* ijc, int8_t* a, int8_t* b, int8_t* c);
803
- int i64_i8_ew(y_size_t n, y_size_t m, enum NMatrix_Ops op, const u_int64_t* ija, const u_int64_t* ijb, const u_int64_t* ijc, int8_t* a, int8_t* b, int8_t* c);
804
- int i8_i16_ew(y_size_t n, y_size_t m, enum NMatrix_Ops op, const u_int8_t* ija, const u_int8_t* ijb, const u_int8_t* ijc, int16_t* a, int16_t* b, int16_t* c);
805
- int i16_i16_ew(y_size_t n, y_size_t m, enum NMatrix_Ops op, const u_int16_t* ija, const u_int16_t* ijb, const u_int16_t* ijc, int16_t* a, int16_t* b, int16_t* c);
806
- int i32_i16_ew(y_size_t n, y_size_t m, enum NMatrix_Ops op, const u_int32_t* ija, const u_int32_t* ijb, const u_int32_t* ijc, int16_t* a, int16_t* b, int16_t* c);
807
- int i64_i16_ew(y_size_t n, y_size_t m, enum NMatrix_Ops op, const u_int64_t* ija, const u_int64_t* ijb, const u_int64_t* ijc, int16_t* a, int16_t* b, int16_t* c);
808
- int i8_i32_ew(y_size_t n, y_size_t m, enum NMatrix_Ops op, const u_int8_t* ija, const u_int8_t* ijb, const u_int8_t* ijc, int32_t* a, int32_t* b, int32_t* c);
809
- int i16_i32_ew(y_size_t n, y_size_t m, enum NMatrix_Ops op, const u_int16_t* ija, const u_int16_t* ijb, const u_int16_t* ijc, int32_t* a, int32_t* b, int32_t* c);
810
- int i32_i32_ew(y_size_t n, y_size_t m, enum NMatrix_Ops op, const u_int32_t* ija, const u_int32_t* ijb, const u_int32_t* ijc, int32_t* a, int32_t* b, int32_t* c);
811
- int i64_i32_ew(y_size_t n, y_size_t m, enum NMatrix_Ops op, const u_int64_t* ija, const u_int64_t* ijb, const u_int64_t* ijc, int32_t* a, int32_t* b, int32_t* c);
812
- int i8_i64_ew(y_size_t n, y_size_t m, enum NMatrix_Ops op, const u_int8_t* ija, const u_int8_t* ijb, const u_int8_t* ijc, int64_t* a, int64_t* b, int64_t* c);
813
- int i16_i64_ew(y_size_t n, y_size_t m, enum NMatrix_Ops op, const u_int16_t* ija, const u_int16_t* ijb, const u_int16_t* ijc, int64_t* a, int64_t* b, int64_t* c);
814
- int i32_i64_ew(y_size_t n, y_size_t m, enum NMatrix_Ops op, const u_int32_t* ija, const u_int32_t* ijb, const u_int32_t* ijc, int64_t* a, int64_t* b, int64_t* c);
815
- int i64_i64_ew(y_size_t n, y_size_t m, enum NMatrix_Ops op, const u_int64_t* ija, const u_int64_t* ijb, const u_int64_t* ijc, int64_t* a, int64_t* b, int64_t* c);
816
- int i8_f32_ew(y_size_t n, y_size_t m, enum NMatrix_Ops op, const u_int8_t* ija, const u_int8_t* ijb, const u_int8_t* ijc, float* a, float* b, float* c);
817
- int i16_f32_ew(y_size_t n, y_size_t m, enum NMatrix_Ops op, const u_int16_t* ija, const u_int16_t* ijb, const u_int16_t* ijc, float* a, float* b, float* c);
818
- int i32_f32_ew(y_size_t n, y_size_t m, enum NMatrix_Ops op, const u_int32_t* ija, const u_int32_t* ijb, const u_int32_t* ijc, float* a, float* b, float* c);
819
- int i64_f32_ew(y_size_t n, y_size_t m, enum NMatrix_Ops op, const u_int64_t* ija, const u_int64_t* ijb, const u_int64_t* ijc, float* a, float* b, float* c);
820
- int i8_f64_ew(y_size_t n, y_size_t m, enum NMatrix_Ops op, const u_int8_t* ija, const u_int8_t* ijb, const u_int8_t* ijc, double* a, double* b, double* c);
821
- int i16_f64_ew(y_size_t n, y_size_t m, enum NMatrix_Ops op, const u_int16_t* ija, const u_int16_t* ijb, const u_int16_t* ijc, double* a, double* b, double* c);
822
- int i32_f64_ew(y_size_t n, y_size_t m, enum NMatrix_Ops op, const u_int32_t* ija, const u_int32_t* ijb, const u_int32_t* ijc, double* a, double* b, double* c);
823
- int i64_f64_ew(y_size_t n, y_size_t m, enum NMatrix_Ops op, const u_int64_t* ija, const u_int64_t* ijb, const u_int64_t* ijc, double* a, double* b, double* c);
824
- int i8_c64_ew(y_size_t n, y_size_t m, enum NMatrix_Ops op, const u_int8_t* ija, const u_int8_t* ijb, const u_int8_t* ijc, complex64* a, complex64* b, complex64* c);
825
- int i16_c64_ew(y_size_t n, y_size_t m, enum NMatrix_Ops op, const u_int16_t* ija, const u_int16_t* ijb, const u_int16_t* ijc, complex64* a, complex64* b, complex64* c);
826
- int i32_c64_ew(y_size_t n, y_size_t m, enum NMatrix_Ops op, const u_int32_t* ija, const u_int32_t* ijb, const u_int32_t* ijc, complex64* a, complex64* b, complex64* c);
827
- int i64_c64_ew(y_size_t n, y_size_t m, enum NMatrix_Ops op, const u_int64_t* ija, const u_int64_t* ijb, const u_int64_t* ijc, complex64* a, complex64* b, complex64* c);
828
- int i8_c128_ew(y_size_t n, y_size_t m, enum NMatrix_Ops op, const u_int8_t* ija, const u_int8_t* ijb, const u_int8_t* ijc, complex128* a, complex128* b, complex128* c);
829
- int i16_c128_ew(y_size_t n, y_size_t m, enum NMatrix_Ops op, const u_int16_t* ija, const u_int16_t* ijb, const u_int16_t* ijc, complex128* a, complex128* b, complex128* c);
830
- int i32_c128_ew(y_size_t n, y_size_t m, enum NMatrix_Ops op, const u_int32_t* ija, const u_int32_t* ijb, const u_int32_t* ijc, complex128* a, complex128* b, complex128* c);
831
- int i64_c128_ew(y_size_t n, y_size_t m, enum NMatrix_Ops op, const u_int64_t* ija, const u_int64_t* ijb, const u_int64_t* ijc, complex128* a, complex128* b, complex128* c);
832
- int i8_r32_ew(y_size_t n, y_size_t m, enum NMatrix_Ops op, const u_int8_t* ija, const u_int8_t* ijb, const u_int8_t* ijc, rational32* a, rational32* b, rational32* c);
833
- int i16_r32_ew(y_size_t n, y_size_t m, enum NMatrix_Ops op, const u_int16_t* ija, const u_int16_t* ijb, const u_int16_t* ijc, rational32* a, rational32* b, rational32* c);
834
- int i32_r32_ew(y_size_t n, y_size_t m, enum NMatrix_Ops op, const u_int32_t* ija, const u_int32_t* ijb, const u_int32_t* ijc, rational32* a, rational32* b, rational32* c);
835
- int i64_r32_ew(y_size_t n, y_size_t m, enum NMatrix_Ops op, const u_int64_t* ija, const u_int64_t* ijb, const u_int64_t* ijc, rational32* a, rational32* b, rational32* c);
836
- int i8_r64_ew(y_size_t n, y_size_t m, enum NMatrix_Ops op, const u_int8_t* ija, const u_int8_t* ijb, const u_int8_t* ijc, rational64* a, rational64* b, rational64* c);
837
- int i16_r64_ew(y_size_t n, y_size_t m, enum NMatrix_Ops op, const u_int16_t* ija, const u_int16_t* ijb, const u_int16_t* ijc, rational64* a, rational64* b, rational64* c);
838
- int i32_r64_ew(y_size_t n, y_size_t m, enum NMatrix_Ops op, const u_int32_t* ija, const u_int32_t* ijb, const u_int32_t* ijc, rational64* a, rational64* b, rational64* c);
839
- int i64_r64_ew(y_size_t n, y_size_t m, enum NMatrix_Ops op, const u_int64_t* ija, const u_int64_t* ijb, const u_int64_t* ijc, rational64* a, rational64* b, rational64* c);
840
- int i8_r128_ew(y_size_t n, y_size_t m, enum NMatrix_Ops op, const u_int8_t* ija, const u_int8_t* ijb, const u_int8_t* ijc, rational128* a, rational128* b, rational128* c);
841
- int i16_r128_ew(y_size_t n, y_size_t m, enum NMatrix_Ops op, const u_int16_t* ija, const u_int16_t* ijb, const u_int16_t* ijc, rational128* a, rational128* b, rational128* c);
842
- int i32_r128_ew(y_size_t n, y_size_t m, enum NMatrix_Ops op, const u_int32_t* ija, const u_int32_t* ijb, const u_int32_t* ijc, rational128* a, rational128* b, rational128* c);
843
- int i64_r128_ew(y_size_t n, y_size_t m, enum NMatrix_Ops op, const u_int64_t* ija, const u_int64_t* ijb, const u_int64_t* ijc, rational128* a, rational128* b, rational128* c);
844
- int i8_v_ew(y_size_t n, y_size_t m, enum NMatrix_Ops op, const u_int8_t* ija, const u_int8_t* ijb, const u_int8_t* ijc, VALUE* a, VALUE* b, VALUE* c);
845
- int i16_v_ew(y_size_t n, y_size_t m, enum NMatrix_Ops op, const u_int16_t* ija, const u_int16_t* ijb, const u_int16_t* ijc, VALUE* a, VALUE* b, VALUE* c);
846
- int i32_v_ew(y_size_t n, y_size_t m, enum NMatrix_Ops op, const u_int32_t* ija, const u_int32_t* ijb, const u_int32_t* ijc, VALUE* a, VALUE* b, VALUE* c);
847
- int i64_v_ew(y_size_t n, y_size_t m, enum NMatrix_Ops op, const u_int64_t* ija, const u_int64_t* ijb, const u_int64_t* ijc, VALUE* a, VALUE* b, VALUE* c);
848
-
849
-
850
- /* dense.c */
851
- DENSE_STORAGE* create_dense_storage(int8_t dtype, size_t* shape, size_t rank, void* elements, size_t elements_length);
852
- void delete_dense_storage(DENSE_STORAGE* s);
853
- void mark_dense_storage(void* s);
854
- DENSE_STORAGE* cast_copy_dense_storage(DENSE_STORAGE* rhs, int8_t new_dtype);
855
-
856
- size_t count_dense_storage_elements(const DENSE_STORAGE* s);
857
- bool dense_storage_eqeq(const DENSE_STORAGE*, const DENSE_STORAGE*);
858
-
859
- size_t dense_storage_pos(DENSE_STORAGE* s, size_t* coords);
860
- void* dense_storage_get(DENSE_STORAGE* s, size_t* coords);
861
- void dense_storage_set(DENSE_STORAGE* s, size_t* coords, void* val);
862
-
863
- /* list.c */
864
- LIST_STORAGE* create_list_storage(int8_t dtype, size_t* shape, size_t rank, void* init_val);
865
- void delete_list_storage(LIST_STORAGE* s);
866
- void mark_list_storage(void* s);
867
- LIST_STORAGE* cast_copy_list_storage(LIST_STORAGE* rhs, int8_t new_dtype);
868
- size_t count_storage_max_elements(const STORAGE*);
869
-
870
- void* list_storage_get(LIST_STORAGE* s, size_t* coords);
871
- void* list_storage_insert(LIST_STORAGE* s, size_t* coords, void* val);
872
- void* list_storage_remove(LIST_STORAGE* s, size_t* coords);
873
- bool list_storage_eqeq(const LIST_STORAGE*, const LIST_STORAGE*);
874
-
875
- /* yale.c */
876
- void print_vectors(YALE_STORAGE* s);
877
- YALE_STORAGE* create_yale_storage(int8_t dtype, size_t* shape, size_t rank, size_t init_capacity);
878
- void init_yale_storage(YALE_STORAGE* s);
879
- void delete_yale_storage(YALE_STORAGE* s);
880
- void mark_yale_storage(void* s);
881
- YALE_STORAGE* cast_copy_yale_storage(YALE_STORAGE* rhs, int8_t new_dtype);
882
- bool yale_storage_eqeq(const YALE_STORAGE*, const YALE_STORAGE*);
883
-
884
- void* yale_storage_ref(YALE_STORAGE* s, size_t* coords);
885
- char yale_storage_set(YALE_STORAGE* s, size_t* coords, void* v);
886
-
887
- YALE_STORAGE* create_merged_yale_storage(const YALE_STORAGE*, const YALE_STORAGE*);
888
-
889
- size_t count_list_storage_nd_elements(const LIST_STORAGE*);
890
- size_t count_list_storage_elements(const LIST_STORAGE*);
891
-
892
-
893
- /* stype casts */
894
- DENSE_STORAGE* scast_copy_dense_yale(const YALE_STORAGE* rhs, int8_t l_dtype);
895
- DENSE_STORAGE* scast_copy_dense_list(const LIST_STORAGE* rhs, int8_t l_dtype);
896
- YALE_STORAGE* scast_copy_yale_dense(const DENSE_STORAGE* rhs, int8_t l_dtype);
897
- YALE_STORAGE* scast_copy_yale_list(const LIST_STORAGE* rhs, int8_t l_dtype);
898
- LIST_STORAGE* scast_copy_list_yale(const YALE_STORAGE* rhs, int8_t l_dtype);
899
- LIST_STORAGE* scast_copy_list_dense(const DENSE_STORAGE* rhs, int8_t l_dtype);
900
-
901
- /* nmatrix.c */
902
- void cast_copy_value_single(void* to, const void* from, int8_t l_dtype, int8_t r_dtype);
903
- int8_t nm_dtypestring_to_dtype(VALUE str);
904
- int8_t nm_dtypesymbol_to_dtype(VALUE sym);
905
- int8_t nm_stypestring_to_stype(VALUE str);
906
- int8_t nm_stypesymbol_to_stype(VALUE sym);
907
- int8_t nm_guess_dtype(VALUE v);
908
- size_t* nm_interpret_shape_arg(VALUE arg, size_t* rank);
909
- NMATRIX* nm_create(int8_t stype, void* storage);
910
- void Init_nmatrix();
306
+ typedef VALUE (*METHOD)(...);
911
307
 
308
+ #ifdef __cplusplus
309
+ //}; // end of namespace nm
912
310
  #endif
311
+
312
+ /*
313
+ * Data
314
+ */
315
+
316
+ /*
317
+ * Functions
318
+ */
319
+
320
+ extern "C" {
321
+ void Init_nmatrix();
322
+
323
+ // External API
324
+ VALUE rb_nmatrix_dense_create(dtype_t dtype, size_t* shape, size_t dim, void* elements, size_t length);
325
+ VALUE rb_nvector_dense_create(dtype_t dtype, void* elements, size_t length);
326
+ }
327
+
328
+ #endif // NMATRIX_H