def test_create_matrix33_view( self ): mat = matrix44.create_identity() result = matrix44.create_matrix33_view( mat ) expected = numpy.eye( 3 ) self.assertTrue( numpy.array_equal( result, expected ), "Matrix44 create_matrix33_view incorrect" )
def test_create_matrix33_view( self ): mat = matrix44.create_identity() result = matrix44.create_matrix33_view(mat) np.testing.assert_almost_equal(result, mat[:3,:3], decimal=5) mat[0,0] = 2. np.testing.assert_almost_equal(result, mat[:3,:3], decimal=5)
def test_create_matrix33_view(self): mat = matrix44.create_identity() result = matrix44.create_matrix33_view(mat) np.testing.assert_almost_equal(result, mat[:3, :3], decimal=5) mat[0, 0] = 2. np.testing.assert_almost_equal(result, mat[:3, :3], decimal=5)