コード例 #1
0
ファイル: fitpack2.py プロジェクト: atabary/scipy
    def _reset_nest(self, data, nest=None):
        n = data[10]
        if nest is None:
            k,m = data[5],len(data[0])
            nest = m+k+1 # this is the maximum bound for nest
        else:
            if not n <= nest:
                raise ValueError("`nest` can only be increased")
        t, c, fpint, nrdata = [np.resize(data[n], nest) for n in [8,9,11,12]]

        args = data[:8] + (t,c,n,fpint,nrdata,data[13])
        data = dfitpack.fpcurf1(*args)
        return data
コード例 #2
0
ファイル: fitpack2.py プロジェクト: afarahi/QFT
    def _reset_nest(self, data, nest=None):
        n = data[10]
        if nest is None:
            k,m = data[5],len(data[0])
            nest = m+k+1 # this is the maximum bound for nest
        else:
            if not n <= nest:
                raise ValueError("`nest` can only be increased")
        t, c, fpint, nrdata = [np.resize(data[n], nest) for n in [8,9,11,12]]

        args = data[:8] + (t,c,n,fpint,nrdata,data[13])
        data = dfitpack.fpcurf1(*args)
        return data
コード例 #3
0
ファイル: fitpack2.py プロジェクト: sprevrha/scipy-refactor
 def _reset_nest(self, data, nest=None):
     n = data[10]
     if nest is None:
         k, m = data[5], len(data[0])
         nest = m + k + 1  # this is the maximum bound for nest
     else:
         assert n <= nest, "nest can only be increased"
     t, c, fpint, nrdata = data[8].copy(), data[9].copy(), data[11].copy(), data[12].copy()
     t.resize(nest)
     c.resize(nest)
     fpint.resize(nest)
     nrdata.resize(nest)
     args = data[:8] + (t, c, n, fpint, nrdata, data[13])
     data = dfitpack.fpcurf1(*args)
     return data
コード例 #4
0
 def _reset_nest(self, data, nest=None):
     n = data[10]
     if nest is None:
         k,m = data[5],len(data[0])
         nest = m+k+1 # this is the maximum bound for nest
     else:
         assert n<=nest,"nest can only be increased"
     t,c,fpint,nrdata = data[8].copy(),data[9].copy(),\
                        data[11].copy(),data[12].copy()
     t.resize(nest)
     c.resize(nest)
     fpint.resize(nest)
     nrdata.resize(nest)
     args = data[:8] + (t,c,n,fpint,nrdata,data[13])
     data = dfitpack.fpcurf1(*args)
     return data
コード例 #5
0
ファイル: fitpack2.py プロジェクト: sprevrha/scipy-refactor
    def set_smoothing_factor(self, s):
        """ Continue spline computation with the given smoothing
        factor s and with the knots found at the last call.

        """
        data = self._data
        if data[6] == -1:
            warnings.warn("smoothing factor unchanged for" "LSQ spline with fixed knots")
            return
        args = data[:6] + (s,) + data[7:]
        data = dfitpack.fpcurf1(*args)
        if data[-1] == 1:
            # nest too small, setting to maximum bound
            data = self._reset_nest(data)
        self._data = data
        self._reset_class()
コード例 #6
0
    def set_smoothing_factor(self, s):
        """ Continue spline computation with the given smoothing
        factor s and with the knots found at the last call.

        """
        data = self._data
        if data[6] == -1:
            warnings.warn('smoothing factor unchanged for'
                          'LSQ spline with fixed knots')
            return
        args = data[:6] + (s, ) + data[7:]
        data = dfitpack.fpcurf1(*args)
        if data[-1] == 1:
            # nest too small, setting to maximum bound
            data = self._reset_nest(data)
        self._data = data
        self._reset_class()