Пример #1
0
def parse_args(P, x, y, a=None):
    D.P = get_ptr(P)
    D.x = get_ptr(x)
    D.y = get_ptr(y)
    D.n = P.size
    D.m = x.size
    if a is not None:
        D.a = get_ptr(a)
Пример #2
0
def odesolve(f, y, t, ng=0, g=None, ibbox=None, bbox=None):
    D.f = _cast_odefun_t(f)
    D.n, D.neq = y.shape
    D.y, D.t = get_ptr(y), get_ptr(t)

    if ng != 0:
        D.ng = ng
        if g is None:
            D.g = oderoot_t()
            D.ibbox, D.bbox = get_ptr(ibbox), get_ptr(bbox)
        else:
            D.g = _cast_oderoot_t(g)

    codepack.odesolve(byref(D))
    return D.points_done
Пример #3
0
 def value(self):
     d = H5._H5Dopen(self.fid, self.name)
     n = H5._len(d)
     a = np.empty(n, 'f')
     n = H5._read(d, get_ptr(a))
     H5._H5Dclose(d)
     return a
Пример #4
0
 def fun_fit(P, x, y, ydata, a=None, do_var=None):
     parse_args_ydata(P, x, y, ydata, a)
     if do_var is not None:
         D.do_var = get_ptr(do_var)
     getattr(cfitfun, name_fit)(byref(D))
     return P
Пример #5
0
def parse_args_ydata(P, x, y, ydata, a=None):
    parse_args(P, x, y, a)
    D.ydata = get_ptr(ydata)