本文整理汇总了Python中scipy.io.mmio.mminfo函数的典型用法代码示例。如果您正苦于以下问题:Python mminfo函数的具体用法?Python mminfo怎么用?Python mminfo使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了mminfo函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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)
示例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)
示例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)
示例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)
示例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)
示例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)
示例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)
示例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)
示例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)
示例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)
示例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)
示例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)
示例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)
示例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)
示例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)