Boost logo

Glas :

Re: [glas] Concept C++ [was Re: back to business}

From: Karl Meerbergen (Karl.Meerbergen_at_[hidden])
Date: 2006-11-27 17:25:46


Quoting Peter Gottschling <pgottsch_at_[hidden]>:
> > Another examples is vector<double> v, w ;
> > The expression v+w returns e.g.
> > add_vector< vector<double>, vector<double> >,
> > which is only evaluated at assignment, e.g. x=v+w.
> > Do you deal with this returntype in your concepts? I think this
> > would be
> > very helpful.
> >
> That works. As long the return type is assignable to the vector
> type. You can write x=v+w. Rolf Bonderer and I did this for
> instance uBlas vector addition. He also defined some more
> concept_maps so that one could use more complex expressions, like x+=
>
> alpha * y;
>
> If you add three vectors in one expression, e.g. x=v+w+z you run into
>
> the first problem (unless you write an explicit concept_map for this
>
> expression). I believe for expression templates exist also another
>
> general solutions to enable interoperability between the original
> type and intermediate results. However, if we find a good solution
>
> for the first problem it might work for ET, too.

Peter,

I think we have similar ideas. The reason why I asked, was that this
issue was not clear in one of our discussions when you visited FFT. It
is something that is somehow being taken care of in some concepts in
glas, although, at this stage, the algebraic concepts are messy. Some of
your work could be copied.

I see no problem with ET. It is a matter of properly defining the return
type of op(x,y) in a magma for example. the result_type and
argument_type's of op(x,y) should be assignable to an element of the
magma. IMHO that should be enough as a condition.

Karl

>
> Best,
>
> Peter
> > Thanks,
> >
> > Karl
> >
> > On Wed, 2006-11-22 at 10:38 -0500, Peter Gottschling wrote:
> >> Well, I used ConceptGCC many times and it works quite well now.
> The
> >> fundamental concepts on the GLAS list, like ring and group, are
> >> implemented with concepts now and compiled with ConceptGCC. I
> >> published
> >> the results as technical report:
> >>
> >>
> http://www.cs.indiana.edu/cgi-bin/techreports/TRNNN.cgi?trnum=TR638
> >>
> >> There is amongst others an example to compute the power function
> with
> >> regard to an arbitrary binary function. There are different
> >> algorithms
> >> for magma, semi-group, monoid and groups. The concept compiler
> >> dispatches to the most appropriate.
> >>
> >> In another paper still pending I did performance experiments and
> it
> >> showed that the performance is the same as with gcc without
> concepts.
> >>
> >> There were occasionally some minor problems with ConceptGCC but
> Doug
> >> fixed most of them in the meantime. That said, the compiler is
> >> not in
> >> perfect production mode yet but it is already extremely useful
> for
> >> working with concepts.
> >>
> >> Cheers,
> >> Peter
> >>
> >> On 22.11.2006, at 08:52, Ian McCulloch wrote:
> >>
> >>>
> >>> On Wed, 22 Nov 2006, Karl Meerbergen wrote:
> >>>
> >>>> I think we should consider this. Is concept-gcc stable now?
> >>>
> >>> I think it is, although last time I checked there were some
> >>> issues with
> >>> compile times that ought to go away in the final version. Aside
>
> >>> from
> >>> spending a few hours reading the proposal, I have never used
> concept
> >>> gcc.
> >>> Maybe someone else on this list has? My impression was though,
> it
> >>> would
> >>> be the killer feature for linear algebra libs.
> >>>
> >>> Cheers,
> >>> Ian
> >>>
> >>>
> >>>>
> >>>>
> >>>> On Wed, 2006-11-22 at 14:36 +0100, Ian McCulloch wrote:
> >>>>> Hi Karl, Toon,
> >>>>>
> >>>>> Have you considered using Concept-GCC ?
> >>>>> http://www.generic-programming.org/languages/conceptcpp/
> >>>>>
> >>>>> Ian
> >>>>>
> >>>>> _______________________________________________
> >>>>> glas mailing list
> >>>>> glas_at_[hidden]
> >>>>> http://lists.boost.org/mailman/listinfo.cgi/glas
> >>>> --
> >>>> Karl Meerbergen
> >>>> Katholieke Universiteit Leuven
> >>>> Department of Computer Science
> >>>>
> >>>> E-mail: karl.meerbergen_at_[hidden]
> >>>> URL : http://www.cs.kuleuven.be/cwis/research/nalag/
> >>>> Phone : +32 16 327700 (secretary)
> >>>> Fax : +32 16 327996
> >>>>
> >>>> _______________________________________________
> >>>> glas mailing list
> >>>> glas_at_[hidden]
> >>>> http://lists.boost.org/mailman/listinfo.cgi/glas
> >>>>
> >>>>
> >>> _______________________________________________
> >>> glas mailing list
> >>> glas_at_[hidden]
> >>> http://lists.boost.org/mailman/listinfo.cgi/glas
> >>>
> >> ------------
> >> Peter Gottschling, Ph.D.
> >> Research Associate
> >> Open Systems Laboratory
> >> Indiana University
> >> 135 Lindley Hall
> >> Bloomington, IN 47405
> >> Tel.: +1-812-855-3608 Fax: +1-812-856-0853
> >> http://www.osl.iu.edu/~pgottsch
> >>
> >> _______________________________________________
> >> glas mailing list
> >> glas_at_[hidden]
> >> http://lists.boost.org/mailman/listinfo.cgi/glas
> > --
> > Karl Meerbergen
> > Katholieke Universiteit Leuven
> > Department of Computer Science
> >
> > E-mail: karl.meerbergen_at_[hidden]
> > URL : http://www.cs.kuleuven.be/cwis/research/nalag/
> > Phone : +32 16 327700 (secretary)
> > Fax : +32 16 327996
> >
> > _______________________________________________
> > glas mailing list
> > glas_at_[hidden]
> > http://lists.boost.org/mailman/listinfo.cgi/glas
>
> ------------
> Peter Gottschling
> Research Associate
> Open Systems Laboratory
> Indiana University
> 135 Lindley Hall
> Bloomington, IN 47405
> Tel.: +1 812 855-3608 Fax: +1 812 856 0853
> http://www.osl.iu.edu/~pgottsch
>
>
>