00001 __copyright__ = """ 00002 Copyright 2008 Sean Ross-Ross 00003 """ 00004 __license__ = """ 00005 This file is part of SLIMpy . 00006 00007 SLIMpy is free software: you can redistribute it and/or modify 00008 it under the terms of the GNU Lesser General Public License as published by 00009 the Free Software Foundation, either version 3 of the License, or 00010 (at your option) any later version. 00011 00012 SLIMpy is distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 GNU Lesser General Public License for more details. 00016 00017 You should have received a copy of the GNU Lesser General Public License 00018 along with SLIMpy . If not, see <http://www.gnu.org/licenses/>. 00019 """ 00020 00021 # 00022 #""" 00023 # 00024 # 00025 #""" 00026 # 00027 # 00028 #from numpy import ndarray,array 00029 #from slimpy_base.Core.User.linop.linear_operator import linearop 00030 # 00031 #class aug_matrix(object): 00032 # """ 00033 # the augmented matrix class is used to append linear operators 00034 # or vectors togeter to create a larger vector or operator 00035 # 00036 # """ 00037 # def __init__(self,x): 00038 # 00039 # self.x = array(x) 00040 # 00041 # self.N = len(self.x[0]) 00042 # self.M = len(self.x) 00043 # 00044 # 00045 # 00046 # def transp(self): 00047 # return aug_matrix( self.x.transpose() ) 00048 # 00049 # def __mul__(self,other): 00050 # return aug_matrix( self.x.__mul__(other) ) 00051 # 00052 # def __add__(self,other): 00053 # return aug_matrix( self.x.__add__(other) ) 00054 # 00055 # def __radd__(self,other): 00056 # return aug_matrix( self.x.__radd__(other) ) 00057 # def __sub__(self,other): 00058 # return aug_matrix( self.x.__sub__(other) ) 00059 # def __rsub__(self,other): 00060 # return aug_matrix( self.x.__rsub__(other) ) 00061 # def __pow__(self,other): 00062 # return aug_matrix( self.x.__pow__(other) ) 00063 # 00064 # def __abs__(self): 00065 # return aug_matrix( self.x.__abs__() ) 00066 # 00067 # def __len__(self): 00068 # return aug_matrix( self.x.__len__() ) 00069 # 00070 # 00071 #class aug_oper(aug_matrix,linearop ): 00072 # """ 00073 # The reason for sub classing the aug_oper is to define how it acts when it is applied. ie. the '*' symbol. 00074 # aug_oper overloads '*' to perform matrix multiplication on the other aug_matrix 00075 # """ 00076 # def __init__(self,x): 00077 # aug_matrix.__init__(self,x) 00078 # def __mul__(self,other): 00079 # if not isinstance(other, aug_matrix): 00080 # return self.elementop(other,'__mul__') 00081 # 00082 # if self.N is not other.M: 00083 # raise Exception 00084 # 00085 # result = aug_matrix.create(other.N,self.M) 00086 # for i in range(0,other.N): 00087 # for j in range(0,self.M): 00088 # result[j][i] = __sum(__prod( self.row(j), other.coloum(i) )) 00089 # 00090 # return aug_matrix(result) 00091 # 00092 #class aug_vec(aug_matrix): 00093 # """ 00094 # The default * operation for aug_vec is to perform an element wise operation on the vectors 00095 # contained within. 00096 # """ 00097 # def __init__(self,x): 00098 # aug_matrix.__init__(self,x) 00099 # 00100 # 00101 # 00102 # 00103 # 00104 #