[SciPy-dev] Bug in blas test
Tue Sep 16 16:23:06 CDT 2008
Thank you very much Uwe, I forgot completely.
And the reason for having the comlpex dot product is
that things need to be normalized, so that for example the
vector with the element [1j] dot [1j] results to 1 (and not -1).
On Tue, Sep 16, 2008 at 2:36 PM, Uwe Schmitt <firstname.lastname@example.org> wrote:
> Am 16.09.2008 um 20:51 schrieb Ilan Schnell:
>> I just found a bug in tests for blas.
>> Line 74 and 75 of scipy/lib/blas/tests/test_blas.py (current trunk):
>> f = getattr(fblas,p+'dotc')
>> The result of the dot product of these two vectors is 3-10j,
>> as can be easily veryfied:
>>>>> def f(a, b):
>> ... return sum(x*y for x, y in zip(a, b))
> You implemented the *real* dot product, not the complex one !
> I made this mistake sometime ago too.
> According to http://orion.math.iastate.edu/docs/cmlib/blas/cdotc
> the test is ok.
> The right implementation would be
> def f(a,b):
> return sum(complex(x).conjugate()*y for x,y in zip(a,b))
> Greetings, Uwe
>> Is it OK if I fix this in the current trunk?
>> - Ilan
>> Scipy-dev mailing list
> Scipy-dev mailing list
More information about the Scipy-dev