def initfun_fixedlen(cls, f, n, domain=None): nn = np.array(n) if nn.size < 2: funs = generate_funs(domain, Bndfun.initfun_fixedlen, { 'f': f, 'n': n }) else: domain = Domain(domain if domain is not None else prefs.domain) if not nn.size == domain.size - 1: raise BadFunLengthArgument funs = [] for interval, length in zip(domain.intervals, nn): funs.append(Bndfun.initfun_fixedlen(f, interval, length)) return cls(funs)
def initfun_adaptive(cls, f, domain=DefaultPrefs.domain): funs = generate_funs(domain, Bndfun.initfun_adaptive, [f]) return cls(funs)
def initidentity(cls, domain=DefaultPrefs.domain): funs = generate_funs(domain, Bndfun.initidentity) return cls(funs)
def initconst(cls, c, domain=DefaultPrefs.domain): funs = generate_funs(domain, Bndfun.initconst, [c]) return cls(funs)
def initfun_adaptive(cls, f, domain=None): domain = domain if domain is not None else prefs.domain funs = generate_funs(domain, Bndfun.initfun_adaptive, [f]) return cls(funs)
def initidentity(cls, domain=None): domain = domain if domain is not None else prefs.domain funs = generate_funs(domain, Bndfun.initidentity) return cls(funs)
def initconst(cls, c, domain=None): domain = domain if domain is not None else prefs.domain funs = generate_funs(domain, Bndfun.initconst, [c]) return cls(funs)
def initfun_adaptive(cls, f, domain=None): return cls(generate_funs(domain, Bndfun.initfun_adaptive, {'f': f}))
def initconst(cls, c, domain=None): return cls(generate_funs(domain, Bndfun.initconst, {'c': c}))
def initidentity(cls, domain=None): return cls(generate_funs(domain, Bndfun.initidentity))