summaryrefslogtreecommitdiff
path: root/otherlibs/bigarray/bigarray_stubs.c
diff options
context:
space:
mode:
authorFabrice Le Fessant <Fabrice.Le_fessant@inria.fr>2012-11-06 17:03:34 +0000
committerFabrice Le Fessant <Fabrice.Le_fessant@inria.fr>2012-11-06 17:03:34 +0000
commit95c20bc6aece97adee9adc812fc8ac29a52552f3 (patch)
treef54f9d5b97a87a1ef400a1ada77d64c1f17248e1 /otherlibs/bigarray/bigarray_stubs.c
parentf1fb961192acd95eed1dd15580b1051e7be61b2c (diff)
downloadocaml-95c20bc6aece97adee9adc812fc8ac29a52552f3.tar.gz
PR#5762: Add primitives for fast access to bigarray dimensions
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13069 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'otherlibs/bigarray/bigarray_stubs.c')
-rw-r--r--otherlibs/bigarray/bigarray_stubs.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/otherlibs/bigarray/bigarray_stubs.c b/otherlibs/bigarray/bigarray_stubs.c
index 567a72deba..4af0bfde65 100644
--- a/otherlibs/bigarray/bigarray_stubs.c
+++ b/otherlibs/bigarray/bigarray_stubs.c
@@ -475,6 +475,21 @@ CAMLprim value caml_ba_dim(value vb, value vn)
return Val_long(b->dim[n]);
}
+CAMLprim value caml_ba_dim_1(value vb)
+{
+ return caml_ba_dim(vb, Val_int(0));
+}
+
+CAMLprim value caml_ba_dim_2(value vb)
+{
+ return caml_ba_dim(vb, Val_int(1));
+}
+
+CAMLprim value caml_ba_dim_3(value vb)
+{
+ return caml_ba_dim(vb, Val_int(2));
+}
+
/* Return the kind of a big array */
CAMLprim value caml_ba_kind(value vb)