ext/nmatrix/nmatrix.h in nmatrix-0.0.5 vs ext/nmatrix/nmatrix.h in nmatrix-0.0.6
- old
+ new
@@ -134,14 +134,14 @@
#define NM_DECL_ENUM(enum_type, name) nm::enum_type name
#define NM_DECL_STRUCT(type, name) type name;
#define NM_DEF_STORAGE_ELEMENTS \
NM_DECL_ENUM(dtype_t, dtype); \
- size_t dim; \
- size_t* shape; \
- size_t* offset; \
- int count; \
+ size_t dim; \
+ size_t* shape; \
+ size_t* offset; \
+ int count; \
STORAGE* src;
#define NM_DEF_STORAGE_CHILD_STRUCT_PRE(name) struct name : STORAGE {
#define NM_DEF_STORAGE_STRUCT_POST(name) };
@@ -310,10 +310,11 @@
#define NM_ITYPE(val) (NM_STORAGE_YALE(val)->itype)
#define NM_STYPE(val) (NM_STRUCT(val)->stype)
#define NM_SHAPE(val,i) (NM_STORAGE(val)->shape[(i)])
#define NM_SHAPE0(val) (NM_STORAGE(val)->shape[0])
#define NM_SHAPE1(val) (NM_STORAGE(val)->shape[1])
+#define NM_DEFAULT_VAL(val) (NM_STORAGE_LIST(val)->default_val)
#define NM_DENSE_COUNT(val) (storage_count_max_elements(NM_STORAGE_DENSE(val)))
#define NM_SIZEOF_DTYPE(val) (DTYPE_SIZES[NM_DTYPE(val)])
#define NM_REF(val,slice) (RefFuncs[NM_STYPE(val)]( NM_STORAGE(val), slice, NM_SIZEOF_DTYPE(val) ))
@@ -353,9 +354,15 @@
// External API
VALUE rb_nmatrix_dense_create(NM_DECL_ENUM(dtype_t, dtype), size_t* shape, size_t dim, void* elements, size_t length);
VALUE rb_nvector_dense_create(NM_DECL_ENUM(dtype_t, dtype), void* elements, size_t length);
NM_DECL_ENUM(dtype_t, nm_dtype_guess(VALUE)); // (This is a function)
+ NM_DECL_ENUM(dtype_t, nm_dtype_min(VALUE));
+
+ // Non-API functions needed by other cpp files.
+ NMATRIX* nm_create(nm::stype_t stype, STORAGE* storage);
+ void nm_delete(NMATRIX* mat);
+ void nm_delete_ref(NMATRIX* mat);
#ifdef __cplusplus
}
#endif