def test_padb_3(self):
     """Test function for padb() 3/3"""
     # empty matrix array
     tr = padb(self.tv3, n=25, val=1.5)
     res = np.vstack((self.tv3.reshape((-1, 1)), 1.5*np.ones((25, 1))))
     self.assertTrue(np.allclose(tr, res, atol=1e-8, rtol=1e-5))
 def test_padb_2(self):
     """Test function for padb() 2/3"""
     # 1-d array
     tr = padb(self.tv2, n=25, val=1.5)
     res = np.vstack((self.tv2.reshape((-1, 1)), 1.5*np.ones((15, 1))))
     self.assertTrue(np.allclose(tr, res, atol=1e-8, rtol=1e-5))
 def test_padb_1(self):
     """Test function for padb() 1/3"""
     # regular matrix
     tr = padb(self.tv1, n=25, val=2)
     res = np.concatenate((self.tv1, 2.*np.ones((10, 15))), axis=0)
     self.assertTrue(np.allclose(tr, res, atol=1e-8, rtol=1e-5))
Example #4
0
 def test_padb_3(self):
     """Test function for padb() 3/3"""
     # empty matrix array
     tr = padb(self.tv3, n=25, val=1.5)
     res = np.vstack((self.tv3.reshape((-1, 1)), 1.5 * np.ones((25, 1))))
     self.assertTrue(np.allclose(tr, res, atol=1e-8, rtol=1e-5))
Example #5
0
 def test_padb_2(self):
     """Test function for padb() 2/3"""
     # 1-d array
     tr = padb(self.tv2, n=25, val=1.5)
     res = np.vstack((self.tv2.reshape((-1, 1)), 1.5 * np.ones((15, 1))))
     self.assertTrue(np.allclose(tr, res, atol=1e-8, rtol=1e-5))
Example #6
0
 def test_padb_1(self):
     """Test function for padb() 1/3"""
     # regular matrix
     tr = padb(self.tv1, n=25, val=2)
     res = np.concatenate((self.tv1, 2. * np.ones((10, 15))), axis=0)
     self.assertTrue(np.allclose(tr, res, atol=1e-8, rtol=1e-5))