コード例 #1
0
ファイル: test_polyint.py プロジェクト: huard/scipy-work
 def test_derivatives(self):
     P = PiecewisePolynomial(self.xi, self.yi, 3)
     m = 4
     r = P.derivatives(self.test_xs, m)
     # print r.shape, r
     for i in xrange(m):
         assert_almost_equal(P.derivative(self.test_xs, i), r[i])
コード例 #2
0
 def test_derivatives(self):
     P = PiecewisePolynomial(self.xi, self.yi, 3)
     m = 4
     r = P.derivatives(self.test_xs, m)
     #print r.shape, r
     for i in xrange(m):
         assert_almost_equal(P.derivative(self.test_xs, i), r[i])
コード例 #3
0
ファイル: test_polyint.py プロジェクト: huard/scipy-work
 def test_wrapper(self):
     P = PiecewisePolynomial(self.xi, self.yi)
     assert_almost_equal(P(self.test_xs), piecewise_polynomial_interpolate(self.xi, self.yi, self.test_xs))
     assert_almost_equal(
         P.derivative(self.test_xs, 2), piecewise_polynomial_interpolate(self.xi, self.yi, self.test_xs, der=2)
     )
     assert_almost_equal(
         P.derivatives(self.test_xs, 2), piecewise_polynomial_interpolate(self.xi, self.yi, self.test_xs, der=[0, 1])
     )
コード例 #4
0
ファイル: test_polyint.py プロジェクト: hitej/meta-core
    def test_derivatives(self):
        with warnings.catch_warnings():
            warnings.filterwarnings('ignore', category=DeprecationWarning)
            P = PiecewisePolynomial(self.xi,self.yi,3)

        m = 4
        r = P.derivatives(self.test_xs,m)
        #print r.shape, r
        for i in xrange(m):
            assert_almost_equal(P.derivative(self.test_xs,i),r[i])
コード例 #5
0
ファイル: test_polyint.py プロジェクト: monker490/WordVec
    def test_derivatives(self):
        with warnings.catch_warnings():
            warnings.filterwarnings('ignore', category=DeprecationWarning)
            P = PiecewisePolynomial(self.xi, self.yi, 3)

        m = 4
        r = P.derivatives(self.test_xs, m)
        #print r.shape, r
        for i in xrange(m):
            assert_almost_equal(P.derivative(self.test_xs, i), r[i])
コード例 #6
0
ファイル: test_polyint.py プロジェクト: BioSoundSystems/scipy
    def test_wrapper(self):
        with warnings.catch_warnings():
            warnings.filterwarnings("ignore", category=DeprecationWarning)
            P = PiecewisePolynomial(self.xi, self.yi)

        assert_almost_equal(P(self.test_xs), piecewise_polynomial_interpolate(self.xi, self.yi, self.test_xs))
        assert_almost_equal(
            P.derivative(self.test_xs, 2), piecewise_polynomial_interpolate(self.xi, self.yi, self.test_xs, der=2)
        )
        assert_almost_equal(
            P.derivatives(self.test_xs, 2), piecewise_polynomial_interpolate(self.xi, self.yi, self.test_xs, der=[0, 1])
        )
コード例 #7
0
 def test_wrapper(self):
     P = PiecewisePolynomial(self.xi, self.yi)
     assert_almost_equal(
         P(self.test_xs),
         piecewise_polynomial_interpolate(self.xi, self.yi, self.test_xs))
     assert_almost_equal(
         P.derivative(self.test_xs, 2),
         piecewise_polynomial_interpolate(self.xi,
                                          self.yi,
                                          self.test_xs,
                                          der=2))
     assert_almost_equal(
         P.derivatives(self.test_xs, 2),
         piecewise_polynomial_interpolate(self.xi,
                                          self.yi,
                                          self.test_xs,
                                          der=[0, 1]))
コード例 #8
0
ファイル: test_polyint.py プロジェクト: yaokaifei/scipy
    def test_wrapper(self):
        with warnings.catch_warnings():
            warnings.filterwarnings('ignore', category=DeprecationWarning)
            P = PiecewisePolynomial(self.xi,self.yi)

        assert_almost_equal(P(self.test_xs),
                            piecewise_polynomial_interpolate(self.xi, self.yi,
                                                             self.test_xs))
        assert_almost_equal(P.derivative(self.test_xs,2),
                            piecewise_polynomial_interpolate(self.xi,
                                                             self.yi,
                                                             self.test_xs,
                                                             der=2))
        assert_almost_equal(P.derivatives(self.test_xs,2),
                            piecewise_polynomial_interpolate(self.xi,
                                                             self.yi,
                                                             self.test_xs,
                                                             der=[0,1]))