• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python interpolate.KroghInterpolator类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中scipy.interpolate.KroghInterpolator的典型用法代码示例。如果您正苦于以下问题:Python KroghInterpolator类的具体用法?Python KroghInterpolator怎么用?Python KroghInterpolator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了KroghInterpolator类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: test_shapes_scalarvalue_derivative

 def test_shapes_scalarvalue_derivative(self):
     P = KroghInterpolator(self.xs,self.ys)
     n = P.n
     assert_array_equal(np.shape(P.derivatives(0)), (n,))
     assert_array_equal(np.shape(P.derivatives(np.array(0))), (n,))
     assert_array_equal(np.shape(P.derivatives([0])), (n,1))
     assert_array_equal(np.shape(P.derivatives([0,1])), (n,2))
开发者ID:hitej,项目名称:meta-core,代码行数:7,代码来源:test_polyint.py


示例2: test_wrapper

 def test_wrapper(self):
     P = KroghInterpolator(self.xs, self.ys)
     assert_almost_equal(P(self.test_xs), krogh_interpolate(self.xs, self.ys, self.test_xs))
     assert_almost_equal(P.derivative(self.test_xs, 2), krogh_interpolate(self.xs, self.ys, self.test_xs, der=2))
     assert_almost_equal(
         P.derivatives(self.test_xs, 2), krogh_interpolate(self.xs, self.ys, self.test_xs, der=[0, 1])
     )
开发者ID:BioSoundSystems,项目名称:scipy,代码行数:7,代码来源:test_polyint.py


示例3: test_int_inputs

    def test_int_inputs(self):
        # Check input args are cast correctly to floats, gh-3669
        x = [0, 234,468,702,936,1170,1404,2340,3744,6084,8424,13104,60000]
        offset_cdf = np.array([-0.95, -0.86114777, -0.8147762, -0.64072425, -0.48002351,
                               -0.34925329, -0.26503107, -0.13148093, -0.12988833, -0.12979296,
                               -0.12973574, -0.08582937, 0.05])
        f = KroghInterpolator(x, offset_cdf)

        assert_allclose(abs((f(x) - offset_cdf) / f.derivative(x, 1)), 0, atol=1e-10)
开发者ID:BiosPsucheZoe,项目名称:scipy,代码行数:9,代码来源:test_polyint.py


示例4: test_derivatives_complex

    def test_derivatives_complex(self):
        # regression test for gh-7381: krogh.derivatives(0) fails complex y
        x, y = np.array([-1, -1, 0, 1, 1]), np.array([1, 1.0j, 0, -1, 1.0j])
        func = KroghInterpolator(x, y)
        cmplx = func.derivatives(0)

        cmplx2 = (KroghInterpolator(x, y.real).derivatives(0) +
                  1j*KroghInterpolator(x, y.imag).derivatives(0))
        assert_allclose(cmplx, cmplx2, atol=1e-15)
开发者ID:ElDeveloper,项目名称:scipy,代码行数:9,代码来源:test_polyint.py


示例5: test_vector

 def test_vector(self):
     xs = [0, 1, 2]
     ys = np.array([[0, 1], [1, 0], [2, 1]])
     P = KroghInterpolator(xs, ys)
     Pi = [KroghInterpolator(xs, ys[:, i]) for i in xrange(ys.shape[1])]
     test_xs = np.linspace(-1, 3, 100)
     assert_almost_equal(P(test_xs), np.rollaxis(np.asarray([p(test_xs) for p in Pi]), -1))
     assert_almost_equal(
         P.derivatives(test_xs), np.transpose(np.asarray([p.derivatives(test_xs) for p in Pi]), (1, 2, 0))
     )
开发者ID:BioSoundSystems,项目名称:scipy,代码行数:10,代码来源:test_polyint.py


示例6: test_shapes_vectorvalue_derivative

 def test_shapes_vectorvalue_derivative(self):
     P = KroghInterpolator(self.xs,np.outer(self.ys,np.arange(3)))
     n = P.n
     assert_array_equal(np.shape(P.derivatives(0)), (n,3))
     assert_array_equal(np.shape(P.derivatives([0])), (n,1,3))
     assert_array_equal(np.shape(P.derivatives([0,1])), (n,2,3))
开发者ID:hitej,项目名称:meta-core,代码行数:6,代码来源:test_polyint.py


示例7: test_high_derivative

 def test_high_derivative(self):
     P = KroghInterpolator(self.xs,self.ys)
     for i in xrange(len(self.xs),2*len(self.xs)):
         assert_almost_equal(P.derivative(self.test_xs,i),
                             np.zeros(len(self.test_xs)))
开发者ID:hitej,项目名称:meta-core,代码行数:5,代码来源:test_polyint.py


示例8: test_derivative

 def test_derivative(self):
     P = KroghInterpolator(self.xs,self.ys)
     m = 10
     r = P.derivatives(self.test_xs,m)
     for i in xrange(m):
         assert_almost_equal(P.derivative(self.test_xs,i),r[i])
开发者ID:hitej,项目名称:meta-core,代码行数:6,代码来源:test_polyint.py


示例9: test_low_derivatives

 def test_low_derivatives(self):
     P = KroghInterpolator(self.xs,self.ys)
     D = P.derivatives(self.test_xs,len(self.xs)+2)
     for i in xrange(D.shape[0]):
         assert_almost_equal(self.true_poly.deriv(i)(self.test_xs),
                             D[i])
开发者ID:hitej,项目名称:meta-core,代码行数:6,代码来源:test_polyint.py



注:本文中的scipy.interpolate.KroghInterpolator类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python interpolate.PPoly类代码示例发布时间:2022-05-27
下一篇:
Python interpolate.BarycentricInterpolator类代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap