def _delay_transpose(self, pre_post, op): assert len(pre_post) in (0, 1, 2) if len(pre_post) is 0: return op elif len(pre_post) is 1: return DelayedTranspose(pre_post[0]) * op else: return DelayedTranspose(pre_post[0]) * op * pre_post[1]
def __mul__(self, other): delayed_transpose = DelayedTranspose( self.basis_functions_matrix) return delayed_transpose * other
def transpose(arg): return DelayedTranspose(arg)