Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_t_ddot(self):
vec = lambda *args: np.array(args)[np.newaxis,:,np.newaxis]
T = lambda x: x.transpose((0,2,1))
stack_mats = lambda *args: np.vstack([a[np.newaxis,...] for a in args])
self.assertMatrixEqual( \
primitives.ddot_t_right( \
T(np.vstack([vec(1,2), vec(3,4), vec(5,6)])),
stack_mats(np.eye(2)*1, np.array([[2,0],[1,1]]), np.eye(2)*3)), \
T(np.vstack([vec(1,2), vec(6, 7), vec(15, 18)])))