2 GTSAM Copyright 2010-2021, Georgia Tech Research Corporation, 3 Atlanta, Georgia 30332-0415 6 See LICENSE for the license information 8 Unit tests for Discrete Priors. 17 from gtsam
import DecisionTreeFactor, DiscreteKeys, DiscreteDistribution
24 """Tests for Discrete Priors.""" 27 """Test various constructors.""" 41 self.assertAlmostEqual(
prior(0), 0.4)
42 self.assertAlmostEqual(
prior(1), 0.6)
46 expected = np.array([0.4, 0.6])
47 np.testing.assert_allclose(expected, prior.pmf())
51 actual = prior.sample()
52 self.assertIsInstance(actual, int)
55 """Test the _repr_markdown_ method.""" 58 expected =
" *P(0):*\n\n" \
64 actual = prior._repr_markdown_()
65 self.assertEqual(actual, expected)
68 if __name__ ==
"__main__":
Point2 prior(const Point2 &x)
Prior on a single pose.
def gtsamAssertEquals(self, actual, expected, tol=1e-9)
def test_constructor(self)
DiscreteKeys is a set of keys that can be assembled using the & operator.