MCPcopy Create free account
hub / github.com/subbarayudu-j/TheAlgorithms-Python / changeComponent

Method changeComponent

linear_algebra_python/src/lib.py:230–237  ·  view source on GitHub ↗

changes the x-y component of this matrix

(self,x,y, value)

Source from the content-addressed store, hash-verified

228 ans += str(self.__matrix[i][j]) + "|\n"
229 return ans
230 def changeComponent(self,x,y, value):
231 """
232 changes the x-y component of this matrix
233 """
234 if x >= 0 and x < self.__height and y >= 0 and y < self.__width:
235 self.__matrix[x][y] = value
236 else:
237 raise Exception ("changeComponent: indices out of bounds")
238 def component(self,x,y):
239 """
240 returns the specified (x,y) component

Callers 1

Calls

no outgoing calls

Tested by 1