|
Ublas : |
From: Dima Sorkin (dsorkin_at_[hidden])
Date: 2005-07-11 03:05:56
Quoting Michael Stevens <mail_at_[hidden]>:
> On Sunday 10 July 2005 11:11, Dima Sorkin wrote:
> > I meant that it would be nice to have such traits class
> > (or classes) ,**as a part of user interface**,to enable the
> > use of any types of "scalars" with ublas.
>
> Agreed. Is this 'just' a documentation issue?
>
> Michael
Hi.
Yes and no.
It is first of all a documentation issue, but not just this.
Today (I still use 1.31 :)),ublas functions do not accept traits_class
as template type-parameter from the user/caller, but rather assume that
traits class with the right name will be present at the right scope at
the point of binding (instantiation) of the template.
This practice seems odd to me,for the following reasons:
1 - Such a dependency is not so stable and may lead to compilation
problems (Following the discussion of this issue in B.Stroustrup
book "C++ prog. language")
2 - to define such traits class for my "scalar", I need to intervene
into ublas namespace.
3 - When I tried to understand the structure of ublas traits classes,
I found there traits3 on traits2::type on traits1::type chains of
type calculations (closure_traits etc, which I didn't suceeded to
understand). Here no documentation will help.
So this chain of traits calculations must be begun with some simple
traits_class accepted as template argument from user/caller.
And this simple traits_class that starts the whole chain should
be documented first of all.
So, if I am right, it is also question of changing ublas interface,
soon or later.
(but there are no reasons that old code will break, since the template
arguments may have default type-values).
Regards,
Dima.