Coverage for kwant/linalg/_mumps.pyx : 50%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
# # This file is part of Kwant. It is subject to the license terms in the file # LICENSE.rst found in the top-level directory of this distribution and at # http://kwant-project.org/license. A list of Kwant authors can be found in # the file AUTHORS.rst at the top-level directory of this distribution and at # http://kwant-project.org/authors.
cimport numpy as np from . cimport cmumps
# Proxy classes for Python access to the control and info parameters of MUMPS
cdef class mumps_int_array: cdef cmumps.MUMPS_INT *array
def __init__(self):
def __getitem__(self, key):
def __setitem__(self, key, value):
# workaround for the fact that cython cannot pass pointers to an __init__() cdef make_mumps_int_array(cmumps.MUMPS_INT *array):
cdef class smumps_real_array: cdef cmumps.SMUMPS_REAL *array
def __init__(self): self.array = NULL
def __getitem__(self, key): return self.array[key - 1]
def __setitem__(self, key, value): self.array[key - 1] = value
cdef make_smumps_real_array(cmumps.SMUMPS_REAL *array): wrapper = smumps_real_array() wrapper.array = array return wrapper
cdef class dmumps_real_array: cdef cmumps.DMUMPS_REAL *array
def __init__(self): self.array = NULL
def __getitem__(self, key): return self.array[key - 1]
def __setitem__(self, key, value): self.array[key - 1] = value
cdef make_dmumps_real_array(cmumps.DMUMPS_REAL *array): wrapper = dmumps_real_array() wrapper.array = array return wrapper
cdef class cmumps_real_array: cdef cmumps.CMUMPS_REAL *array
def __init__(self): self.array = NULL
def __getitem__(self, key): return self.array[key - 1]
def __setitem__(self, key, value): self.array[key - 1] = value
cdef make_cmumps_real_array(cmumps.CMUMPS_REAL *array): wrapper = cmumps_real_array() wrapper.array = array return wrapper
cdef class zmumps_real_array: cdef cmumps.ZMUMPS_REAL *array
def __init__(self):
def __getitem__(self, key):
def __setitem__(self, key, value):
cdef make_zmumps_real_array(cmumps.ZMUMPS_REAL *array):
#############################################################
cdef class zmumps: cdef cmumps.ZMUMPS_STRUC_C params
cdef public mumps_int_array icntl cdef public zmumps_real_array cntl cdef public mumps_int_array info cdef public mumps_int_array infog cdef public zmumps_real_array rinfo cdef public zmumps_real_array rinfog
def __init__(self, verbose=False, sym=0):
# no diagnostic output (MUMPS is very verbose normally)
def __dealloc__(self):
def call(self):
def _set_job(self, value):
def _get_job(self): return self.params.job
@property def sym(self):
def set_assembled_matrix(self, cmumps.MUMPS_INT N, np.ndarray[cmumps.MUMPS_INT, ndim=1] i, np.ndarray[cmumps.MUMPS_INT, ndim=1] j, np.ndarray[np.complex128_t, ndim=1] a):
def set_dense_rhs(self, np.ndarray rhs):
raise ValueError("numpy array must be of dtype complex128!")
else:
def set_sparse_rhs(self, np.ndarray[cmumps.MUMPS_INT, ndim=1] col_ptr, np.ndarray[cmumps.MUMPS_INT, ndim=1] row_ind, np.ndarray[np.complex128_t, ndim=1] data):
raise ValueError("Number of entries in row index and value " "array differ!")
def set_schur(self, np.ndarray[np.complex128_t, ndim=2, mode='c'] schur, np.ndarray[cmumps.MUMPS_INT, ndim=1] schur_vars):
raise ValueError("Schur matrix must be squared!") raise ValueError("Number of Schur variables must agree " "with Schur complement size!")
|