[Python-ideas] [RFC] draft PEP: Dedicated infix operators for matrix multiplication and matrix power

Ethan Furman ethan at stoneleaf.us
Fri Mar 14 15:11:26 CET 2014


On 03/14/2014 04:25 AM, Robert Kern wrote:
>
> Some more from real code:
>
> RSR = R.dot(var_beta.dot(R.T))
> RSR = R @ var_beta @ R.T
>
> xx_inv.dot(xeps.dot(xx_inv))
> xx_inv @ xeps @ xx_inv
>
> dF2lower_dper.dot(F2lower.T) + F2lower.dot(dF2lower_dper.T) - 4/period*F2lower.dot(F2lower.T)
> dF2lower_dper @ F2lower.T + F2lower @ dF2lower_dper.T - 4/period*(F2lower @ F2lower.T)
>
> dFX_dper.dot(Gi.dot(FX2.T)) - FX.dot(Gi.dot(dG_dper.dot(Gi.dot(FX2.T)))) + FX.dot(Gi.dot(dFX2_dper.T))
> (dFX_dper @ Gi @ FX2.T) - (FX @ Gi @ dG_dper @ Gi @ FX2.T) + (FX @ G @ dFX2_dper.T)
>
> torient_inv.dot(tdof).dot(torient).dot(self.vertices[parent].meta['key']))
> (((torient_inv @ tdof) @ torient) @ self.vertices[parent].meta['key']

Arrgggghhhhhhh!! Uncle! Uncle!

+1!

--
~Ethan~


More information about the Python-ideas mailing list