Boost logo

Glas :

Re: [glas] dotc and dotu in glas

From: Andrew Lumsdaine (lums_at_[hidden])
Date: 2006-05-01 13:59:41


Both are needed.

In the Iterative Template Library, both are required in order for the
solvers to work properly with complex vectors.

Mathematically, dotc() is a proper inner product for a complex Hilbert
space, dotu() is not. If a single dot() function is going to be used
for inner product, mathematically it must be equivalent to dotc().

Use cases are very important when creating interfaces for a generic
library. I would suggest taking a look at ITL and IETL to see how
generic linear concepts at this level of abstraction are used.

Toon Knapen wrote:
> I was wondering if we need an equivalent for both the dotc and dotu of
> BLAS in glas? I suggest to only have _one_ dot function (which is
> equivalent to the dot in blas for vectors of reals and which corresponds
> to dotu for vectors of complex values). To perform the equivalent of
> dotc one could then write dot(conj(x),y). This is IMHO clearer and the
> expression-template mechanism will avoid that this compound expression
> will induce a performance penalty.
>
> I just added an equivalent to dotc but I plan to add the solution as
> described above, benchmark both and than remove the dotc equivalent
> afterwards (supposing the benchmark will not show any performance
> differences of both approaches).
>
> toon
>
>
> _______________________________________________
> glas mailing list
> glas_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/glas