00001 """
00002 Some more Linear operators
00003 """
00004
00005 __copyright__ = """
00006 Copyright 2008 Sean Ross-Ross
00007 """
00008 __license__ = """
00009 This file is part of SLIMpy .
00010
00011 SLIMpy is free software: you can redistribute it and/or modify
00012 it under the terms of the GNU Lesser General Public License as published by
00013 the Free Software Foundation, either version 3 of the License, or
00014 (at your option) any later version.
00015
00016 SLIMpy is distributed in the hope that it will be useful,
00017 but WITHOUT ANY WARRANTY; without even the implied warranty of
00018 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00019 GNU Lesser General Public License for more details.
00020
00021 You should have received a copy of the GNU Lesser General Public License
00022 along with SLIMpy . If not, see <http://www.gnu.org/licenses/>.
00023 """
00024
00025 from slimpy_base.Core.User.linop.LinearOperatorType import LinearOperatorType
00026 from slimpy_base.Core.User.linop.rclinOp import linearop_r as LinearOperatorStruct
00027 from slimpy_base.Core.User.linop.linear_operator import CompoundOperator
00028
00029
00030
00031
00032 class halfderiv( LinearOperatorStruct ):
00033 """
00034 HD = halfderiv( dom, inv=True )
00035 Half Order Deriviative
00036 """
00037 name = "halfderiv"
00038 def __init__(self,inSpace,inv=True,**kparams):
00039 """
00040 Initialize the operator.
00041 """
00042 LinearOperatorStruct.__init__(self,inSpace,inv=inv,**kparams)
00043
00044
00045
00046 @LinearOperatorType
00047 def deriv(inSpace):
00048 """
00049 D = deriv( dom )
00050 A Full Derivative
00051 """
00052 hd = halfderiv(inSpace)
00053
00054 return CompoundOperator( [hd, hd] )
00055
00056
00057
00058
00059 @LinearOperatorType
00060 def grad(inSpace):
00061 """
00062 G = grad( dom )
00063 Grad with respect to hd/d compounding
00064 """
00065 d = deriv(inSpace)
00066
00067 return CompoundOperator( [d] )
00068
00069
00070 @LinearOperatorType
00071 def curl(inSpace, sym=True, opt=False ):
00072 """
00073 C = curl( inSpace )
00074 Curl with respect to hd/d compounding
00075 """
00076 d = deriv(inSpace)
00077
00078 return CompoundOperator( [d] )