<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def inv(self):
 """In place invert"""

        self.v = 1/self.v
        tmp = self.v**2
        if self.deriv > 1:
            self.dd[:] = tmp*(2*self.v*np.outer(self.d, self.d) - self.dd)
        if self.deriv > 0:
            self.d[:] = -tmp*self.d[:]