Example #1
0
 def __getattr__(self, attr):
     if attr == 'A':
         return squeeze(self.array)
     elif attr == 'T':
         return Matrix(Numeric.transpose(self.array))
     elif attr == 'H':
         if len(self.array.shape) == 1:
             self.array.shape = (1, self.array.shape[0])
         return Matrix(Numeric.conjugate(Numeric.transpose(self.array)))
     elif attr == 'I':
         return Matrix(LinearAlgebra.inverse(self.array))
     elif attr == 'real':
         return Matrix(self.array.real)
     elif attr == 'imag':
         return Matrix(self.array.imag)
     elif attr == 'flat':
         return Matrix(self.array.flat)
     else:
         raise AttributeError, attr + " not found."
Example #2
0
 def __getattr__(self, attr):
     if attr == 'A':
         return squeeze(self.array)
     elif attr == 'T':
         return Matrix(Numeric.transpose(self.array))
     elif attr == 'H':
         if len(self.array.shape) == 1:
             self.array.shape = (1,self.array.shape[0])
         return Matrix(Numeric.conjugate(Numeric.transpose(self.array)))
     elif attr == 'I':
         return Matrix(LinearAlgebra.inverse(self.array))
     elif attr == 'real':
         return Matrix(self.array.real)
     elif attr == 'imag':
         return Matrix(self.array.imag)
     elif attr == 'flat':
         return Matrix(self.array.flat)
     else:
         raise AttributeError, attr + " not found."
Example #3
0
 def __float__(self):
     return float(squeeze(self.array))
Example #4
0
 def __setslice__(self, i, j, value):
     self.array[i:j] = asarray(squeeze(value), self._typecode)
Example #5
0
 def __float__(self):
     return float(squeeze(self.array))
Example #6
0
    def __setslice__(self, i, j, value): self.array[i:j] = asarray(squeeze(value),self._typecode)

    def __float__(self):
Example #7
0
 def __setitem__(self, index, value):
     value = asarray(value, self._typecode)
     self.array[index] = squeeze(value)
Example #8
0
 def __setitem__(self, index, value):
     value = asarray(value, self._typecode)
     self.array[index] = squeeze(value)