[Dune] Re: Bemerkung CollectiveCommunication.

Thimo Neubauer thimo.neubauer at iwr.uni-heidelberg.de
Sat Nov 18 13:49:06 CET 2006


Hi,

On Tue, Nov 14, 2006 at 12:52:07PM +0100, Markus Blatt wrote:
> On Mon, Nov 13, 2006 at 03:42:27PM +0100, Robert Kloefkorn wrote:
> > 
> > ich wollte noch was zur CollectiveCommunication bemerken.
> > Ich hatte mir das naviv zo vorgestellt, das ich das Ganze sowohl mich
> > double * als z.B auch mit std::vector<double> verwenden kann. Das
> > scheint im Moment nich der Fall zu sein. 
> 
> Currently just good old POD types (and simple structs) and C arrays
> are supported. Sure this is a shortcoming, but I think we can live
> that for 1.0, don't we?

The std::vector is guaranteed to store it's content in a continuous
fashion to be compatible with the C-style arrays. That means that

  std::vector<double> foo;

  ....

  double *cfoo = &foo.begin();

  // act on cfoo[0] ... cfoo[foo.size() - 1]

is legal and standard conforming as long as foo is not expanded. This
should be a good workaround for your issue.

Cheers
   Thimo




More information about the Dune mailing list