コード例 #1
0
ファイル: test_blas.py プロジェクト: cshen/f2pypy
 def test_nrm2(self):
     for p in 'sd':
         f = getattr(fblas,p+'nrm2',None)
         if f is None: continue
         assert_almost_equal(f([3,-4,5]),math.sqrt(50))
     for p in ['c', 'z', 'sc','dz']:
         f = getattr(fblas,p+'nrm2',None)
         if f is None: continue
         assert_almost_equal(f([3j,-4,3-4j]),math.sqrt(50))
コード例 #2
0
ファイル: test_blas.py プロジェクト: cshen/f2pypy
 def test_asum(self):
     for p in 'sd':
         f = getattr(fblas,p+'asum',None)
         if f is None: continue
         assert_almost_equal(f([3,-4,5]),12)
     for p in ['sc','dz']:
         f = getattr(fblas,p+'asum',None)
         if f is None: continue
         assert_almost_equal(f([3j,-4,3-4j]),14)
コード例 #3
0
ファイル: test_blas.py プロジェクト: cshen/f2pypy
 def test_complex_dotc(self):
     for p in 'cz':
         f = getattr(fblas,p+'dotc',None)
         if f is None: continue
         assert_almost_equal(f([3j,-4,3-4j],[2,3j,1]),3-14j)
コード例 #4
0
ファイル: test_blas.py プロジェクト: cshen/f2pypy
 def test_dot(self):
     for p in 'sd':
         f = getattr(fblas,p+'dot',None)
         if f is None: continue
         assert_almost_equal(f([3,-4,5],[2,5,1]),-9)