summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
Diffstat (limited to 'numpy')
-rw-r--r--numpy/doc/swig/numpy.i47
-rw-r--r--numpy/doc/swig/numpy_swig.html5
-rw-r--r--numpy/doc/swig/numpy_swig.pdfbin138239 -> 138412 bytes
-rw-r--r--numpy/doc/swig/numpy_swig.txt4
4 files changed, 32 insertions, 24 deletions
diff --git a/numpy/doc/swig/numpy.i b/numpy/doc/swig/numpy.i
index 3e8c069f9..6ad0abe76 100644
--- a/numpy/doc/swig/numpy.i
+++ b/numpy/doc/swig/numpy.i
@@ -22,6 +22,7 @@
#define array_numdims(a) (((PyArrayObject *)a)->nd)
#define array_dimensions(a) (((PyArrayObject *)a)->dimensions)
#define array_size(a,i) (((PyArrayObject *)a)->dimensions[i])
+#define array_data(a) (((PyArrayObject *)a)->data)
#define array_is_contiguous(a) (PyArray_ISCONTIGUOUS(a))
#define array_is_native(a) (PyArray_ISNOTSWAPPED(a))
@@ -453,7 +454,7 @@ int require_size(PyArrayObject* ary, npy_intp* size, int n) {
array = obj_to_array_contiguous_allow_conversion($input, DATA_TYPECODE, &is_new_object);
npy_intp size[1] = { $1_dim0 };
if (!array || !require_dimensions(array, 1) || !require_size(array, size, 1)) SWIG_fail;
- $1 = ($1_ltype) array->data;
+ $1 = ($1_ltype) array_data(array);
}
%typemap(freearg)
(DATA_TYPE IN_ARRAY1[ANY])
@@ -475,7 +476,7 @@ int require_size(PyArrayObject* ary, npy_intp* size, int n) {
array = obj_to_array_contiguous_allow_conversion($input, DATA_TYPECODE, &is_new_object);
npy_intp size[1] = { -1 };
if (!array || !require_dimensions(array, 1) || !require_size(array, size, 1)) SWIG_fail;
- $1 = (DATA_TYPE*) array->data;
+ $1 = (DATA_TYPE*) array_data(array);
$2 = (DIM_TYPE) array_size(array,0);
}
%typemap(freearg)
@@ -499,7 +500,7 @@ int require_size(PyArrayObject* ary, npy_intp* size, int n) {
npy_intp size[1] = {-1};
if (!array || !require_dimensions(array, 1) || !require_size(array, size, 1)) SWIG_fail;
$1 = (DIM_TYPE) array_size(array,0);
- $2 = (DATA_TYPE*) array->data;
+ $2 = (DATA_TYPE*) array_data(array);
}
%typemap(freearg)
(DIM_TYPE DIM1, DATA_TYPE* IN_ARRAY1)
@@ -521,7 +522,7 @@ int require_size(PyArrayObject* ary, npy_intp* size, int n) {
array = obj_to_array_contiguous_allow_conversion($input, DATA_TYPECODE, &is_new_object);
npy_intp size[2] = { $1_dim0, $1_dim1 };
if (!array || !require_dimensions(array, 2) || !require_size(array, size, 2)) SWIG_fail;
- $1 = ($1_ltype) array->data;
+ $1 = ($1_ltype) array_data(array);
}
%typemap(freearg)
(DATA_TYPE IN_ARRAY2[ANY][ANY])
@@ -543,7 +544,7 @@ int require_size(PyArrayObject* ary, npy_intp* size, int n) {
array = obj_to_array_contiguous_allow_conversion($input, DATA_TYPECODE, &is_new_object);
npy_intp size[2] = { -1, -1 };
if (!array || !require_dimensions(array, 2) || !require_size(array, size, 2)) SWIG_fail;
- $1 = (DATA_TYPE*) array->data;
+ $1 = (DATA_TYPE*) array_data(array);
$2 = (DIM_TYPE) array_size(array,0);
$3 = (DIM_TYPE) array_size(array,1);
}
@@ -569,7 +570,7 @@ int require_size(PyArrayObject* ary, npy_intp* size, int n) {
if (!array || !require_dimensions(array, 2) || !require_size(array, size, 2)) SWIG_fail;
$1 = (DIM_TYPE) array_size(array,0);
$2 = (DIM_TYPE) array_size(array,1);
- $3 = (DATA_TYPE*) array->data;
+ $3 = (DATA_TYPE*) array_data(array);
}
%typemap(freearg)
(DIM_TYPE DIM1, DIM_TYPE DIM2, DATA_TYPE* IN_ARRAY2)
@@ -591,7 +592,7 @@ int require_size(PyArrayObject* ary, npy_intp* size, int n) {
array = obj_to_array_contiguous_allow_conversion($input, DATA_TYPECODE, &is_new_object);
npy_intp size[3] = { $1_dim0, $1_dim1, $1_dim2 };
if (!array || !require_dimensions(array, 3) || !require_size(array, size, 3)) SWIG_fail;
- $1 = ($1_ltype) array->data;
+ $1 = ($1_ltype) array_data(array);
}
%typemap(freearg)
(DATA_TYPE IN_ARRAY3[ANY][ANY][ANY])
@@ -614,7 +615,7 @@ int require_size(PyArrayObject* ary, npy_intp* size, int n) {
array = obj_to_array_contiguous_allow_conversion($input, DATA_TYPECODE, &is_new_object);
npy_intp size[3] = { -1, -1, -1 };
if (!array || !require_dimensions(array, 3) || !require_size(array, size, 3)) SWIG_fail;
- $1 = (DATA_TYPE*) array->data;
+ $1 = (DATA_TYPE*) array_data(array);
$2 = (DIM_TYPE) array_size(array,0);
$3 = (DIM_TYPE) array_size(array,1);
$4 = (DIM_TYPE) array_size(array,2);
@@ -643,7 +644,7 @@ int require_size(PyArrayObject* ary, npy_intp* size, int n) {
$1 = (DIM_TYPE) array_size(array,0);
$2 = (DIM_TYPE) array_size(array,1);
$3 = (DIM_TYPE) array_size(array,2);
- $4 = (DATA_TYPE*) array->data;
+ $4 = (DATA_TYPE*) array_data(array);
}
%typemap(freearg)
(DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DATA_TYPE* IN_ARRAY3)
@@ -670,7 +671,7 @@ int require_size(PyArrayObject* ary, npy_intp* size, int n) {
npy_intp size[1] = { $1_dim0 };
if (!array || !require_dimensions(array,1) || !require_size(array, size, 1)
|| !require_contiguous(array) || !require_native(array)) SWIG_fail;
- $1 = ($1_ltype) array->data;
+ $1 = ($1_ltype) array_data(array);
}
/* Typemap suite for (DATA_TYPE* INPLACE_ARRAY1, DIM_TYPE DIM1)
@@ -687,7 +688,7 @@ int require_size(PyArrayObject* ary, npy_intp* size, int n) {
array = obj_to_array_no_conversion($input, DATA_TYPECODE);
if (!array || !require_dimensions(array,1) || !require_contiguous(array)
|| !require_native(array)) SWIG_fail;
- $1 = (DATA_TYPE*) array->data;
+ $1 = (DATA_TYPE*) array_data(array);
$2 = 1;
for (int i=0; i<array->nd; ++i) $2 *= array_size(array,i);
}
@@ -708,7 +709,7 @@ int require_size(PyArrayObject* ary, npy_intp* size, int n) {
|| !require_native(array)) SWIG_fail;
$1 = 1;
for (int i=0; i<array->nd; ++i) $1 *= array_size(array,i);
- $2 = (DATA_TYPE*) array->data;
+ $2 = (DATA_TYPE*) array_data(array);
}
/* Typemap suite for (DATA_TYPE INPLACE_ARRAY2[ANY][ANY])
@@ -726,7 +727,7 @@ int require_size(PyArrayObject* ary, npy_intp* size, int n) {
npy_intp size[2] = { $1_dim0, $1_dim1 };
if (!array || !require_dimensions(array,2) || !require_size(array, size, 2)
|| !require_contiguous(array) || !require_native(array)) SWIG_fail;
- $1 = ($1_ltype) array->data;
+ $1 = ($1_ltype) array_data(array);
}
/* Typemap suite for (DATA_TYPE* INPLACE_ARRAY2, DIM_TYPE DIM1, DIM_TYPE DIM2)
@@ -743,7 +744,7 @@ int require_size(PyArrayObject* ary, npy_intp* size, int n) {
array = obj_to_array_no_conversion($input, DATA_TYPECODE);
if (!array || !require_dimensions(array,2) || !require_contiguous(array)
|| !require_native(array)) SWIG_fail;
- $1 = (DATA_TYPE*) array->data;
+ $1 = (DATA_TYPE*) array_data(array);
$2 = (DIM_TYPE) array_size(array,0);
$3 = (DIM_TYPE) array_size(array,1);
}
@@ -764,7 +765,7 @@ int require_size(PyArrayObject* ary, npy_intp* size, int n) {
|| !require_native(array)) SWIG_fail;
$1 = (DIM_TYPE) array_size(array,0);
$2 = (DIM_TYPE) array_size(array,1);
- $3 = (DATA_TYPE*) array->data;
+ $3 = (DATA_TYPE*) array_data(array);
}
/* Typemap suite for (DATA_TYPE INPLACE_ARRAY3[ANY][ANY][ANY])
@@ -782,7 +783,7 @@ int require_size(PyArrayObject* ary, npy_intp* size, int n) {
npy_intp size[3] = { $1_dim0, $1_dim1, $1_dim2 };
if (!array || !require_dimensions(array,3) || !require_size(array, size, 3)
|| !require_contiguous(array) || !require_native(array)) SWIG_fail;
- $1 = ($1_ltype) array->data;
+ $1 = ($1_ltype) array_data(array);
}
/* Typemap suite for (DATA_TYPE* INPLACE_ARRAY3, DIM_TYPE DIM1, DIM_TYPE DIM2,
@@ -800,7 +801,7 @@ int require_size(PyArrayObject* ary, npy_intp* size, int n) {
array = obj_to_array_no_conversion($input, DATA_TYPECODE);
if (!array || !require_dimensions(array,3) || !require_contiguous(array)
|| !require_native(array)) SWIG_fail;
- $1 = (DATA_TYPE*) array->data;
+ $1 = (DATA_TYPE*) array_data(array);
$2 = (DIM_TYPE) array_size(array,0);
$3 = (DIM_TYPE) array_size(array,1);
$4 = (DIM_TYPE) array_size(array,2);
@@ -824,7 +825,7 @@ int require_size(PyArrayObject* ary, npy_intp* size, int n) {
$1 = (DIM_TYPE) array_size(array,0);
$2 = (DIM_TYPE) array_size(array,1);
$3 = (DIM_TYPE) array_size(array,2);
- $4 = (DATA_TYPE*) array->data;
+ $4 = (DATA_TYPE*) array_data(array);
}
/*************************/
@@ -839,7 +840,7 @@ int require_size(PyArrayObject* ary, npy_intp* size, int n) {
{
npy_intp dims[1] = { $1_dim0 };
array = PyArray_SimpleNew(1, dims, DATA_TYPECODE);
- $1 = ($1_ltype)((PyArrayObject*)array)->data;
+ $1 = ($1_ltype) array_data(array);
}
%typemap(argout)
(DATA_TYPE ARGOUT_ARRAY1[ANY])
@@ -863,7 +864,7 @@ int require_size(PyArrayObject* ary, npy_intp* size, int n) {
$2 = (DIM_TYPE) PyInt_AsLong($input);
npy_intp dims[1] = { (npy_intp) $2 };
array = PyArray_SimpleNew(1, dims, DATA_TYPECODE);
- $1 = (DATA_TYPE*)((PyArrayObject*)array)->data;
+ $1 = (DATA_TYPE*) array_data(array);
}
%typemap(argout)
(DATA_TYPE* ARGOUT_ARRAY1, DIM_TYPE DIM1)
@@ -887,7 +888,7 @@ int require_size(PyArrayObject* ary, npy_intp* size, int n) {
$1 = (DIM_TYPE) PyInt_AsLong($input);
npy_intp dims[1] = { (npy_intp) $1 };
array = PyArray_SimpleNew(1, dims, DATA_TYPECODE);
- $2 = (DATA_TYPE*)((PyArrayObject*)array)->data;
+ $2 = (DATA_TYPE*) array_data(array);
}
%typemap(argout)
(DIM_TYPE DIM1, DATA_TYPE* ARGOUT_ARRAY1)
@@ -903,7 +904,7 @@ int require_size(PyArrayObject* ary, npy_intp* size, int n) {
{
npy_intp dims[2] = { $1_dim0, $1_dim1 };
array = PyArray_SimpleNew(2, dims, DATA_TYPECODE);
- $1 = ($1_ltype)((PyArrayObject*)array)->data;
+ $1 = ($1_ltype) array_data(array);
}
%typemap(argout)
(DATA_TYPE ARGOUT_ARRAY2[ANY][ANY])
@@ -919,7 +920,7 @@ int require_size(PyArrayObject* ary, npy_intp* size, int n) {
{
npy_intp dims[3] = { $1_dim0, $1_dim1, $1_dim2 };
array = PyArray_SimpleNew(3, dims, DATA_TYPECODE);
- $1 = ($1_ltype)((PyArrayObject*)array)->data;
+ $1 = ($1_ltype) array_data(array);
}
%typemap(argout)
(DATA_TYPE ARGOUT_ARRAY3[ANY][ANY][ANY])
diff --git a/numpy/doc/swig/numpy_swig.html b/numpy/doc/swig/numpy_swig.html
index 8f292d446..a335901c0 100644
--- a/numpy/doc/swig/numpy_swig.html
+++ b/numpy/doc/swig/numpy_swig.html
@@ -730,6 +730,9 @@ of <tt class="docutils literal"><span class="pre">a</span></tt>, assuming <tt cl
<dt><strong>array_size(a,i)</strong></dt>
<dd>Evaluates to the <tt class="docutils literal"><span class="pre">i</span></tt>-th dimension size of <tt class="docutils literal"><span class="pre">a</span></tt>, assuming <tt class="docutils literal"><span class="pre">a</span></tt>
can be cast to a <tt class="docutils literal"><span class="pre">PyArrayObject*</span></tt>.</dd>
+<dt><strong>array_data(a)</strong></dt>
+<dd>Evaluates to a pointer of type <tt class="docutils literal"><span class="pre">void*</span></tt> that points to the data
+buffer of <tt class="docutils literal"><span class="pre">a</span></tt>, assuming <tt class="docutils literal"><span class="pre">a</span></tt> can be cast to a <tt class="docutils literal"><span class="pre">PyArrayObject*</span></tt>.</dd>
<dt><strong>array_is_contiguous(a)</strong></dt>
<dd>Evaluates as true if <tt class="docutils literal"><span class="pre">a</span></tt> is a contiguous array. Equivalent to
<tt class="docutils literal"><span class="pre">(PyArray_ISCONTIGUOUS(a))</span></tt>.</dd>
@@ -945,7 +948,7 @@ possible.</p>
</div>
<div class="footer">
<hr class="footer" />
-Generated on: 2007-04-04 22:57 UTC.
+Generated on: 2007-04-10 15:20 UTC.
Generated by <a class="reference" href="http://docutils.sourceforge.net/">Docutils</a> from <a class="reference" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> source.
</div>
diff --git a/numpy/doc/swig/numpy_swig.pdf b/numpy/doc/swig/numpy_swig.pdf
index 0b306b9c0..832c3fd06 100644
--- a/numpy/doc/swig/numpy_swig.pdf
+++ b/numpy/doc/swig/numpy_swig.pdf
Binary files differ
diff --git a/numpy/doc/swig/numpy_swig.txt b/numpy/doc/swig/numpy_swig.txt
index f3885ddde..6e4d06f41 100644
--- a/numpy/doc/swig/numpy_swig.txt
+++ b/numpy/doc/swig/numpy_swig.txt
@@ -421,6 +421,10 @@ Macros
Evaluates to the ``i``-th dimension size of ``a``, assuming ``a``
can be cast to a ``PyArrayObject*``.
+ **array_data(a)**
+ Evaluates to a pointer of type ``void*`` that points to the data
+ buffer of ``a``, assuming ``a`` can be cast to a ``PyArrayObject*``.
+
**array_is_contiguous(a)**
Evaluates as true if ``a`` is a contiguous array. Equivalent to
``(PyArray_ISCONTIGUOUS(a))``.