def copy_double(self, array_in): """ Copies @array_in into the C array and returns it """ array_out = mu.new_darr(len(array_in)) try: for i in xrange(len(array_in)): mu.darr_setitem(array_out, i, np.double(array_in[i])) except Exception: #@TODO:put here some stuffs! pass else: return array_out
def __init__(self): super(PyMUMPS, self).__init__() self.utils = mu # LAMBDAS!!!! ## For simplicity and to follow the documentation, the indices ## are Fotran-like : ICNTL(index) -> self.icntl(index-1) self.ICNTL = lambda i, v : mu.iarr_setitem(self.icntl, i-1, np.int(v)) self.CNTL = lambda i, v : mu.darr_setitem(self.cntl, i-1, np.double(v)) self.INFO = lambda i : mu.iarr_getitem(self.info, i-1) self.INFOG = lambda i : mu.iarr_getitem(self.infog, i-1) self.RINFO = lambda i : mu.darr_getitem(self.rinfo, i-1) self.RINFOG = lambda i : mu.darr_getitem(self.rinfog, i-1) self.IRN = lambda v: self.set_int(self.a, v, offset=np.int(1)) self.A = lambda v: self.set_double(self.a, v) self.RHS = lambda v: self.set_double(self.rhs, v)
def set_cntl(self, index, value): mu.darr_setitem(self.cntl, index-1, np.double(value))