* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* *
* Your message has NOT been delivered to the scsc.ethz.ch domain. *
* This message was generated by the automatic mail answering service *
* of the ETHZ. Your original message is appended to this reply. *
* *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* *
* Swiss Center for Scientific Computing (SCSC) *
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *
* *
* Your message has been rejected because the SCSC Scientific Projects *
* and Support section has been disbanded as of October 1999. *
* *
* The members of the SPS section have moved to the following domains: *
* *
* Amon, Beat -> ammon@ginnan.issp.u-tokyo.ac.jp *
* Bregy, Nicole -> bregy@finance.ch *
* Chisholm, Rory -> rchishol@iiic.ethz.ch *
* de Forcrand, Philippe -> forcrand@itp.phys.ethz.ch *
* de Sturler, Alice -> alice@csar.uiuc.edu *
* de Sturler, Eric -> sturler@csar.uiuc.edu *
* Favre, Jean -> favre@cscs.ch *
* Fischer, Thomas -> tfischer@ccu1.auckland.ac.nz *
* Flukiger, Peter -> peter.flukiger@reuters.com *
* Friedli, Armin -> friedli@awu.id.ethz.ch *
* Groh, Gabor -> groh@cscs.ch *
* Gutknecht, Martin H. -> martin.gutknecht@sam.math.ethz.ch *
* Hanf, Martin -> hanf@finance.ch *
* Hansmann, Uli -> hansmann@ims.ac.jp *
* Hilger, Anouk -> Anouk.M.Hilger@lux.dupont.com *
* Klopper, Wim -> w.m.klopper@kjemi.uio.no *
* Krasnitz, Alex -> krasnitz@hetws3.nbi.dk *
* Laliena, Victor -> laliena@posta.unizar.es *
* Lienhart, Brigitte -> lienhart@finance.ch *
* Loher, Damian -> loher@sam.math.ethz.ch *
* Luethi, Hans Peter -> luethi@igc.phys.chem.ethz.ch *
* Millard, Patricia -> millard@itp.phys.ethz.ch *
* Peikert, Ronald -> peikert@inf.ethz.ch *
* Petersen, Wesley P. -> wesley.petersen@sam.math.ethz.ch *
* Portmann, Stefan -> portmann@igc.phys.chem.ethz.ch *
* Ressel, Klaus -> kjr@dfd.dlr.de *
* Roth, Martin -> martin.m.roth@inf.ethz.ch *
* Rozloznik, Miroslav -> rozloznik@sam.math.ethz.ch *
* Schlegel, Elisabeth -> schlegel@sl.ethz.ch *
* Schnidrig, Remo -> schnidrig@finance.ch *
* Therre, Jean-Pierre -> therre@swissonline.ch *
* van der Sijs, Arjan -> arjan.van.der.sijs@asml.nl *
* von Bueren, Daniel -> dvb@visdome.ethz.ch *
* von Sturler, Alice -> alice@csar.uiuc.edu *
* von Sturler, Eric -> sturler@csar.uiuc.edu *
* Wuertz, Diethelm -> wuertz@itp.phys.ethz.ch *
* *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* *
* In case of technical problems, please contact postmaster@ethz.ch *
* *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
attached mail follows:
oon-digest Tuesday, November 23 1999 Volume 01 : Number 053
* In this issue:
OON: Some thoughts on library design
OON: KAI and templates
OON: KAI and templates
Re: OON: KAI and templates
OON: KAI and templates
Re: OON: KAI and templates
----------------------------------------------------------------------
Date: Wed, 17 Nov 1999 19:35:07 -0500 (EST)
From: jsiek@lsc.nd.edu
Subject: OON: Some thoughts on library design
Hi Daniel,
Daniel Israel writes:
>
> class MyField : Array<double, 3> {
> MyGrid grid;
> MyField ddx() {
> ...
> };
> }
>
> MyField f1, f2, f3;
>
> f1=f2+f3;
>
> The problem is that f2+f3 is not 'MyField' it is 'Array<double, 3>'
> unless I create an entirely new level of template expressions, in
> which case I have thrown away most of the advantage of using Blitz++.
I've recently spent a bunch of time thinking about how to add
expression templates to MTL, and had to tackle a variant of this
problem. What I did was use a combination of PETE with the Barton &
Nackman trick. More specifically, I defined a set of operators for
mxtl_expr and then made it a superclass to each of the MTL matrix and
vector classes. This is much more convenient than generating a whole
new copy of all the operators for each MTL class. The Barton &
Nackman trick is then used so that when the expression is evaluated,
it can do the right thing for the subclass.
Ciao,
Jeremy
template <class DerivedClass>
struct mxtl_expr {
public:
typedef DerivedClass derived_type;
mxtl_expr<DerivedClass>& as_base() { return *this; }
const mxtl_expr<DerivedClass>& as_base() const { return *this; }
DerivedClass& as_derived() {
return static_cast< DerivedClass&>(*this);
}
const DerivedClass& as_derived() const {
return static_cast<const DerivedClass&>(*this);
}
protected: // can only be used as a base class
mxtl_expr() { }
~mxtl_expr() { }
private: // this is like an abstract base class, no direct copying allowed
mxtl_expr(const mxtl_expr&) { }
mxtl_expr& operator=(const mxtl_expr&) { }
};
// Hook for interfacing with PETE
template <class DerivedClass>
struct CreateLeaf< mxtl_expr<DerivedClass> > {
public:
typedef Reference< mxtl_expr<DerivedClass> > Leaf_t;
inline static
Leaf_t make(const mxtl_expr<DerivedClass>& x) {
return Leaf_t(x);
}
};
------------------------------
Date: Tue, 23 Nov 1999 17:10:53 +0100
From: Oliver Gloth <oliver@vug.uni-duisburg.de>
Subject: OON: KAI and templates
Hi everyone,
On the KAI homepage it is said that "template template parameters" are
not yet implemented. Does that mean something like
"vector<vector<double> >" will not work?
------------------------------
Date: Tue, 23 Nov 1999 12:03:36 -0500 (EST)
From: jsiek@lsc.nd.edu
Subject: OON: KAI and templates
Oliver Gloth writes:
> Hi everyone,
>
> On the KAI homepage it is said that "template template parameters" are
> not yet implemented. Does that mean something like
> "vector<vector<double> >" will not work?
Nope, that is fine. A template template parameter is something like
this:
template< template <class T> Container>
struct foo {
};
------------------------------
Date: Tue, 23 Nov 1999 11:52:12 -0600 (CST)
From: robison@kai.com (Arch Robison)
Subject: Re: OON: KAI and templates
> On the KAI homepage it is said that "template template parameters" are
> not yet implemented. Does that mean something like
> "vector<vector<double> >" will not work?
No. vector<double> is an instance of a template, not a template,
hence "vector<vector<double> >" works just fine with KAI C++.
What the homepage means is that the following does not work yet:
template<template T,class X> struct Foo {
T<X> container;
};
Foo<vector,int> bar;
The key point is that template parameter T is a template, not a class or value.
Arch D. Robison Kuck & Associates Inc.
robison@kai.com 1906 Fox Drive
217-356-2288 ext. 56 Champaign IL 61820
------------------------------
Date: Tue, 23 Nov 1999 12:50:06 -0500 (EST)
From: Paul Beardsley <pab@merl.com>
Subject: OON: KAI and templates
I think it means that
template <class T1, class T2>
class MyClass
{
void fred (T1<T2>& my_arg);
};
won't work.
Paul.
Oliver Gloth writes:
> Hi everyone,
>
> On the KAI homepage it is said that "template template parameters" are
> not yet implemented. Does that mean something like
> "vector<vector<double> >" will not work?
------------------------------
Date: Tue, 23 Nov 1999 12:27:41 -0600 (CST)
From: robison@kai.com (Arch Robison)
Subject: Re: OON: KAI and templates
Thanks for giving the correct syntax for a template template parameter.
The syntax in my example is wrong.
- - Arch
> Oliver Gloth writes:
> > Hi everyone,
> >
> > On the KAI homepage it is said that "template template parameters" are
> > not yet implemented. Does that mean something like
> > "vector<vector<double> >" will not work?
>
> Nope, that is fine. A template template parameter is something like
> this:
>
> template< template <class T> Container>
> struct foo {
>
> };
------------------------------
End of oon-digest V1 #53
************************
--------------------- Object Oriented Numerics List --------------------------
* To subscribe/unsubscribe: use the handy web form at
http://oonumerics.org/oon/
* If this doesn't work, please send a note to owner-oon-list@oonumerics.org
--------------------- Object Oriented Numerics List --------------------------
* To subscribe/unsubscribe: use the handy web form at
http://oonumerics.org/oon/
* If this doesn't work, please send a note to owner-oon-list@oonumerics.org
This archive was generated by hypermail 2b29 : Wed Feb 20 2002 - 03:20:10 EST