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 from slimpy_base.Core.User.linop.linear_operator import LinearOperator
00022 from numpy import ndarray
00023 from slimpy_base.User.AumentedMatrix.AugOperator import AugOperator
00024 from slimpy_base.User.AumentedMatrix.AugVector import AugVector
00025
00026 explicit = lambda oper: isinstance(oper, ndarray)
00027
00028
00029
00030 class Kronecker( LinearOperator ):
00031
00032 def __init__(self, OperA, OperB):
00033 self.OperA = OperA
00034 self.OperB = OperB
00035
00036
00037 def applyop(self,other):
00038 X = other.view( AugOperator )
00039
00040 if self.isadj:
00041 A = self.OperA.H
00042 B = self.OperB.H
00043 else:
00044 A = self.OperA
00045 B = self.OperB
00046
00047 C = A * ( X * B.H )
00048
00049 res = C.view( AugVector )
00050 return res