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

Method reduce

maths/dual_number_automatic_differentiation.py:23–27  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

21 return f"{self.real}+{s}"
22
23 def reduce(self):
24 cur = self.duals.copy()
25 while cur[-1] == 0:
26 cur.pop(-1)
27 return Dual(self.real, cur)
28
29 def __add__(self, other):
30 if not isinstance(other, Dual):

Callers

nothing calls this directly

Calls 3

DualClass · 0.85
copyMethod · 0.80
popMethod · 0.45

Tested by

no test coverage detected