[Numpy-svn] r5106 - trunk/numpy/linalg

numpy-svn@scip... numpy-svn@scip...
Mon Apr 28 03:14:18 CDT 2008


Author: stefan
Date: 2008-04-28 03:14:06 -0500 (Mon, 28 Apr 2008)
New Revision: 5106

Added:
   trunk/numpy/linalg/python_xerbla.c
Removed:
   trunk/numpy/linalg/pythonxerbla.c
Modified:
   trunk/numpy/linalg/setup.py
Log:
Rename and reformat pythonxerbla.


Copied: trunk/numpy/linalg/python_xerbla.c (from rev 5084, trunk/numpy/linalg/pythonxerbla.c)
===================================================================
--- trunk/numpy/linalg/pythonxerbla.c	2008-04-25 17:31:19 UTC (rev 5084)
+++ trunk/numpy/linalg/python_xerbla.c	2008-04-28 08:14:06 UTC (rev 5106)
@@ -0,0 +1,36 @@
+#include "Python.h"
+#include "f2c.h"
+
+/*
+  From the original manpage:
+  --------------------------
+  XERBLA is an error handler for the LAPACK routines.
+  It is called by an LAPACK routine if an input parameter has an invalid value.
+  A message is printed and execution stops.
+
+  Instead of printing a message and stopping the execution, a
+  ValueError is raised with the message.
+
+  Parameters:
+  -----------
+  srname: Subroutine name to use in error message, maximum six characters.
+          Spaces at the end are skipped.
+  info: Number of the invalid parameter.
+*/
+
+int xerbla_(char *srname, integer *info)
+{
+        const char* format = "On entry to %.*s" \
+                " parameter number %d had an illegal value";
+        char buf[strlen(format) + 6 + 4]; /* 6 for name, 4 for param. num. */
+
+        int len = 0; /* length of subroutine name*/
+        while( len<6 && srname[len]!='\0' )
+                len++;
+        while( len && srname[len-1]==' ' )
+                len--;
+
+        snprintf(buf, sizeof(buf), format, len, srname, *info);
+        PyErr_SetString(PyExc_ValueError, buf);
+        return 0;
+}

Deleted: trunk/numpy/linalg/pythonxerbla.c
===================================================================
--- trunk/numpy/linalg/pythonxerbla.c	2008-04-28 07:35:55 UTC (rev 5105)
+++ trunk/numpy/linalg/pythonxerbla.c	2008-04-28 08:14:06 UTC (rev 5106)
@@ -1,33 +0,0 @@
-#include "Python.h"
-#include "f2c.h"
-
-/*
-  From the original manpage:
-  XERBLA is an error handler for the LAPACK routines. 
-  It is called by an LAPACK routine if an input parameter has an invalid value.
-  A message is printed and execution stops.
-
-  Instead of printing a message and stopping the execution, a
-  ValueError is raised with the message.
-
-  Parameters:
-        srname: Subroutine name to use in error message, maximum six characters.
-	        Spaces at the end are skipped.
-	info: Number of the invalid parameter.
-*/
-
-int xerbla_(char *srname, integer *info)
-{
-        char format[] = "On entry to %.*s"			\
-		" parameter number %d had an illegal value";
-	char buf[70]; /* 6 for name, 4 for param. num. */
-	
-	int len = 0; /* length of subroutine name*/
-	while( len<6 && srname[len]!='\0' )
-		len++;
-	while( len && srname[len-1]==' ' )
-		len--;
-	snprintf(buf, sizeof(buf), format, len, srname, *info);
-	PyErr_SetString(PyExc_ValueError, buf);
-	return 0;
-}

Modified: trunk/numpy/linalg/setup.py
===================================================================
--- trunk/numpy/linalg/setup.py	2008-04-28 07:35:55 UTC (rev 5105)
+++ trunk/numpy/linalg/setup.py	2008-04-28 08:14:06 UTC (rev 5106)
@@ -16,14 +16,14 @@
             return ext.depends[:-1]
         else:
             if sys.platform=='win32':
-                print "### Warning:  pythonxerbla.c is disabled ###"
+                print "### Warning:  python_xerbla.c is disabled ###"
                 return ext.depends[:1]
             return ext.depends[:2]
 
     config.add_extension('lapack_lite',
                          sources = [get_lapack_lite_sources],
                          depends=  ['lapack_litemodule.c',
-                                    'pythonxerbla.c',
+                                    'python_xerbla.c',
                                     'zlapack_lite.c', 'dlapack_lite.c',
                                     'blas_lite.c', 'dlamch.c',
                                     'f2c_lite.c','f2c.h'],



More information about the Numpy-svn mailing list