List Info

Thread: proposals




proposals
country flaguser name
Belgium
2007-02-05 04:02:45
Dear List,

I am hesitating between two conceptual systems for glas.
None of them is ideal, but we have to make a choice and
perhaps someone 
comes up with a better idea.

The idea is to use Concept C++, but also provide a working
system for a 
C++ compiler.

I have the following concepts (among others)

Expression
ScalarExpression: e.g. double
VectorExpression: e.g. result_type of add(vector,vector)
DenseVectorExpression: e.g. dense_vector<double>

and
Collection
ScalarCollection: e.g. double
VectorCollection
DenseVectorCollection: e.g. dense_vector<double>

The Expression and Collection concepts are set up in a tree
fashion. For 
each Expression, there is a corresponding Collection
(one-one 
correspondance).

The root is Expression/Collection with two children:
* ScalarExpression/ScalarCollection
* VectorExpression/VectorCollection

VectorExpression/vectorCollection has one child:
* DenseVectorExpression/DenseVectorCollection

The difference between expression and collection lies in
that an 
expression is not mutable.

OK. So far the basics. Using Concept C++, these can be used
to dispatch 
an expression like

assign( v, add( x, y ) )

to the most suitable implementation, following the tree
structure of
expression and collection. I do not give the details here.

For the C++ compiler, this is more tricky:
I see two possibilities:

A) Use meta programming to examine an expression.
For each type, we can ask questions about where we are in
the concept 
tree. In the above example,

concept_tag< dense_vector<double> >::type ==
dense_vector_collection_tag

concept_tag< double >::type == scalar_collection_tag

For the dispatching, it might be useful to know which type
of expression 
we are working with, e.g.

which_kind< vector_expression_tag,
dense_vector<double> >::type == 
dense_vector_expression_tag

which_kind< collection_tag, dense_vector_<double>
>::type == 
vector_collection_tag

The which_kind meta function selects the concept that is a
child in the 
concept tree.


B) Use Bartan-Nackman trick

For each concept, we provide a type, e.g.

template <typename E>
struct dense_vector_expression
: vector_expression<E>
{
...
} ;


All GLAS types inherit from a concept type that can be used
in 
dispatching, e.g.

template <typename T>
class dense_vector
: public dense_vector_collection< vector<T> >
, public dense_vector_expression< vector<T> >
{
 ...
} ;

This system is very close to the concept c++ concept system
and 
therefore I like it very much, but the disadvantage is that
built-in 
types do not have this mechanism: e.g.

class double
: public scalar_expression<double>
, public scalar_collection<double>
{
 ...
} ;

So, we should define glas::double, glas::complex, glas::int
etc.


System B is relatively easy to put together. With system A,
the GLAS 
user can use his own classes in GLAS whithout having to use
the Barton 
and Nackman trick for his own classes, and built-in types
perfectly fit 
into the system. If we choose A, we should use this also
with Concept 
C++, otherwise we have two completely different systems,
which is overkill.

I hope my explanation is clear. It is rather technical
matter.

Thanks for your reactions.

Karl

Disclaimer: http
://www.kuleuven.be/cwis/email_disclaimer.htm

_______________________________________________
glas mailing list
glaslists.boost.org
http
://lists.boost.org/mailman/listinfo.cgi/glas
  
Re: proposals
country flaguser name
Germany
2007-02-05 04:50:54
Hi Karl,

On Monday 05 February 2007 11:02, Karl Meerbergen wrote:
> A) Use meta programming to examine an expression.
> For each type, we can ask questions about where we are
in the concept
> tree. In the above example,

> B) Use Bartan-Nackman trick

Before I start: Is there an automatic tool, that can convert
code for 
conceptc++ to concept-free c++ code? (Such that conceptc++
works as a kind of 
preprocessor for g++?)

About your proposals: I generally don't like the
Barton-Nackman trick (CRTP). 
This caused always headache when I tried to figure out the
right combinations 
of parameters for my functions. A good example of this is
the various 
dispatch mechanisms of ublas, which are hard to follow. So I
would always 
prefer a solution which is readable. 
Thus I prefer a (single) dispatch with some meta-programming
and function 
parameters that show what they are:

(correct me, if I am wrong) the CRTP versions would look
like:
do_something(vector_expression<V> & v,
scalar_expression<S> & s, ..., 
dense_tag, ...);
do_something(vector_expression<V> & v,
scalar_expression<S> & s, ..., 
unknown_tag, ...);

the A) version just would look like
do_something(V & v, S & s, 
  is_convertible< concept_tag<V>::type,
dense_vector_expression_tag >,
  is_convertible< concept_tag<V>::type,
scalar_expression_tag > );
...

IMO the possibility to easily add custom class and custom
algorithms for 
expression is quite important. 
Finally, the best solution would be to only need the
concepts ...

mfg
Gunter


_______________________________________________
glas mailing list
glaslists.boost.org
http
://lists.boost.org/mailman/listinfo.cgi/glas
Re: proposals
country flaguser name
Netherlands
2007-02-05 05:09:08
Karl Meerbergen wrote:

> For the C++ compiler, this is more tricky: I see two
possibilities:
> A) Use meta programming to examine an expression.
> B) Use Bartan-Nackman trick
>     All GLAS types inherit from a concept type that can
be used in 
> dispatching.

I think it's very important to allow the use of user scalar
types which 
do not inherit from glas concept types, so I much prefer A)
over B).

A possible alternative might be to use B) but to
"assume" types which do 
not inherit from a glas type are scalars.

Pieter

_______________________________________________
glas mailing list
glaslists.boost.org
http
://lists.boost.org/mailman/listinfo.cgi/glas

Re: proposals
user name
2007-02-07 08:32:41
Karl Meerbergen wrote:

> This system is very close to the concept c++ concept
system and 
> therefore I like it very much, but the disadvantage is
that built-in 
> types do not have this mechanism: e.g.
> 
> class double
> : public scalar_expression<double>
> , public scalar_collection<double>
> {
> ...
> } ;
> 
> So, we should define glas::double, glas::complex,
glas::int etc.


Or an alternative would be to use meta-programming tricks to
recognize 
the built-in types.



> If we choose A, we should use this also with Concept
> C++, otherwise we have two completely different
systems, which is overkill.



I'm all for portability. However if using concepts makes
life _much_ 
easier and since we can expect concepts to end up in the
standard, 
relying on concepts is only a drawback in the short term.

toon
_______________________________________________
glas mailing list
glaslists.boost.org
http
://lists.boost.org/mailman/listinfo.cgi/glas

Re: proposals
country flaguser name
Belgium
2007-03-11 13:43:30
Hi,

Thanks for the comments on my last e-mail. In the meantime,
I did some 
coding for a backend system using relatively simple ideas
using the 
conceptual tree for expressions/collections. I assume this
system can 
still be simplified.

I also experimented alot with conceptgcc. Although the
compiler is 
improving every SVN release, I am still unable to get a
complicated 
piece of code compiled. I see two reasons: my limited
experience with 
concept c++ and instabilities in the compiler (usually a
compilation 
ends with segmentation fault).

I would like to suggest to forget about concept C++ for now,
and develop 
using C++ only, but keeping the concepts in mind. The danger
is this 
could make the use of concept c++ in a later stage more
difficult.

I will explain some ideas a document. You can expect this
some time in 
April. Then, we can decide how to continue.

Best regards,

Karl

_______________________________________________
glas mailing list
glaslists.boost.org
http
://lists.boost.org/mailman/listinfo.cgi/glas
  
Re: proposals
country flaguser name
Belgium
2007-04-04 13:10:51
Hi,

I am preparing a proposal for an extendable backend system
and concepts 
for vectors (and scalars to some extent).

One of the design decisions I would like to make is to use
free 
functions as much as possible.  I think that free functions
would make 
life alot easier and extensions more straightforward. I will
explain 
later in detail.

Does someone have a strong objection against
size(v) instead of v.size(), stride(v) instead of v.stride()
?

Similarly, one could argue that meta functions are preferred
to members, 
e.g.
size_type<V>::type rather than V::size_type.

However, concept C++ suggests to organize this in a slightly
different 
way, e.g.
VectorExpression<V>::size_type
where VectorExpression is a concept.
In pure C++, VectorExpression would be a traits blob.
Therefore, I prefere the latter notation to meta functions
with a single 
type member.

Best,

Karl

_______________________________________________
glas mailing list
glaslists.boost.org
http
://lists.boost.org/mailman/listinfo.cgi/glas
  
Call for developers
country flaguser name
Belgium
2007-05-24 03:20:04
Hi,


At this time, I am the only active developer in the GLAS
project and I 
am feeling lonesome. Therefore, I am calling for developers
who want to 
work on concepts and implementation of containers,
algorithms etc. as 
well as the regression and performance tests, and
portability.

In February, Marc Van Barel and I applied for a grant to the
FWO 
(Research Foundation - Flanders), without success. We are
trying to get 
some feed-back why we failed. I see other possibilities for
funding, 
which I will certainly try.

In the meantime, I would like to speed up the development of
the project 
by a call for developers. There are several aspects that can
be 
developed independently. If noone shows up, we may have a
working suite 
of vector concepts and algorithms only by the end of the
year, depending 
on my 'free' time.

I also would like to organise a meeting with those who are
interested in 
a more lively discussion than a mailing list.

Other suggestions to speed up a bit are welcome.

I must admit I am disappointed that there was not a single
reaction on 
my last e-mail. If the document was too hard to read, please
tell me so 
that I can improve it.


Best,


Karl

_______________________________________________
glas mailing list
glaslists.boost.org
http
://lists.boost.org/mailman/listinfo.cgi/glas
  
Re: Call for developers
country flaguser name
Germany
2007-05-26 03:47:13
Am Donnerstag, 24. Mai 2007 10:20 schrieb Karl Meerbergen:

> I must admit I am disappointed that there was not a
single reaction on 
> my last e-mail. If the document was too hard to read,
please tell me so 
> that I can improve it.

Hi Karl,

I can very well understand your disappointment. In my case
it was simply 
lack of time. I really would like to participate, but am
really busy with 
my PhD thesis currently so I unfortunately can't afford it
right now.
Hopefully some others are able to join, since this project
is really needed 
and deserves some more attention.


Georg

_______________________________________________
glas mailing list
glaslists.boost.org
http
://lists.boost.org/mailman/listinfo.cgi/glas

Re: Call for developers
user name
2007-06-01 13:39:36
Hi Karl,

I&#39;m starting receiving glas e-mails! I'm a Brazilian C++ programmer  and I work with C++ since 1997.
I9;d like to help, but to do that, I need some kind of planing! What can I do to help? There is a TODO list somewhere?

[]s
Richard

On 5/24/07, Karl Meerbergen < Karl.Meerbergencs.kuleuven.be">Karl.Meerbergencs.kuleuven.be> wrote:
Hi,


At this time, I am the only active developer in the GLAS project and I
am feeling lonesome. Therefore, I am calling for developers who want to
work on concepts and implementation of containers, algorithms etc. as
well as the regression and performance tests, and portability.

In February, Marc Van Barel and I applied for a grant to the FWO
(Research Foundation - Flanders), without success. We are trying to get
some feed-back why we failed. I see other possibilities for funding,
which I will certainly try.

In the meantime, I would like to speed up the development of the project
by a call for developers. There are several aspects that can be
developed independently. If noone shows up, we may have a working suite
of vector concepts and algorithms only by the end of the year, depending
on my 'free&#39; time.

I also would like to organise a meeting with those who are interested in
a more lively discussion than a mailing list.

Other suggestions to speed up a bit are welcome.

I must admit I am disappointed that there was not a single reaction on
my last e-mail. If the document was too hard to read, please tell me so
that I can improve it.


Best,


Karl

_______________________________________________
glas mailing list
glaslists.boost.org">glaslists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/glas


Re: Call for developers
country flaguser name
United States
2007-06-01 14:53:25
On Thu, 24 May 2007 10:20:04 +0200 Karl Meerbergen wrote:
> 
> I must admit I am disappointed that there was not a
single reaction
> on my last e-mail. If the document was too hard to
read, please tell
> me so that I can improve it.


Hi Karl,

I've been following the glas list (lurking).  I'd like to
contribute
but have to admit I'm a little intimidated.  My C++ skills
are OK (have
been using it on/off since the mid-90's) but cannot claim
real
familiarity/comfort with template meta-programming in
general or the
Boost MPL (and this seems to be a pre-requisite for GLAS).

Can you or someone else please recommend some good
background material
and/or "warm-up exercises" for glas beginners?

Ed

ps - I have a copy of Barton & Nackman and will order
Abrahams &
     Gurtovoy or other titles if its generally viewed as a
good
     idea...

-- 
Edward H. Hill III, PhD  |  edeh3.com  |  http://eh3.com/

_______________________________________________
glas mailing list
glaslists.boost.org
http
://lists.boost.org/mailman/listinfo.cgi/glas
[1-10] [11-12]

about | contact  Other archives ( Real Estate discussion Medical topics )