Esempio n. 1
0
 def test_weight_matrix(self):
     x = np.arange(10)
     rbf = nd.RBF(basis='beckert_wendland_c2_basis', radius=1.)
     weights_matrix = rbf.weights_matrix(X1=x, X2=x)
     expected = np.diag(np.ones(10))
     np.testing.assert_array_equal(weights_matrix, expected)
Esempio n. 2
0
 def test_wendland_evaluation(self):
     rbf = nd.RBF(basis='beckert_wendland_c2_basis', radius=1.)
     result = rbf.basis(X=1., r=2.)
     assert result == 0.1875
Esempio n. 3
0
 def test_wendland_outside_cutoff(self):
     rbf = nd.RBF(basis='beckert_wendland_c2_basis', radius=1.)
     result = rbf.basis(X=2., r=1.)
     assert result == 0.0
Esempio n. 4
0
 def test_inv_biharmonic_evaluation(self):
     rbf = nd.RBF(basis='inv_multi_quadratic_biharmonic_spline', radius=1.)
     result = rbf.basis(X=1., r=1.)
     assert result == 0.7071067811865475
Esempio n. 5
0
 def test_thin_plate_evaluation(self):
     rbf = nd.RBF(basis='thin_plate_spline', radius=1.)
     result = rbf.basis(X=1., r=0.5)
     assert result == 2.772588722239781
Esempio n. 6
0
 def test_gaussian_evaluation(self):
     rbf = nd.RBF(basis='gaussian_spline', radius=1.)
     result = rbf.basis(X=1., r=1.)
     assert result == 0.36787944117144233
Esempio n. 7
0
 def test_biharmonic_evaluation(self):
     rbf = nd.RBF(basis='multi_quadratic_biharmonic_spline', radius=1.)
     result = rbf.basis(X=1., r=1.)
     assert result == 1.4142135623730951
Esempio n. 8
0
 def test_wrong_basis(self):
     with self.assertRaises(NameError):
         rbf = nd.RBF(basis='wendland', radius=1.)
Esempio n. 9
0
 def test_radius_member(self):
     rbf = nd.RBF(basis='beckert_wendland_c2_basis', radius=1.)
     assert rbf.radius == 1.0
Esempio n. 10
0
 def test_thin_plate_basis_member(self):
     rbf = nd.RBF(basis='thin_plate_spline', radius=1.)
     assert rbf.basis == rbf.thin_plate_spline
Esempio n. 11
0
 def test_inv_biharmonic_basis_member(self):
     rbf = nd.RBF(basis='inv_multi_quadratic_biharmonic_spline', radius=1.)
     assert rbf.basis == rbf.inv_multi_quadratic_biharmonic_spline
Esempio n. 12
0
 def test_gaussian_basis_member(self):
     rbf = nd.RBF(basis='gaussian_spline', radius=1.)
     assert rbf.basis == rbf.gaussian_spline