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

Python mmio.mminfo函数代码示例

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

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



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

示例1: test_simple_rectangular_real

 def test_simple_rectangular_real(self):
     a = [[1,2],[3.5,4],[5,6]]
     fn = mktemp()
     mmwrite(fn,a)
     assert_equal(mminfo(fn),(3,2,6,'array','real','general'))
     b = mmread(fn)
     assert_array_almost_equal(a,b)
开发者ID:AndreI11,项目名称:SatStressGui,代码行数:7,代码来源:test_mmio.py


示例2: test_simple_skew_symmetric

 def test_simple_skew_symmetric(self):
     a = [[1,2],[-2,4]]
     fn = mktemp()
     mmwrite(fn,a)
     assert_equal(mminfo(fn),(2,2,4,'array','integer','skew-symmetric'))
     b = mmread(fn)
     assert_array_almost_equal(a,b)
开发者ID:AndreI11,项目名称:SatStressGui,代码行数:7,代码来源:test_mmio.py


示例3: test_simple_complex

 def test_simple_complex(self):
     a = [[1,2],[3,4j]]
     fn = mktemp()
     mmwrite(fn,a)
     assert_equal(mminfo(fn),(2,2,4,'array','complex','general'))
     b = mmread(fn)
     assert_array_almost_equal(a,b)
开发者ID:AndreI11,项目名称:SatStressGui,代码行数:7,代码来源:test_mmio.py


示例4: test_simple_hermitian

 def test_simple_hermitian(self):
     a = [[1, 2 + 3j], [2 - 3j, 4]]
     fn = self.fn
     mmwrite(fn, a)
     assert_equal(mminfo(fn), (2, 2, 4, "array", "complex", "hermitian"))
     b = mmread(fn)
     assert_array_almost_equal(a, b)
开发者ID:hainm,项目名称:scipy,代码行数:7,代码来源:test_mmio.py


示例5: test_simple_skew_symmetric_float

 def test_simple_skew_symmetric_float(self):
     a = array([[1,2],[-2.0,4]],'f')
     fn = mktemp()
     mmwrite(fn,a)
     assert_equal(mminfo(fn),(2,2,4,'array','real','skew-symmetric'))
     b = mmread(fn)
     assert_array_almost_equal(a,b)
开发者ID:AndreI11,项目名称:SatStressGui,代码行数:7,代码来源:test_mmio.py


示例6: test_simple_skew_symmetric

 def test_simple_skew_symmetric(self):
     a = [[1, 2], [-2, 4]]
     fn = self.fn
     mmwrite(fn, a)
     assert_equal(mminfo(fn), (2, 2, 4, "array", "integer", "skew-symmetric"))
     b = mmread(fn)
     assert_array_almost_equal(a, b)
开发者ID:hainm,项目名称:scipy,代码行数:7,代码来源:test_mmio.py


示例7: test_simple_skew_symmetric_float

 def test_simple_skew_symmetric_float(self):
     a = array([[1, 2], [-2.0, 4]], "f")
     fn = self.fn
     mmwrite(fn, a)
     assert_equal(mminfo(fn), (2, 2, 4, "array", "real", "skew-symmetric"))
     b = mmread(fn)
     assert_array_almost_equal(a, b)
开发者ID:hainm,项目名称:scipy,代码行数:7,代码来源:test_mmio.py


示例8: test_simple_rectangular_real

 def test_simple_rectangular_real(self):
     a = [[1, 2], [3.5, 4], [5, 6]]
     fn = self.fn
     mmwrite(fn, a)
     assert_equal(mminfo(fn), (3, 2, 6, "array", "real", "general"))
     b = mmread(fn)
     assert_array_almost_equal(a, b)
开发者ID:hainm,项目名称:scipy,代码行数:7,代码来源:test_mmio.py


示例9: test_simple_complex

 def test_simple_complex(self):
     a = [[1, 2], [3, 4j]]
     fn = self.fn
     mmwrite(fn, a)
     assert_equal(mminfo(fn), (2, 2, 4, "array", "complex", "general"))
     b = mmread(fn)
     assert_array_almost_equal(a, b)
开发者ID:hainm,项目名称:scipy,代码行数:7,代码来源:test_mmio.py


示例10: test_simple_rectangular

 def test_simple_rectangular(self):
     a = [[1, 2, 3], [4, 5, 6]]
     fn = self.fn
     mmwrite(fn, a)
     assert_equal(mminfo(fn), (2, 3, 6, "array", "integer", "general"))
     b = mmread(fn)
     assert_array_almost_equal(a, b)
开发者ID:hainm,项目名称:scipy,代码行数:7,代码来源:test_mmio.py


示例11: test_simple_hermitian

 def test_simple_hermitian(self):
     a = [[1,2+3j],[2-3j,4]]
     fn = mktemp()
     mmwrite(fn,a)
     assert_equal(mminfo(fn),(2,2,4,'array','complex','hermitian'))
     b = mmread(fn)
     assert_array_almost_equal(a,b)
开发者ID:AndreI11,项目名称:SatStressGui,代码行数:7,代码来源:test_mmio.py


示例12: check_read

 def check_read(self, example, a, info):
     f = open(self.fn, 'w')
     f.write(example)
     f.close()
     assert_equal(mminfo(self.fn), info)
     b = mmread(self.fn).todense()
     assert_array_almost_equal(a, b)
开发者ID:Kitchi,项目名称:scipy,代码行数:7,代码来源:test_mmio.py


示例13: test_simple_rectangular

 def test_simple_rectangular(self):
     a = [[1,2,3],[4,5,6]]
     fn = mktemp()
     mmwrite(fn,a)
     assert_equal(mminfo(fn),(2,3,6,'array','integer','general'))
     b = mmread(fn)
     assert_array_almost_equal(a,b)
开发者ID:AndreI11,项目名称:SatStressGui,代码行数:7,代码来源:test_mmio.py


示例14: test_simple_real

 def test_simple_real(self):
     a = [[1,2],[3,4.0]]
     fn = self.fn
     mmwrite(fn,a)
     assert_equal(mminfo(fn),(2,2,4,'array','real','general'))
     b = mmread(fn)
     assert_array_almost_equal(a,b)
开发者ID:hitej,项目名称:meta-core,代码行数:7,代码来源:test_mmio.py


示例15: test_random_rect_real

 def test_random_rect_real(self):
     sz = (20, 15)
     a = rand(*sz)
     fn = self.fn
     mmwrite(fn, a)
     assert_equal(mminfo(fn), (20, 15, 300, "array", "real", "general"))
     b = mmread(fn)
     assert_array_almost_equal(a, b)
开发者ID:hainm,项目名称:scipy,代码行数:8,代码来源:test_mmio.py


示例16: test_random_rect_real

 def test_random_rect_real(self):
     sz = (20,15)
     a = rand(*sz)
     fn = mktemp()
     mmwrite(fn,a)
     assert_equal(mminfo(fn),(20,15,300,'array','real','general'))
     b = mmread(fn)
     assert_array_almost_equal(a,b)
开发者ID:AndreI11,项目名称:SatStressGui,代码行数:8,代码来源:test_mmio.py


示例17: test_read_symmetric

 def test_read_symmetric(self):
     fn = self.fn
     f = open(fn, "w")
     f.write(_symmetric_example)
     f.close()
     assert_equal(mminfo(fn), (5, 5, 7, "coordinate", "real", "symmetric"))
     a = [[1, 0, 0, 0, 0], [0, 10.5, 0, 250.5, 0], [0, 0, 0.015, 0, 0], [0, 250.5, 0, -280, 8], [0, 0, 0, 8, 12]]
     b = mmread(fn).todense()
     assert_array_almost_equal(a, b)
开发者ID:hainm,项目名称:scipy,代码行数:9,代码来源:test_mmio.py


示例18: test_simple_pattern

 def test_simple_pattern(self):
     a = scipy.sparse.csr_matrix([[0, 1.5], [3.0, 2.5]])
     p = np.zeros_like(a.todense())
     p[a.todense() > 0] = 1
     info = (2, 2, 3, 'coordinate', 'pattern', 'general')
     mmwrite(self.fn, a, field='pattern')
     assert_equal(mminfo(self.fn), info)
     b = mmread(self.fn)
     assert_array_almost_equal(p, b.todense())
开发者ID:Kitchi,项目名称:scipy,代码行数:9,代码来源:test_mmio.py


示例19: test_read_symmetric_pattern

 def test_read_symmetric_pattern(self):
     fn = self.fn
     f = open(fn, "w")
     f.write(_symmetric_pattern_example)
     f.close()
     assert_equal(mminfo(fn), (5, 5, 7, "coordinate", "pattern", "symmetric"))
     a = [[1, 0, 0, 0, 0], [0, 1, 0, 1, 0], [0, 0, 1, 0, 0], [0, 1, 0, 1, 1], [0, 0, 0, 1, 1]]
     b = mmread(fn).todense()
     assert_array_almost_equal(a, b)
开发者ID:hainm,项目名称:scipy,代码行数:9,代码来源:test_mmio.py


示例20: test_random_symmetric_real

 def test_random_symmetric_real(self):
     sz = (20,20)
     a = rand(*sz)
     a = a + transpose(a)
     fn = mktemp()
     mmwrite(fn,a)
     assert_equal(mminfo(fn),(20,20,400,'array','real','symmetric'))
     b = mmread(fn)
     assert_array_almost_equal(a,b)
开发者ID:AndreI11,项目名称:SatStressGui,代码行数:9,代码来源:test_mmio.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python mmio.mmread函数代码示例发布时间:2022-05-27
下一篇:
Python streams.make_stream函数代码示例发布时间: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