Navigation | Overlay |
---|---|
t Navigate files | h Toggle hits |
y Change url to tip of branch | m Toggle misses |
b / v Jump to prev/next hit line | p Toggle partial |
z / x Jump to prev/next missed or partial line | 1..9 Toggle flags |
shift + o Open current page in GitHub | a Toggle all on |
/ or ? Show keyboard shortcuts dialog | c Toggle context lines or commits |
1 |
#include "Python.h" |
|
2 |
#include "numpy/npy_common.h" |
|
3 |
#include "npy_cblas.h" |
|
4 |
|
|
5 |
/*
|
|
6 |
From the original manpage:
|
|
7 |
--------------------------
|
|
8 |
XERBLA is an error handler for the LAPACK routines.
|
|
9 |
It is called by an LAPACK routine if an input parameter has an invalid value.
|
|
10 |
A message is printed and execution stops.
|
|
11 |
|
|
12 |
Instead of printing a message and stopping the execution, a
|
|
13 |
ValueError is raised with the message.
|
|
14 |
|
|
15 |
Parameters:
|
|
16 |
-----------
|
|
17 |
srname: Subroutine name to use in error message, maximum six characters.
|
|
18 |
Spaces at the end are skipped.
|
|
19 |
info: Number of the invalid parameter.
|
|
20 |
*/
|
|
21 |
|
|
22 |
CBLAS_INT BLAS_FUNC(xerbla)(char *srname, CBLAS_INT *info) |
|
23 |
{
|
|
24 |
static const char format[] = "On entry to %.*s" \ |
|
25 |
" parameter number %d had an illegal value"; |
|
26 |
char buf[sizeof(format) + 6 + 4]; /* 6 for name, 4 for param. num. */ |
|
27 |
|
|
28 |
int len = 0; /* length of subroutine name*/ |
|
29 |
#ifdef WITH_THREAD
|
|
30 |
PyGILState_STATE save; |
|
31 |
#endif
|
|
32 |
|
|
33 |
while( len<6 && srname[len]!='\0' ) |
|
34 |
len++; |
|
35 |
while( len && srname[len-1]==' ' ) |
|
36 |
len--; |
|
37 |
#ifdef WITH_THREAD
|
|
38 |
save = PyGILState_Ensure(); |
|
39 |
#endif
|
|
40 |
PyOS_snprintf(buf, sizeof(buf), format, len, srname, (int)*info); |
|
41 |
PyErr_SetString(PyExc_ValueError, buf); |
|
42 |
#ifdef WITH_THREAD
|
|
43 |
PyGILState_Release(save); |
|
44 |
#endif
|
|
45 |
|
|
46 |
return 0; |
|
47 |
}
|
Read our documentation on viewing source code .