dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #25808
Re: C++ question
-
To:
"Garth N. Wells" <gnw20@xxxxxxxxx>
-
From:
Anders Logg <logg@xxxxxxxxx>
-
Date:
Mon, 20 Aug 2012 18:25:44 +0200
-
Cc:
DOLFIN Mailing List <dolfin@xxxxxxxxxxxxxxxxxxx>
-
In-reply-to:
<CAA4C66ORdj7GJn__vLUVguHnAXkqv0orb7ADQ=rgxf6jXBumOg@mail.gmail.com>
-
User-agent:
Mutt/1.5.21 (2010-09-15)
On Mon, Aug 20, 2012 at 05:00:32PM +0100, Garth N. Wells wrote:
> On 20 August 2012 16:50, Anders Logg <logg@xxxxxxxxx> wrote:
> > I'm editing the linear algebra interface to add support for generic
> > Krylov matrices and I'm seeing things like this:
> >
> >
> > /// Create empty vector (global)
> > boost::shared_ptr<GenericVector> create_vector() const
> > {
> > boost::shared_ptr<GenericVector> x(new MTL4Vector);
> > return x;
> > }
> >
> > /// Create empty vector (local)
> > boost::shared_ptr<GenericVector> create_local_vector() const
> > {
> > boost::shared_ptr<GenericVector> x(new MTL4Vector);
> > return x;
> > }
> >
> > I thought () was required:
> >
> > boost::shared_ptr<GenericVector> x(new MTL4Vector());
> >
> > Has this always been the case?
> >
>
> There are some instances where we need to distinguish between local
> and distributed vectors, notably in the PETSc interface code. To work
> through GenericVector, it appears in the MTL, uBLAS, etc code too.
I know, I wasn't referring to the global vs local. I meant omitting
the () in constructors that take no arguments:
new MTL4Vector()
vs
new MTL4Vector
--
Anders
Follow ups
References