Glas :Re: [glas] MTL3 design ? [was MTL project site is up] |
From: Theodore Papadopoulo (Theodore.Papadopoulo_at_[hidden])
Date: 2005-02-03 09:09:22
On Thu, 2005-02-03 at 08:52 -0500, David Abrahams wrote:
> Theodore Papadopoulo <Theodore.Papadopoulo_at_[hidden]> writes:
> Means that every dynamic vector ("non-copy") constructor will need at
> least one size argument, and every dynamic matrix ("non-copy")
> constructor will need at least two.
And I believe it is good to provide for these constructors as most of
the time for linear algebra you know these sizes in advance. And most of
the implementations I know of linear algebra tools do that.
> It rules out default-constructibility, which is something I'm not yet prepared to
> do. Maybe as the use-cases and design become more evolved, I'll
> change my mind.
Not necessarily... Default construction just creates empty objects (0
dimensional) that need to be resized at some point. My point is not to
forbid resizing (even though it is seldom needed in practice), but not
to change the sizes implicitly (eg by assignment or copy or
transposition-in-place).
As others have already said it also has a speed advantage and I maintain
(without explicit example but based on my experience nevertheless) a
reliability advantage.
Theo.