[Numpy-svn] r3683 - trunk/numpy/doc/swig

numpy-svn@scip... numpy-svn@scip...
Sun Apr 8 17:37:23 CDT 2007


Author: wfspotz@sandia.gov
Date: 2007-04-08 17:37:21 -0500 (Sun, 08 Apr 2007)
New Revision: 3683

Modified:
   trunk/numpy/doc/swig/numpy.i
Log:
Added %typecheck directive for IN_ARRAY typemaps

Modified: trunk/numpy/doc/swig/numpy.i
===================================================================
--- trunk/numpy/doc/swig/numpy.i	2007-04-08 21:28:42 UTC (rev 3682)
+++ trunk/numpy/doc/swig/numpy.i	2007-04-08 22:37:21 UTC (rev 3683)
@@ -441,6 +441,11 @@
 
 /* Typemap suite for (DATA_TYPE IN_ARRAY1[ANY])
  */
+%typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY)
+  (DATA_TYPE IN_ARRAY1[ANY])
+{
+  $1 = ($input != NULL);
+}
 %typemap(in)
   (DATA_TYPE IN_ARRAY1[ANY])
   (PyArrayObject* array=NULL, int is_new_object=0)
@@ -458,6 +463,11 @@
 
 /* Typemap suite for (DATA_TYPE* IN_ARRAY1, DIM_TYPE DIM1)
  */
+%typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY)
+  (DATA_TYPE* IN_ARRAY1, DIM_TYPE DIM1)
+{
+  $1 = ($input != NULL);
+}
 %typemap(in)
   (DATA_TYPE* IN_ARRAY1, DIM_TYPE DIM1)
   (PyArrayObject* array=NULL, int is_new_object=0)
@@ -476,6 +486,11 @@
 
 /* Typemap suite for (DIM_TYPE DIM1, DATA_TYPE* IN_ARRAY1)
  */
+%typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY)
+  (DIM_TYPE DIM1, DATA_TYPE* IN_ARRAY1)
+{
+  $1 = ($input != NULL);
+}
 %typemap(in)
   (DIM_TYPE DIM1, DATA_TYPE* IN_ARRAY1)
   (PyArrayObject* array=NULL, int is_new_object=0)
@@ -494,6 +509,11 @@
 
 /* Typemap suite for (DATA_TYPE IN_ARRAY2[ANY][ANY])
  */
+%typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY)
+  (DATA_TYPE IN_ARRAY2[ANY][ANY])
+{
+  $1 = ($input != NULL);
+}
 %typemap(in)
   (DATA_TYPE IN_ARRAY2[ANY][ANY])
   (PyArrayObject* array=NULL, int is_new_object=0)
@@ -511,6 +531,11 @@
 
 /* Typemap suite for (DATA_TYPE* IN_ARRAY2, DIM_TYPE DIM1, DIM_TYPE DIM2)
  */
+%typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY)
+  (DATA_TYPE* IN_ARRAY2, DIM_TYPE DIM1, DIM_TYPE DIM2)
+{
+  $1 = ($input != NULL);
+}
 %typemap(in)
   (DATA_TYPE* IN_ARRAY2, DIM_TYPE DIM1, DIM_TYPE DIM2)
   (PyArrayObject* array=NULL, int is_new_object=0)
@@ -530,6 +555,11 @@
 
 /* Typemap suite for (DIM_TYPE DIM1, DIM_TYPE DIM2, DATA_TYPE* IN_ARRAY2)
  */
+%typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY)
+  (DIM_TYPE DIM1, DIM_TYPE DIM2, DATA_TYPE* IN_ARRAY2)
+{
+  $1 = ($input != NULL);
+}
 %typemap(in)
   (DIM_TYPE DIM1, DIM_TYPE DIM2, DATA_TYPE* IN_ARRAY2)
   (PyArrayObject* array=NULL, int is_new_object=0)
@@ -549,6 +579,11 @@
 
 /* Typemap suite for (DATA_TYPE IN_ARRAY3[ANY][ANY][ANY])
  */
+%typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY)
+  (DATA_TYPE IN_ARRAY3[ANY][ANY][ANY])
+{
+  $1 = ($input != NULL);
+}
 %typemap(in)
   (DATA_TYPE IN_ARRAY3[ANY][ANY][ANY])
   (PyArrayObject* array=NULL, int is_new_object=0)
@@ -567,6 +602,11 @@
 /* Typemap suite for (DATA_TYPE* IN_ARRAY3, DIM_TYPE DIM1, DIM_TYPE DIM2,
  *                    DIM_TYPE DIM3)
  */
+%typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY)
+  (DATA_TYPE* IN_ARRAY3, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3)
+{
+  $1 = ($input != NULL);
+}
 %typemap(in)
   (DATA_TYPE* IN_ARRAY3, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3)
   (PyArrayObject* array=NULL, int is_new_object=0)
@@ -588,6 +628,11 @@
 /* Typemap suite for (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, 
  *                    DATA_TYPE* IN_ARRAY3)
  */
+%typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY)
+  (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DATA_TYPE* IN_ARRAY3)
+{
+  $1 = ($input != NULL);
+}
 %typemap(in)
   (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DATA_TYPE* IN_ARRAY3)
   (PyArrayObject* array=NULL, int is_new_object=0)



More information about the Numpy-svn mailing list