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

Method component

linear_algebra/src/lib.py:365–372  ·  view source on GitHub ↗

returns the specified (x,y) component

(self, x: int, y: int)

Source from the content-addressed store, hash-verified

363 return self.__width
364
365 def component(self, x: int, y: int) -> float:
366 """
367 returns the specified (x,y) component
368 """
369 if 0 <= x < self.__height and 0 <= y < self.__width:
370 return self.__matrix[x][y]
371 else:
372 raise Exception("change_component: indices out of bounds")
373
374 def change_component(self, x: int, y: int, value: float) -> None:
375 """

Callers 1

test_component_matrixMethod · 0.95

Calls

no outgoing calls

Tested by 1

test_component_matrixMethod · 0.76