def mul(self, matrix):
'''Multiply this matrix by `matrix`
The order of operation is: `this @ matrix`.
*Parameters:*
- `matrix`: `Matrix4`
'''
# Make a matrix4 shape to matmul function
view1 = np.reshape(self._values, (4, 4))
view2 = np.reshape(matrix.values, (4, 4))
self.tmp.shape = (4, 4)
# np.matmul(view2, view1, out=out)
np.matmul(view2, view1, out=self.tmp)
self.tmp.shape = (16,)
self._values[:] = self.tmp
return self
评论列表
文章目录