00001 """
00002 Sub classes of LinearOperator that use Structures as base classes
00003 aswell
00004 """
00005
00006 __copyright__ = """
00007 Copyright 2008 Sean Ross-Ross
00008 """
00009 __license__ = """
00010 This file is part of SLIMpy .
00011
00012 SLIMpy is free software: you can redistribute it and/or modify
00013 it under the terms of the GNU Lesser General Public License as published by
00014 the Free Software Foundation, either version 3 of the License, or
00015 (at your option) any later version.
00016
00017 SLIMpy is distributed in the hope that it will be useful,
00018 but WITHOUT ANY WARRANTY; without even the implied warranty of
00019 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00020 GNU Lesser General Public License for more details.
00021
00022 You should have received a copy of the GNU Lesser General Public License
00023 along with SLIMpy . If not, see <http://www.gnu.org/licenses/>.
00024 """
00025
00026 from slimpy_base.Core.Interface.Structure import Structure
00027 from slimpy_base.Core.Interface.AbstractDataInterface import ADI
00028 from slimpy_base.Core.User.linop.linear_operator import LinearOperator
00029
00030
00031 class linearop_r( Structure, LinearOperator ):
00032 """
00033 The base linear operator object should not be called by itself.
00034 """
00035 name = "linearop_r"
00036 def __init__( self, inspace, *params, **kparams ):
00037
00038 Structure.__init__( self )
00039 outspace = inspace.testCommand( self.name, *params, **kparams )
00040
00041 LinearOperator.__init__( self, inspace, outspace, *params, **kparams )
00042
00043
00044 def applyop( self, other ):
00045
00046 return self.generateNew( other, self.name , *self.params, **self.kparams )
00047
00048
00049 class linearop_c( LinearOperator, ADI ):
00050 """
00051 The base linear operator object should not be called by itself.
00052 """
00053 name = "linearop_c"
00054 def __init__( self, data, inSpace, outSpace, *params, **kparams ):
00055
00056 ADI.__init__( self, data )
00057 LinearOperator.__init__( self, inSpace, outSpace, *params, **kparams )
00058
00059 def applyop( self, other ):
00060 """
00061 apply
00062 """
00063 return other.generateNew( self.name, *self.params, **self.kparams )
00064
00065 def __mul__( self, other ):
00066 return LinearOperator.__mul__( self, other )
00067
00068