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

Method norm

linear-algebra-python/src/lib.py:172–180  ·  view source on GitHub ↗

normalizes this vector and returns it.

(self)

Source from the content-addressed store, hash-verified

170 self.__components[pos] = value
171
172 def norm(self):
173 """
174 normalizes this vector and returns it.
175 """
176 eLength = self.eulidLength()
177 quotient = 1.0 / eLength
178 for i in range(len(self.__components)):
179 self.__components[i] = self.__components[i] * quotient
180 return self
181
182 def __eq__(self, other):
183 """

Callers 4

test_norm_vectorMethod · 0.95
stepMethod · 0.80
forwardMethod · 0.80
forwardMethod · 0.80

Calls 1

eulidLengthMethod · 0.95

Tested by 1

test_norm_vectorMethod · 0.76