# Glas :

## RE: [glas] MTL3 design ? [was MTL project site is up]

From: Virgilio, Vincent - SSD (Vincent.Virgilio_at_[hidden])
Date: 2005-02-03 14:16:12

> -----Original Message-----
> From: glas-bounces_at_[hidden]
> [mailto:glas-bounces_at_[hidden]] On Behalf Of David Abrahams
> Sent: Thursday, February 03, 2005 8:55 AM
> To: Generic Linear Algorithm Software
> Subject: Re: [glas] MTL3 design ? [was MTL project site is up]
>
> "Patrick Kowalzick" <patrick.kowalzick_at_[hidden]> writes:
>
> > From: "David Abrahams" <dave_at_[hidden]>
> >> Guntram Berti <berti_at_[hidden]> writes:
> >
> > [snip]
> >
> >>> I think it will not be uncommon to wish to forbid even assignment
> >>> between vectors of equal size, for example if one represents
> >>> cell-based and the other one vertex-based quantities
> (speaking FEM).
> >>> So one could introduce mechanisms to forbid assigment at compile
> >>> time (i.e. making those vectors different types).
> >>
> >> Or const?
> >
> > IMO for a "user" there is an easy way needed to create a bunch of
> > vectors with different _semantic_ meanings. One example is
> Guntrams FEM example.
> > Another one might be the representations of geometrical
> entities, e.g
> > the semantic difference between points and vectors. This
> truly depends
> > on the mathematical context.
> >
> > Having different types makes it much easier declaring functions for
> > some action. As an example take two vectors[3], where one
> represents a
> > point and the other a line in a 2D homogeneous space. The affine
> > transformations for both types must not be equal, so the
> > point affine_transformation( const matrix & a, const point & x );
> > line affine_transformation( const matrix & a, const line & x );
> >
> > Both points and lines _are_ vectors, but behave completly
> different. E.g.
> > addition of both is forbidden.
>

> (click the message subject to see the whole thread).
>
> --
> Dave Abrahams
> Boost Consulting
> www.boost-consulting.com
> _______________________________________________
> glas mailing list
> glas_at_[hidden]

>

Similarly, you might want to encode the coordinate system of a vector
into its type, to prevent unintentional combinations across coordinate
systems. I have a small implementation of this that has proven very