[SciPy-User] convolution of 2d arrays of exotic complex numbers (dual and split)

Denis Yershov kooleyba@gmail....
Mon Nov 14 11:11:04 CST 2011

i used scipy.signal.convolve to work with complex-number arrays.
now i need to convolve arrays of dual numbers (i*i=0) and split-complex
numbers (i*i=1). so i have a class (
http://dl.dropbox.com/u/4988243/iComplex.py) which implements this numbers:

class PlainComplex(Complex):
    def __mul__(self, other):
        other = ToComplex(other)
        return PlainComplex(self.re*other.re - self.im*other.im,
                       self.im*other.re + self.re*other.im)

class DualComplex(Complex):
    def __mul__(self, other):
        other = ToComplex(other)
        return DualComplex(self.re*other.re,
                       self.im*other.re + self.re*other.im)

class SplitComplex(Complex):
    def __mul__(self, other):
        other = ToComplex(other)
        return SplitComplex(self.re*other.re + self.im*other.im,
                       self.im*other.re + self.re*other.im)

as you can see only multiplication function is being changed.
the question: is it possible to feed arrays of such objects to scipy's
convolution function? when i try to do it for PlainComplex class it seems
to work wrong (different from using python's complex numbers):
http://dl.dropbox.com/u/4988243/sandbox.py - my complex
http://dl.dropbox.com/u/4988243/sandbox2.py - python complex

or maybe there is some alternative solution?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/scipy-user/attachments/20111114/2351d125/attachment.html 

More information about the SciPy-User mailing list