Matlab vs Python (was RE: Discussion: Introducing new operators
hzhu at localhost.localdomain.bbs
hzhu at localhost.localdomain.bbs
Mon Jul 17 21:20:03 EDT 2000
More information about the Python-list mailing list
Mon Jul 17 21:20:03 EDT 2000
- Previous message (by thread): Matlab vs Python (was RE: Discussion: Introducing new operators
- Next message (by thread): hexidecimal output as default?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Mon, 17 Jul 2000 19:22:31 -0500, Paul Prescod <paul at prescod.net> wrote: >I don't think you need __getattr__ > >class Matrix: > def __init__( self, ....): > self.T=Transpose( self ) > self.H=Hermitian( self ) > self.I=Inverse( self ) > self.C=Conjugate( self ) > self.E=Elementwise( self ) > self.M=self # matrixwise is default > ... other matrix-like methods ... > >class Transpose: > def __init__( self, mymatrix ): > self.mymatrix=mymatrix > ... other matrix-like methods, but transposed ... > >Notice that no computation (e.g. actual transposition) needs to be done >until you actually need to calculate a value. Maybe you can find >optimizations that allow only tiny parts of matrices to be computed. This is interesting. I suppose the computational cost is minimum. What about implementation? Do I have to write everything five times? Right now I'm even using .T() to avoid writing both left and right computations. It cost some computation but saves a lot of implementation and maintainence. Note that even one liners are relatively big cost because most of the current functions are just one liners. Huaiyu
- Previous message (by thread): Matlab vs Python (was RE: Discussion: Introducing new operators
- Next message (by thread): hexidecimal output as default?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list