MCPcopy Index your code
hub / github.com/geekcomputers/Python / test_norm_vector

Method test_norm_vector

linear-algebra-python/src/tests.py:154–157  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

152 )
153
154 def test_norm_vector(self):
155 x = Vector([1, 2, 3])
156 self.assertAlmostEqual(x.norm().component(0), (1 / math.sqrt(14)), 0.001)
157 self.assertAlmostEqual(x.norm().component(1), math.sqrt((2.0 / 7)), 0.001)
158
159 def test__eq__vector(self):
160 x = Vector([1, 2, 3])

Callers

nothing calls this directly

Calls 3

normMethod · 0.95
VectorClass · 0.85
componentMethod · 0.45

Tested by

no test coverage detected