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

Method component

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

input: index (start at 0) output: the i-th component of the vector.

(self, i)

Source from the content-addressed store, hash-verified

79 return ans
80
81 def component(self, i):
82 """
83 input: index (start at 0)
84 output: the i-th component of the vector.
85 """
86 if i < len(self.__components) and i >= 0:
87 return self.__components[i]
88 else:
89 raise Exception("index out of range")
90
91 def size(self):
92 """

Callers 12

test_componentMethod · 0.95
test_addMethod · 0.45
test_subMethod · 0.45
test_norm_vectorMethod · 0.45
__add__Method · 0.45
__sub__Method · 0.45
__mul__Method · 0.45
__eq__Method · 0.45
__mul__Method · 0.45
__add__Method · 0.45
__sub__Method · 0.45
__eq__Method · 0.45

Calls

no outgoing calls

Tested by 4

test_componentMethod · 0.76
test_addMethod · 0.36
test_subMethod · 0.36
test_norm_vectorMethod · 0.36