Commit acb1f79e authored by Joseph Weston's avatar Joseph Weston Committed by Joseph Weston
Browse files

update low-level lapack routines to take bytes

The higher-level wrappers like `decomp_lu` take
strings, and we convert them explicitly inside.
parent d9c47b62
......@@ -129,6 +129,7 @@ def rcond_from_lu(xxx_todo_changeme1, norm_a, norm="1"):
(lu, ipiv, singular) = xxx_todo_changeme1
if not norm in ("1", "I"):
raise ValueError("norm in rcond_from_lu must be either '1' or 'I'")
norm = norm.encode('utf8') # lapack expects bytes
ltype, lu = lapack.prepare_for_lapack(False, lu)
......
......@@ -245,7 +245,7 @@ def zgetrs(np.ndarray[np.complex128_t, ndim=2] LU,
# Wrappers for xGECON
def sgecon(np.ndarray[np.float32_t, ndim=2] LU,
float normA, char *norm = "1"):
float normA, char *norm = b"1"):
cdef l_int N, info
cdef float rcond
cdef np.ndarray[np.float32_t, ndim=1] work
......@@ -266,7 +266,7 @@ def sgecon(np.ndarray[np.float32_t, ndim=2] LU,
return rcond
def dgecon(np.ndarray[np.float64_t, ndim=2] LU,
double normA, char *norm = "1"):
double normA, char *norm = b"1"):
cdef l_int N, info
cdef double rcond
cdef np.ndarray[np.float64_t, ndim=1] work
......@@ -287,7 +287,7 @@ def dgecon(np.ndarray[np.float64_t, ndim=2] LU,
return rcond
def cgecon(np.ndarray[np.complex64_t, ndim=2] LU,
float normA, char *norm = "1"):
float normA, char *norm = b"1"):
cdef l_int N, info
cdef float rcond
cdef np.ndarray[np.complex64_t, ndim=1] work
......@@ -308,7 +308,7 @@ def cgecon(np.ndarray[np.complex64_t, ndim=2] LU,
return rcond
def zgecon(np.ndarray[np.complex128_t, ndim=2] LU,
double normA, char *norm = "1"):
double normA, char *norm = b"1"):
cdef l_int N, info
cdef double rcond
cdef np.ndarray[np.complex128_t, ndim=1] work
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment