Skip to content

Commit 97acdfb

Browse files
committed
Update: add test
1 parent 4c6363d commit 97acdfb

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

test/b/test_b_jax.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from uncertaintyx.b.jax import b_basis
1111
from uncertaintyx.b.jax import b_poly
1212
from uncertaintyx.b.jax import b_poly_grid
13+
from uncertaintyx.b.jax import b_poly_point
1314
from uncertaintyx.b.jax import b_poly_points
1415

1516

@@ -201,6 +202,16 @@ class BPolyPointsTest(unittest.TestCase):
201202
against values precalculated with Mathematica.
202203
"""
203204

205+
def test_b_poly_point(self):
206+
k = (4, 3, 2)
207+
d = tuple([k_ + 1 for k_ in k])
208+
b = jnp.arange(jnp.prod(jnp.asarray(d))).reshape(d) + 1.0
209+
x = jnp.asarray([0.2718, 0.5772, 0.3141])
210+
y = b_poly_point(b, x)
211+
precalculated = 19.8694
212+
self.assertEqual((), y.shape)
213+
self.assertTrue(jnp.allclose(y, precalculated))
214+
204215
def test_b_poly_points(self):
205216
k = (4, 3, 2)
206217
d = tuple([k_ + 1 for k_ in k])

0 commit comments

Comments
 (0)