On Thu, 17 Sep 2009, John Peterson wrote:
On Thu, Sep 17, 2009 at 3:51 PM, Roy Stogner <[email protected]> wrote:
On Thu, 17 Sep 2009, Roy Stogner wrote:
One of the two problems, anyway. Problem two: for some reason the
DistributedVector call to Parallel::allgather(std::vector<T>&) with
T=std::complex<double> isn't getting resolved to the
Parallel::allgather(std::vector<std::complex<T> >&) specialization.
I'm not sure how to fix this one...
You can't partially specialize a function template. You can overload
a function with a different function template that looks exactly
*like* a partial specialization, but that still doesn't make it a
partial specialization. For instance, if your general function
template takes a default argument, then you'd better declare the
specialized template to take the same default argument, not just
assume that it's going to be affected by the first declaration.
C++ is perhaps not the most intuitive language in the world.
Does that mean you got libmesh compiling with complex enabled? Nice work!
Still working on it. We've basically got the same problem in every
Parallel:: method that takes a default argument. There's a comment in
there where someone (me? Ben?) fixed one of them by adding a second
declaration (and a comment thinking that it was gcc complaining) but I
need to go through this whole file and make sure we're not missing
anything. I'll be done before I head home for tonight.
Part of me thinks we ought to just instantiate a user-defined
MPI_Datatype for std::complex<float/double/long double>. Keep it in a
global, put it right after MPI_Init. Then we can get rid of all these
std::complex<T> operator overloadings. But I'll do things the less
risky, more tedious way for now.
---
Roy
------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Libmesh-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libmesh-devel