Example #1
0
 def test_all(self):
     dims = [(),(1,),(1,1)]
     for dim1 in dims:
         for dim2 in dims:
             arg1 = rand(*dim1)
             arg2 = rand(*dim2)
             c1 = dot(arg1, arg2)
             c2 = dot_(arg1, arg2)
             assert (c1.shape == c2.shape)
             assert_almost_equal(c1, c2, decimal=self.N)
Example #2
0
 def check_all(self):
     dims = [(),(1,),(1,1)]
     for dim1 in dims:
         for dim2 in dims:
             arg1 = rand(*dim1)
             arg2 = rand(*dim2)
             c1 = dot(arg1, arg2)
             c2 = dot_(arg1, arg2)
             assert (c1.shape == c2.shape)
             assert_almost_equal(c1, c2, decimal=self.N)
Example #3
0
 def check_columnvect(self):
     b1 = ones((3,1)).transpose()
     b2 = [6.2]
     c1 = dot(b2,b1)
     c2 = dot_(b2,b1)
     assert_almost_equal(c1, c2, decimal=self.N)
Example #4
0
 def test_columnvect2(self):
     b1 = ones((3,1)).transpose()
     b2 = [6.2]
     c1 = dot(b2,b1)
     c2 = dot_(b2,b1)
     assert_almost_equal(c1, c2, decimal=self.N)
Example #5
0
 def check_vecvecouter(self):
     b1, b3 = self.b1, self.b3
     c1 = dot(b1, b3)
     c2 = dot_(b1, b3)
     assert_almost_equal(c1, c2, decimal=self.N)
Example #6
0
 def check_vecvecinner(self):
     b1, b3 = self.b1, self.b3
     c1 = dot(b3, b1)
     c2 = dot_(b3, b1)
     assert_almost_equal(c1, c2, decimal=self.N)
Example #7
0
 def check_vecmat2(self):
     b3, A = self.b3, self.A
     c1 = dot(b3, A.transpose())
     c2 = dot_(b3, A.transpose())
     assert_almost_equal(c1, c2, decimal=self.N)
Example #8
0
 def check_matvec2(self):
     A, b2 = self.A, self.b2
     c1 = dot(A, b2)
     c2 = dot_(A, b2)
     assert_almost_equal(c1, c2, decimal=self.N)
Example #9
0
 def check_matmat(self):
     A = self.A
     c1 = dot(A.transpose(), A)
     c2 = dot_(A.transpose(), A)
     assert_almost_equal(c1, c2, decimal=self.N)
Example #10
0
 def test_vecmat(self):
     A, b4 = self.A, self.b4
     c1 = dot(b4, A)
     c2 = dot_(b4, A)
     assert_almost_equal(c1, c2, decimal=self.N)
Example #11
0
 def test_matvec2(self):
     A, b2 = self.A, self.b2
     c1 = dot(A, b2)
     c2 = dot_(A, b2)
     assert_almost_equal(c1, c2, decimal=self.N)
Example #12
0
 def test_matvec(self):
     A, b1 = self.A, self.b1
     c1 = dot(A, b1)
     c2 = dot_(A, b1)
     assert_almost_equal(c1, c2, decimal=self.N)
Example #13
0
 def test_matmat(self):
     A = self.A
     c1 = dot(A.transpose(), A)
     c2 = dot_(A.transpose(), A)
     assert_almost_equal(c1, c2, decimal=self.N)
Example #14
0
 def test_vecscalar2(self):
     b1 = rand(8,1)
     b2 = rand(1,1)
     c1 = dot(b1,b2)
     c2 = dot_(b1,b2)
     assert_almost_equal(c1, c2, decimal=self.N)
Example #15
0
 def test_vecscalar(self):
     b1 = rand(1,1)
     b2 = rand(1,8)
     c1 = dot(b1,b2)
     c2 = dot_(b1,b2)
     assert_almost_equal(c1, c2, decimal=self.N)
Example #16
0
 def check_vecscalar2(self):
     b1 = rand(8,1)
     b2 = rand(1,1)
     c1 = dot(b1,b2)
     c2 = dot_(b1,b2)
     assert_almost_equal(c1, c2, decimal=self.N)
Example #17
0
 def test_vecmat2(self):
     b3, A = self.b3, self.A
     c1 = dot(b3, A.transpose())
     c2 = dot_(b3, A.transpose())
     assert_almost_equal(c1, c2, decimal=self.N)
Example #18
0
 def test_vecmat3(self):
     A, b4 = self.A, self.b4
     c1 = dot(A.transpose(),b4)
     c2 = dot_(A.transpose(),b4)
     assert_almost_equal(c1, c2, decimal=self.N)
Example #19
0
 def check_matvec(self):
     A, b1 = self.A, self.b1
     c1 = dot(A, b1)
     c2 = dot_(A, b1)
     assert_almost_equal(c1, c2, decimal=self.N)
Example #20
0
 def test_vecvecouter(self):
     b1, b3 = self.b1, self.b3
     c1 = dot(b1, b3)
     c2 = dot_(b1, b3)
     assert_almost_equal(c1, c2, decimal=self.N)
Example #21
0
 def check_vecmat(self):
     A, b4 = self.A, self.b4
     c1 = dot(b4, A)
     c2 = dot_(b4, A)
     assert_almost_equal(c1, c2, decimal=self.N)
Example #22
0
 def test_vecvecinner(self):
     b1, b3 = self.b1, self.b3
     c1 = dot(b3, b1)
     c2 = dot_(b3, b1)
     assert_almost_equal(c1, c2, decimal=self.N)
Example #23
0
 def check_vecmat3(self):
     A, b4 = self.A, self.b4
     c1 = dot(A.transpose(),b4)
     c2 = dot_(A.transpose(),b4)
     assert_almost_equal(c1, c2, decimal=self.N)
Example #24
0
 def test_columnvect1(self):
     b1 = ones((3,1))
     b2 = [5.3]
     c1 = dot(b1,b2)
     c2 = dot_(b1,b2)
     assert_almost_equal(c1, c2, decimal=self.N)
Example #25
0
 def check_columnvect(self):
     b1 = ones((3,1))
     b2 = [5.3]
     c1 = dot(b1,b2)
     c2 = dot_(b1,b2)
     assert_almost_equal(c1, c2, decimal=self.N)
Example #26
0
 def check_vecscalar(self):
     b1 = rand(1,1)
     b2 = rand(1,8)
     c1 = dot(b1,b2)
     c2 = dot_(b1,b2)
     assert_almost_equal(c1, c2, decimal=self.N)