Exemple #1
0
 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))
Exemple #2
0
 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)
Exemple #3
0
 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)
Exemple #4
0
 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)