[Numpy-svn] r3360 - in trunk/numpy/core: include/numpy src

numpy-svn at scipy.org numpy-svn at scipy.org
Wed Oct 18 17:52:33 CDT 2006


Author: oliphant
Date: 2006-10-18 17:52:29 -0500 (Wed, 18 Oct 2006)
New Revision: 3360

Modified:
   trunk/numpy/core/include/numpy/ndarrayobject.h
   trunk/numpy/core/src/arrayobject.c
Log:
Allow F_CONTIGUOUS and C_CONTIGUOUS as aliases to FORTRAN and CONTIGUOUS

Modified: trunk/numpy/core/include/numpy/ndarrayobject.h
===================================================================
--- trunk/numpy/core/include/numpy/ndarrayobject.h	2006-10-18 18:15:26 UTC (rev 3359)
+++ trunk/numpy/core/include/numpy/ndarrayobject.h	2006-10-18 22:52:29 UTC (rev 3360)
@@ -1198,6 +1198,9 @@
    C-contiguous array)*/
 #define NPY_FORTRAN       0x0002
 
+#define NPY_C_CONTIGUOUS NPY_CONTIGUOUS
+#define NPY_F_CONTIGUOUS NPY_FORTRAN
+
 /*
   Note: all 0-d arrays are CONTIGUOUS and FORTRAN contiguous. If a
    1-d array is CONTIGUOUS it is also FORTRAN contiguous

Modified: trunk/numpy/core/src/arrayobject.c
===================================================================
--- trunk/numpy/core/src/arrayobject.c	2006-10-18 18:15:26 UTC (rev 3359)
+++ trunk/numpy/core/src/arrayobject.c	2006-10-18 22:52:29 UTC (rev 3360)
@@ -11574,6 +11574,14 @@
          (getter)arrayflags_contiguous_get,
          NULL,
          ""},
+        {"c_contiguous",
+         (getter)arrayflags_contiguous_get,
+         NULL,
+         ""},
+        {"f_contiguous",
+         (getter)arrayflags_fortran_get,
+         NULL,
+         ""},
         {"fortran",
          (getter)arrayflags_fortran_get,
          NULL,
@@ -11691,6 +11699,10 @@
         case 12:
                 if (strncmp(key, "UPDATEIFCOPY", n)==0)
                         return arrayflags_updateifcopy_get(self);
+                if (strncmp(key, "C_CONTIGUOUS", n)==0)
+                        return arrayflags_contiguous_get(self);
+                if (strncmp(key, "F_CONTIGUOUS", n)==0)
+                        return arrayflags_fortran_get(self);
                 break;
         }
 
@@ -11736,8 +11748,8 @@
 
         return PyString_FromFormat("  %s : %s\n  %s : %s\n  %s : %s\n"\
                                    "  %s : %s\n  %s : %s\n  %s : %s",
-                                   "CONTIGUOUS", _torf_(fl, CONTIGUOUS),
-                                   "FORTRAN", _torf_(fl, FORTRAN),
+                                   "C_CONTIGUOUS", _torf_(fl, CONTIGUOUS),
+                                   "F_CONTIGUOUS", _torf_(fl, FORTRAN),
                                    "OWNDATA", _torf_(fl, OWNDATA),
                                    "WRITEABLE", _torf_(fl, WRITEABLE),
                                    "ALIGNED", _torf_(fl, ALIGNED),



More information about the Numpy-svn mailing list