[pooma-dev] AltView* classes
James Crotinger
jcrotinger at proximation.com
Tue Mar 2 17:05:55 UTC 2004
OK - cool. Thanks for chipping in Dave. You're neurons are obviously less
rusty than mine. :)
Jim
------------------------------------------------------------------------
James A. Crotinger email: jimc at numerix.com
NumeriX, LLC phone: (505) 424-4477 x104
2960 Rodeo Park Dr. W.
Santa Fe, NM 87505
> -----Original Message-----
> From: Dave Nystrom [mailto:wdn at lanl.gov]
> Sent: Tuesday, March 02, 2004 10:00 AM
> To: James Crotinger
> Cc: 'Richard Guenther'; 'pooma-dev at pooma.codesourcery.com'; 'Jeffrey D.
> Oldham'; John Hall; Dave Nystrom; Dave Nystrom
> Subject: RE: [pooma-dev] AltView* classes
>
> These AltView classes were put in by Jeffrey Oldham to fix a problem that
> I
> was having trying to explicitly instantiate all the Pooma classes and
> functions that Blanca code was using. Basically, the way the Pooma 2
> Field
> class was originally written, we were getting one of these "sv" enums
> instantiated for every unique expression which we had in our source code
> base. I was unable to explicitly instantiate these "sv" enums the way the
> code was originally written because of some issue which Arch Robison of
> Kuck
> and Associates (now Intel) identified - basically the code in it's
> original
> form violated some corner case of the C++ standard according to Arch.
> Jeffrey fixed this problem by adding the AltView class and then I was able
> to
> perform the explicit instantiations that I needed.
>
> However, I believe Jeffrey or someone else has gone through the code and
> replaced the "sv" enums with some other construct which does not have the
> explicit instantiation difficulties that the "sv" enums had. So, I think
> that it is probably okay to remove the AltView classes and that this would
> clean up the code considerably. I may revisit all this explicit
> instantiation stuff sometime in the not to distant future on a hobby basis
> (weird hobby, huh) and if I encounter difficulties being able to
> explicitly
> instantiate anything, I could then raise it as an issue at that time.
>
> In summary, the AltView classes were added by Jeffrey to fix an explicit
> instantiation problem that I think no longer exists and I am in favor of
> now
> removing them in the interest of cleaning up the code as much as possible.
>
> --
> Dave Nystrom email: wdn at lanl.gov
> LANL X-2 phone: 505-667-7913 fax: 505-665-2227
>
> James Crotinger writes:
> > Hi Richard,
> >
> > This tickled a neuron the other day, but I couldn't recall the details.
> >
> > The AltView classes were put in to reduce link times and sizes for
> large
> > codes. The classes that have enums end up having a link-time cost, both
> in
> > space and time. I believe this refactoring was done to reduce the
> > cardinality of classes having the "sv" enum. My recollection is that
> this,
> > and other similar "optimizations", had a pretty substantial impact on
> > link-time for Blanca. Unless these are hurting something else, I would
> tend
> > to leave them in.
> >
> > Does the CodeSourcery CVS repository have complete CVS history? (i.e.
> did we
> > copy the repository, or just the head version?) This should have been
> easy
> > to determine via CVS.
> >
> > Jim
> >
> > -----------------------------------------------------------------------
> -
> > James A. Crotinger email:
> jimc at numerix.com
> > NumeriX, LLC phone: (505) 424-4477
> x104
> > 2960 Rodeo Park Dr. W.
> > Santa Fe, NM 87505
> >
> >
> > > -----Original Message-----
> > > From: Richard Guenther [mailto:rguenth at tat.physik.uni-tuebingen.de]
> > > Sent: Tuesday, March 02, 2004 3:29 AM
> > > To: pooma-dev at pooma.codesourcery.com
> > > Cc: Jeffrey D. Oldham
> > > Subject: Re: [pooma-dev] AltView* classes
> > >
> > > On Tue, 2 Mar 2004, Richard Guenther wrote:
> > >
> > > > On Fri, 27 Feb 2004, Richard Guenther wrote:
> > > >
> > > > > Hi!
> > > > >
> > > > > Does anyone remember the exact reason for the existance of the
> > > AltView*
> > > > > classes in Array.h and Field.h? Removing them and fixing their
> usage
> > > to
> > > > > use View* seems to work (full test with gcc 3.3 and 3.4 in
> progress).
> > > >
> > > > Testing completed with no new failures. Would it be ok to remove
> those
> > > > AltView* classes?
> > >
> > > Which would be...
> > >
> > > Ok?
> > >
> > > Richard.
> > >
> > >
> > > 2004Mar02 Richard Guenther <richard.guenther at uni-tuebingen.de>
> > >
> > > * src/Array/Array.h: remove all traces of AltView0 class.
> > > src/Field/Field.h: remove all traces of AltView1 and
> > > AltView1Implementation classes.
> > >
> > > ===== Array/Array.h 1.14 vs edited =====
> > > --- 1.14/r2/src/Array/Array.h Tue Dec 16 15:19:57 2003
> > > +++ edited/Array/Array.h Tue Mar 2 11:24:14 2004
> > > @@ -649,8 +649,6 @@
> > > // an existing engine cannot be any kind of slice domain.
> > > // Also, bounds checking would make no sense because it would
> > > // reduce to contains(a.domain(), a.domain());
> > > -//
> > > -// Any changes to this class should also be made to AltView0.
> > >
> > > template<int Dim, class T, class EngineTag>
> > > struct View0<Array<Dim, T, EngineTag> >
> > > @@ -695,41 +693,6 @@
> > > }
> > > };
> > >
> > > -// AltView0 avoids an instantiation problem that arises when two
> > > -// classes use each other. This class's definition should be
> exactly
> > > -// the same as View0 except omitting member functions.
> > > -//
> > > -// Do NOT explicitly instantiate this class.
> > > -
> > > -template<class ArrayTag>
> > > -struct AltView0;
> > > -
> > > -template<int Dim, class T, class EngineTag>
> > > -struct AltView0<Array<Dim, T, EngineTag> >
> > > -{
> > > - // Convenience typedef for the thing we're taking a view of.
> > > -
> > > - typedef Array<Dim, T, EngineTag> Subject_t;
> > > -
> > > - // Deduce domains for the output type.
> > > - // At some point, we need to fix NewDomain1; until then, use
> > > - // the temporary version from Array.h.
> > > -
> > > - typedef typename Subject_t::Engine_t Engine_t;
> > > - typedef typename Subject_t::Domain_t Domain_t;
> > > -
> > > - // Deduce the template parameters for the output type.
> > > -
> > > - typedef typename NewEngine<Engine_t, Domain_t>::Type_t
> NewEngine_t;
> > > - enum { newDim = NewEngine_t::dimensions };
> > > - typedef typename NewEngine_t::Tag_t NewEngineTag_t;
> > > -
> > > - // The output types.
> > > -
> > > - typedef Array<newDim, T, NewEngineTag_t> Type_t;
> > > - typedef Type_t ReadType_t;
> > > -};
> > > -
> > > template<int Dim, class T, class EngineTag>
> > > struct View1<Array<Dim, T, EngineTag>, int>
> > > {
> > > @@ -1864,7 +1827,7 @@
> > > /// A zero-argument version of operator(), which takes a view of
> > > /// array's domain, is also supplied.
> > > //@{
> > > - typename AltView0<This_t>::ReadType_t
> > > + typename View0<This_t>::ReadType_t
> > > read() const
> > > {
> > > typedef View0<This_t> Ret_t;
> > > @@ -1934,7 +1897,7 @@
> > > return Ret_t::makeRead(*this, s1, s2, s3, s4, s5, s6, s7);
> > > }
> > >
> > > - typename AltView0<This_t>::Type_t
> > > + typename View0<This_t>::Type_t
> > > operator()() const
> > > {
> > > typedef View0<This_t> Ret_t;
> > > ===== Field/Field.h 1.14 vs edited =====
> > > --- 1.14/r2/src/Field/Field.h Tue Dec 16 15:20:00 2003
> > > +++ edited/Field/Field.h Tue Mar 2 11:25:22 2004
> > > @@ -269,9 +269,6 @@
> > > * View1Implementation<Field, D, SV> specialization for indexing a
> field
> > > * with a single domain. There is a single-valued version (SV ==
> true)
> > > * and a multi-valued version (SV == false).
> > > - *
> > > - * Any changes to View1Implementation should also be made to
> > > - * AltView1Implementation.
> > > */
> > >
> > > // Single-valued version. Handles scalars and Locs.
> > > @@ -508,62 +505,7 @@
> > >
> > >
> > > /**
> > > - * AltView1Implementation avoids an instantiation problem that
> arises
> > > when two
> > > - * classes use each other. This class's definition should be
> exactly
> > > - * the same as View1Implementation except omitting member functions.
> > > - *
> > > - * Do NOT explicitly instantiate this class.
> > > - */
> > > -
> > > -// Single-valued version. Handles scalars and Locs.
> > > -
> > > -template<class Subject, class Domain, bool SV>
> > > -struct AltView1Implementation;
> > > -
> > > -template<class Mesh, class T, class EngineTag, class Domain>
> > > -struct AltView1Implementation<Field<Mesh, T, EngineTag>, Domain,
> true>
> > > -{
> > > - // Convenience typedef for the thing we're taking a view of.
> > > -
> > > - typedef Field<Mesh, T, EngineTag> Subject_t;
> > > -
> > > - // The return types are pretty simple here.
> > > -
> > > - typedef typename Subject_t::Element_t ReadType_t;
> > > - typedef typename Subject_t::ElementRef_t Type_t;
> > > -};
> > > -
> > > -template<class Mesh, class T, class EngineTag, class Domain>
> > > -struct AltView1Implementation<Field<Mesh, T, EngineTag>, Domain,
> false>
> > > -{
> > > - // Convenience typedef for the thing we're taking a view of.
> > > -
> > > - typedef Field<Mesh, T, EngineTag> Subject_t;
> > > -
> > > - // Deduce domains for the output type.
> > > -
> > > - typedef typename Subject_t::Engine_t Engine_t;
> > > - typedef typename NewEngine<Engine_t, Domain>::Type_t NewEngine_t;
> > > - typedef typename NewEngine_t::Element_t NewT_t;
> > > - typedef typename NewEngine_t::Tag_t NewEngineTag_t;
> > > -
> > > - // Deduce the new Mesh.
> > > -
> > > - typedef typename
> > > - NewMeshTag<NewEngine_t::dimensions, Mesh, Domain>::Type_t
> > > - NewMeshTag_t;
> > > -
> > > - // The output types.
> > > -
> > > - typedef Field<NewMeshTag_t, NewT_t, NewEngineTag_t> ReadType_t;
> > > - typedef Field<NewMeshTag_t, NewT_t, NewEngineTag_t> Type_t;
> > > -};
> > > -
> > > -
> > > -/**
> > > * View1<Field, S1> specialization for indexing a field with a
> single
> > > domain.
> > > - *
> > > - * Any changes to View1 should also be made to AltView1.
> > > */
> > >
> > > template<class Mesh, class T, class EngineTag, class Sub1>
> > > @@ -613,8 +555,6 @@
> > >
> > > /**
> > > * View1<Field, int> specialization for indexing a field with an
> int.
> > > - *
> > > - * Any changes to View1 should also be made to AltView1.
> > > */
> > >
> > > template<class Mesh, class T, class EngineTag>
> > > @@ -658,71 +598,6 @@
> > >
> > >
> > > /**
> > > - * AltView1 avoids an instantiation problem that arises when two
> > > - * classes use each other. This class's definition should be
> exactly
> > > - * the same as View1 except omitting member functions.
> > > - *
> > > - * Do NOT explicitly instantiate this class.
> > > - */
> > > -
> > > -template<class FieldTag, class DomainTag>
> > > -struct AltView1;
> > > -
> > > -template<class Mesh, class T, class EngineTag, class Sub1>
> > > -struct AltView1<Field<Mesh, T, EngineTag>, Sub1>
> > > -{
> > > - // Convenience typedef for the thing we're taking a view of.
> > > -
> > > - typedef Field<Mesh, T, EngineTag> Subject_t;
> > > -
> > > - // Deduce domains for the output type.
> > > - // At some point, we need to fix NewDomain1; until then, use
> > > - // the temporary version from NewDomain.h.
> > > -
> > > - typedef typename Subject_t::Domain_t Domain_t;
> > > - typedef TemporaryNewDomain1<Domain_t, Sub1> NewDomain_t;
> > > - typedef typename NewDomain_t::SliceType_t SDomain_t;
> > > -
> > > - // Deduce appropriate version of implementation to dispatch to.
> > > -
> > > - enum { sv = DomainTraits<SDomain_t>::singleValued };
> > > - typedef AltView1Implementation<Subject_t, SDomain_t, sv>
> Dispatch_t;
> > > -
> > > - // The optimized domain combiner.
> > > -
> > > - typedef CombineDomainOpt<NewDomain_t, sv> Combine_t;
> > > -
> > > - // The return types.
> > > -
> > > - typedef typename Dispatch_t::ReadType_t ReadType_t;
> > > - typedef typename Dispatch_t::Type_t Type_t;
> > > -};
> > > -
> > > -
> > > -/**
> > > - * AltView1 avoids an instantiation problem that arises when two
> > > - * classes use each other. This class's definition should be
> exactly
> > > - * the same as View1 except omitting member functions.
> > > - *
> > > - * Do NOT explicitly instantiate this class.
> > > - */
> > > -
> > > -template<class Mesh, class T, class EngineTag>
> > > -struct AltView1<Field<Mesh, T, EngineTag>, int>
> > > -{
> > > - // Convenience typedef for the thing we're taking a view of.
> > > -
> > > - typedef Field<Mesh, T, EngineTag> Subject_t;
> > > -
> > > - // The return types.
> > > -
> > > - typedef typename Subject_t::Element_t ReadType_t;
> > > - typedef typename Subject_t::ElementRef_t Type_t;
> > > -
> > > -};
> > > -
> > > -
> > > -/**
> > > * View2<Field, S1, S2> specialization for indexing a field with two
> > > * domains.
> > > */
> > > @@ -1455,14 +1330,14 @@
> > > /// point fields the viewing domain is an actual centering domain.
> > > //@{
> > >
> > > - inline typename AltView1<This_t, Domain_t>::ReadType_t
> > > + inline typename View1<This_t, Domain_t>::ReadType_t
> > > read() const
> > > {
> > > typedef View1<This_t, Domain_t> Ret_t;
> > > return Ret_t::makeRead(*this, physicalDomain());
> > > }
> > >
> > > - inline typename AltView1<This_t, Domain_t>::ReadType_t
> > > + inline typename View1<This_t, Domain_t>::ReadType_t
> > > readAll() const
> > > {
> > > typedef View1<This_t, Domain_t> Ret_t;
> > > @@ -1470,7 +1345,7 @@
> > > }
> > >
> > > template<class Sub1>
> > > - inline typename AltView1<This_t, Sub1>::ReadType_t
> > > + inline typename View1<This_t, Sub1>::ReadType_t
> > > read(const Sub1 &s1) const
> > > {
> > > typedef View1<This_t, Sub1> Ret_t;
> > > @@ -1493,14 +1368,14 @@
> > > return Ret_t::makeRead(*this, s1, s2, s3);
> > > }
> > >
> > > - inline typename AltView1<This_t, Domain_t>::Type_t
> > > + inline typename View1<This_t, Domain_t>::Type_t
> > > operator()() const
> > > {
> > > typedef View1<This_t, Domain_t> Ret_t;
> > > return Ret_t::make(*this, physicalDomain());
> > > }
> > >
> > > - inline typename AltView1<This_t, Domain_t>::Type_t
> > > + inline typename View1<This_t, Domain_t>::Type_t
> > > all() const
> > > {
> > > typedef View1<This_t, Domain_t> Ret_t;
> > > @@ -1508,7 +1383,7 @@
> > > }
> > >
> > > template<class Sub1>
> > > - inline typename AltView1<This_t, Sub1>::Type_t
> > > + inline typename View1<This_t, Sub1>::Type_t
> > > operator()(const Sub1 &s1) const
> > > {
> > > typedef View1<This_t, Sub1> Ret_t;
> > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
> > <HTML>
> > <HEAD>
> > <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
> > <META NAME="Generator" CONTENT="MS Exchange Server version
> 5.5.2653.12">
> > <TITLE>RE: [pooma-dev] AltView* classes</TITLE>
> > </HEAD>
> > <BODY>
> >
> > <P><FONT SIZE=2>Hi Richard,</FONT>
> > </P>
> >
> > <P><FONT SIZE=2>This tickled a neuron the other day, but I couldn't
> recall the details.</FONT>
> > </P>
> >
> > <P><FONT SIZE=2>The AltView classes were put in to reduce link times
> and sizes for large codes. The classes that have enums end up having a
> link-time cost, both in space and time. I believe this refactoring was
> done to reduce the cardinality of classes having the "sv" enum.
> My recollection is that this, and other similar "optimizations",
> had a pretty substantial impact on link-time for Blanca. Unless these are
> hurting something else, I would tend to leave them in. </FONT></P>
> >
> > <P><FONT SIZE=2>Does the CodeSourcery CVS repository have complete CVS
> history? (i.e. did we copy the repository, or just the head version?) This
> should have been easy to determine via CVS. </FONT></P>
> >
> > <P> <FONT SIZE=2>Jim</FONT>
> > </P>
> >
> > <P><FONT SIZE=2>-------------------------------------------------------
> -----------------</FONT>
> > <BR><FONT SIZE=2>James A.
> Crotinger  
> ; &
> nbsp; email: jimc at numerix.com</FONT>
> > <BR><FONT SIZE=2>NumeriX,
> LLC  
> ; &
> nbsp; phone: (505) 424-
> 4477 x104</FONT>
> > <BR><FONT SIZE=2>2960 Rodeo Park Dr. W.</FONT>
> > <BR><FONT SIZE=2>Santa Fe, NM 87505</FONT>
> > <BR><FONT SIZE=2> </FONT>
> > </P>
> >
> > <P><FONT SIZE=2>> -----Original Message-----</FONT>
> > <BR><FONT SIZE=2>> From: Richard Guenther [<A
> HREF="mailto:rguenth at tat.physik.uni-
> tuebingen.de">mailto:rguenth at tat.physik.uni-tuebingen.de</A>]</FONT>
> > <BR><FONT SIZE=2>> Sent: Tuesday, March 02, 2004 3:29 AM</FONT>
> > <BR><FONT SIZE=2>> To: pooma-dev at pooma.codesourcery.com</FONT>
> > <BR><FONT SIZE=2>> Cc: Jeffrey D. Oldham</FONT>
> > <BR><FONT SIZE=2>> Subject: Re: [pooma-dev] AltView* classes</FONT>
> > <BR><FONT SIZE=2>> </FONT>
> > <BR><FONT SIZE=2>> On Tue, 2 Mar 2004, Richard Guenther
> wrote:</FONT>
> > <BR><FONT SIZE=2>> </FONT>
> > <BR><FONT SIZE=2>> > On Fri, 27 Feb 2004, Richard Guenther
> wrote:</FONT>
> > <BR><FONT SIZE=2>> ></FONT>
> > <BR><FONT SIZE=2>> > > Hi!</FONT>
> > <BR><FONT SIZE=2>> > ></FONT>
> > <BR><FONT SIZE=2>> > > Does anyone remember the exact reason
> for the existance of the</FONT>
> > <BR><FONT SIZE=2>> AltView*</FONT>
> > <BR><FONT SIZE=2>> > > classes in Array.h and Field.h?
> Removing them and fixing their usage</FONT>
> > <BR><FONT SIZE=2>> to</FONT>
> > <BR><FONT SIZE=2>> > > use View* seems to work (full test with
> gcc 3.3 and 3.4 in progress).</FONT>
> > <BR><FONT SIZE=2>> ></FONT>
> > <BR><FONT SIZE=2>> > Testing completed with no new
> failures. Would it be ok to remove those</FONT>
> > <BR><FONT SIZE=2>> > AltView* classes?</FONT>
> > <BR><FONT SIZE=2>> </FONT>
> > <BR><FONT SIZE=2>> Which would be...</FONT>
> > <BR><FONT SIZE=2>> </FONT>
> > <BR><FONT SIZE=2>> Ok?</FONT>
> > <BR><FONT SIZE=2>> </FONT>
> > <BR><FONT SIZE=2>> Richard.</FONT>
> > <BR><FONT SIZE=2>> </FONT>
> > <BR><FONT SIZE=2>> </FONT>
> > <BR><FONT SIZE=2>> 2004Mar02 Richard Guenther
> <richard.guenther at uni-tuebingen.de></FONT>
> > <BR><FONT SIZE=2>> </FONT>
> > <BR><FONT SIZE=2>> *
> src/Array/Array.h: remove all traces of AltView0 class.</FONT>
> > <BR><FONT SIZE=2>> src/Field/Field.h:
> remove all traces of AltView1 and</FONT>
> > <BR><FONT SIZE=2>>
> AltView1Implementation classes.</FONT>
> > <BR><FONT SIZE=2>> </FONT>
> > <BR><FONT SIZE=2>> ===== Array/Array.h 1.14 vs edited =====</FONT>
> > <BR><FONT SIZE=2>> --- 1.14/r2/src/Array/Array.h Tue Dec 16 15:19:57
> 2003</FONT>
> > <BR><FONT SIZE=2>> +++
> edited/Array/Array.h Tue Mar 2
> 11:24:14 2004</FONT>
> > <BR><FONT SIZE=2>> @@ -649,8 +649,6 @@</FONT>
> > <BR><FONT SIZE=2>> // an existing engine cannot be any kind of
> slice domain.</FONT>
> > <BR><FONT SIZE=2>> // Also, bounds checking would make no
> sense because it would</FONT>
> > <BR><FONT SIZE=2>> // reduce to contains(a.domain(),
> a.domain());</FONT>
> > <BR><FONT SIZE=2>> -//</FONT>
> > <BR><FONT SIZE=2>> -// Any changes to this class should also be made
> to AltView0.</FONT>
> > <BR><FONT SIZE=2>> </FONT>
> > <BR><FONT SIZE=2>> template<int Dim, class T, class
> EngineTag></FONT>
> > <BR><FONT SIZE=2>> struct View0<Array<Dim, T,
> EngineTag> ></FONT>
> > <BR><FONT SIZE=2>> @@ -695,41 +693,6 @@</FONT>
> > <BR><FONT SIZE=2>> }</FONT>
> > <BR><FONT SIZE=2>> };</FONT>
> > <BR><FONT SIZE=2>> </FONT>
> > <BR><FONT SIZE=2>> -// AltView0 avoids an instantiation problem that
> arises when two</FONT>
> > <BR><FONT SIZE=2>> -// classes use each other. This class's
> definition should be exactly</FONT>
> > <BR><FONT SIZE=2>> -// the same as View0 except omitting member
> functions.</FONT>
> > <BR><FONT SIZE=2>> -//</FONT>
> > <BR><FONT SIZE=2>> -// Do NOT explicitly instantiate this
> class.</FONT>
> > <BR><FONT SIZE=2>> -</FONT>
> > <BR><FONT SIZE=2>> -template<class ArrayTag></FONT>
> > <BR><FONT SIZE=2>> -struct AltView0;</FONT>
> > <BR><FONT SIZE=2>> -</FONT>
> > <BR><FONT SIZE=2>> -template<int Dim, class T, class
> EngineTag></FONT>
> > <BR><FONT SIZE=2>> -struct AltView0<Array<Dim, T,
> EngineTag> ></FONT>
> > <BR><FONT SIZE=2>> -{</FONT>
> > <BR><FONT SIZE=2>> - // Convenience typedef for the thing
> we're taking a view of.</FONT>
> > <BR><FONT SIZE=2>> -</FONT>
> > <BR><FONT SIZE=2>> - typedef Array<Dim, T, EngineTag>
> Subject_t;</FONT>
> > <BR><FONT SIZE=2>> -</FONT>
> > <BR><FONT SIZE=2>> - // Deduce domains for the output
> type.</FONT>
> > <BR><FONT SIZE=2>> - // At some point, we need to fix
> NewDomain1; until then, use</FONT>
> > <BR><FONT SIZE=2>> - // the temporary version from
> Array.h.</FONT>
> > <BR><FONT SIZE=2>> -</FONT>
> > <BR><FONT SIZE=2>> - typedef typename Subject_t::Engine_t
> Engine_t;</FONT>
> > <BR><FONT SIZE=2>> - typedef typename Subject_t::Domain_t
> Domain_t;</FONT>
> > <BR><FONT SIZE=2>> -</FONT>
> > <BR><FONT SIZE=2>> - // Deduce the template parameters for the
> output type.</FONT>
> > <BR><FONT SIZE=2>> -</FONT>
> > <BR><FONT SIZE=2>> - typedef typename NewEngine<Engine_t,
> Domain_t>::Type_t NewEngine_t;</FONT>
> > <BR><FONT SIZE=2>> - enum { newDim = NewEngine_t::dimensions
> };</FONT>
> > <BR><FONT SIZE=2>> - typedef typename NewEngine_t::Tag_t
> NewEngineTag_t;</FONT>
> > <BR><FONT SIZE=2>> -</FONT>
> > <BR><FONT SIZE=2>> - // The output types.</FONT>
> > <BR><FONT SIZE=2>> -</FONT>
> > <BR><FONT SIZE=2>> - typedef Array<newDim, T,
> NewEngineTag_t> Type_t;</FONT>
> > <BR><FONT SIZE=2>> - typedef Type_t ReadType_t;</FONT>
> > <BR><FONT SIZE=2>> -};</FONT>
> > <BR><FONT SIZE=2>> -</FONT>
> > <BR><FONT SIZE=2>> template<int Dim, class T, class
> EngineTag></FONT>
> > <BR><FONT SIZE=2>> struct View1<Array<Dim, T,
> EngineTag>, int></FONT>
> > <BR><FONT SIZE=2>> {</FONT>
> > <BR><FONT SIZE=2>> @@ -1864,7 +1827,7 @@</FONT>
> > <BR><FONT SIZE=2>> /// A zero-argument version of
> operator(), which takes a view of</FONT>
> > <BR><FONT SIZE=2>> /// array's domain, is also
> supplied.</FONT>
> > <BR><FONT SIZE=2>> //@{</FONT>
> > <BR><FONT SIZE=2>> - typename
> AltView0<This_t>::ReadType_t</FONT>
> > <BR><FONT SIZE=2>> + typename
> View0<This_t>::ReadType_t</FONT>
> > <BR><FONT SIZE=2>> read() const</FONT>
> > <BR><FONT SIZE=2>> {</FONT>
> > <BR><FONT SIZE=2>> typedef
> View0<This_t> Ret_t;</FONT>
> > <BR><FONT SIZE=2>> @@ -1934,7 +1897,7 @@</FONT>
> > <BR><FONT SIZE=2>> return
> Ret_t::makeRead(*this, s1, s2, s3, s4, s5, s6, s7);</FONT>
> > <BR><FONT SIZE=2>> }</FONT>
> > <BR><FONT SIZE=2>> </FONT>
> > <BR><FONT SIZE=2>> - typename
> AltView0<This_t>::Type_t</FONT>
> > <BR><FONT SIZE=2>> + typename
> View0<This_t>::Type_t</FONT>
> > <BR><FONT SIZE=2>> operator()() const</FONT>
> > <BR><FONT SIZE=2>> {</FONT>
> > <BR><FONT SIZE=2>> typedef
> View0<This_t> Ret_t;</FONT>
> > <BR><FONT SIZE=2>> ===== Field/Field.h 1.14 vs edited =====</FONT>
> > <BR><FONT SIZE=2>> --- 1.14/r2/src/Field/Field.h Tue Dec 16 15:20:00
> 2003</FONT>
> > <BR><FONT SIZE=2>> +++
> edited/Field/Field.h Tue Mar 2
> 11:25:22 2004</FONT>
> > <BR><FONT SIZE=2>> @@ -269,9 +269,6 @@</FONT>
> > <BR><FONT SIZE=2>> * View1Implementation<Field, D,
> SV> specialization for indexing a field</FONT>
> > <BR><FONT SIZE=2>> * with a single domain. There is a
> single-valued version (SV == true)</FONT>
> > <BR><FONT SIZE=2>> * and a multi-valued version (SV ==
> false).</FONT>
> > <BR><FONT SIZE=2>> - *</FONT>
> > <BR><FONT SIZE=2>> - * Any changes to View1Implementation should
> also be made to</FONT>
> > <BR><FONT SIZE=2>> - * AltView1Implementation.</FONT>
> > <BR><FONT SIZE=2>> */</FONT>
> > <BR><FONT SIZE=2>> </FONT>
> > <BR><FONT SIZE=2>> // Single-valued version. Handles scalars
> and Locs.</FONT>
> > <BR><FONT SIZE=2>> @@ -508,62 +505,7 @@</FONT>
> > <BR><FONT SIZE=2>> </FONT>
> > <BR><FONT SIZE=2>> </FONT>
> > <BR><FONT SIZE=2>> /**</FONT>
> > <BR><FONT SIZE=2>> - * AltView1Implementation avoids an
> instantiation problem that arises</FONT>
> > <BR><FONT SIZE=2>> when two</FONT>
> > <BR><FONT SIZE=2>> - * classes use each other. This class's
> definition should be exactly</FONT>
> > <BR><FONT SIZE=2>> - * the same as View1Implementation except
> omitting member functions.</FONT>
> > <BR><FONT SIZE=2>> - *</FONT>
> > <BR><FONT SIZE=2>> - * Do NOT explicitly instantiate this
> class.</FONT>
> > <BR><FONT SIZE=2>> - */</FONT>
> > <BR><FONT SIZE=2>> -</FONT>
> > <BR><FONT SIZE=2>> -// Single-valued version. Handles scalars and
> Locs.</FONT>
> > <BR><FONT SIZE=2>> -</FONT>
> > <BR><FONT SIZE=2>> -template<class Subject, class Domain, bool
> SV></FONT>
> > <BR><FONT SIZE=2>> -struct AltView1Implementation;</FONT>
> > <BR><FONT SIZE=2>> -</FONT>
> > <BR><FONT SIZE=2>> -template<class Mesh, class T, class
> EngineTag, class Domain></FONT>
> > <BR><FONT SIZE=2>> -struct AltView1Implementation<Field<Mesh,
> T, EngineTag>, Domain, true></FONT>
> > <BR><FONT SIZE=2>> -{</FONT>
> > <BR><FONT SIZE=2>> - // Convenience typedef for the thing
> we're taking a view of.</FONT>
> > <BR><FONT SIZE=2>> -</FONT>
> > <BR><FONT SIZE=2>> - typedef Field<Mesh, T, EngineTag>
> Subject_t;</FONT>
> > <BR><FONT SIZE=2>> -</FONT>
> > <BR><FONT SIZE=2>> - // The return types are pretty simple
> here.</FONT>
> > <BR><FONT SIZE=2>> -</FONT>
> > <BR><FONT SIZE=2>> - typedef typename Subject_t::Element_t
> ReadType_t;</FONT>
> > <BR><FONT SIZE=2>> - typedef typename Subject_t::ElementRef_t
> Type_t;</FONT>
> > <BR><FONT SIZE=2>> -};</FONT>
> > <BR><FONT SIZE=2>> -</FONT>
> > <BR><FONT SIZE=2>> -template<class Mesh, class T, class
> EngineTag, class Domain></FONT>
> > <BR><FONT SIZE=2>> -struct AltView1Implementation<Field<Mesh,
> T, EngineTag>, Domain, false></FONT>
> > <BR><FONT SIZE=2>> -{</FONT>
> > <BR><FONT SIZE=2>> - // Convenience typedef for the thing
> we're taking a view of.</FONT>
> > <BR><FONT SIZE=2>> -</FONT>
> > <BR><FONT SIZE=2>> - typedef Field<Mesh, T, EngineTag>
> Subject_t;</FONT>
> > <BR><FONT SIZE=2>> -</FONT>
> > <BR><FONT SIZE=2>> - // Deduce domains for the output
> type.</FONT>
> > <BR><FONT SIZE=2>> -</FONT>
> > <BR><FONT SIZE=2>> - typedef typename Subject_t::Engine_t
> Engine_t;</FONT>
> > <BR><FONT SIZE=2>> - typedef typename NewEngine<Engine_t,
> Domain>::Type_t NewEngine_t;</FONT>
> > <BR><FONT SIZE=2>> - typedef typename NewEngine_t::Element_t
> NewT_t;</FONT>
> > <BR><FONT SIZE=2>> - typedef typename NewEngine_t::Tag_t
> NewEngineTag_t;</FONT>
> > <BR><FONT SIZE=2>> -</FONT>
> > <BR><FONT SIZE=2>> - // Deduce the new Mesh.</FONT>
> > <BR><FONT SIZE=2>> -</FONT>
> > <BR><FONT SIZE=2>> - typedef typename</FONT>
> > <BR><FONT SIZE=2>> -
> NewMeshTag<NewEngine_t::dimensions, Mesh, Domain>::Type_t</FONT>
> > <BR><FONT SIZE=2>> -
> NewMeshTag_t;</FONT>
> > <BR><FONT SIZE=2>> -</FONT>
> > <BR><FONT SIZE=2>> - // The output types.</FONT>
> > <BR><FONT SIZE=2>> -</FONT>
> > <BR><FONT SIZE=2>> - typedef Field<NewMeshTag_t, NewT_t,
> NewEngineTag_t> ReadType_t;</FONT>
> > <BR><FONT SIZE=2>> - typedef Field<NewMeshTag_t, NewT_t,
> NewEngineTag_t> Type_t;</FONT>
> > <BR><FONT SIZE=2>> -};</FONT>
> > <BR><FONT SIZE=2>> -</FONT>
> > <BR><FONT SIZE=2>> -</FONT>
> > <BR><FONT SIZE=2>> -/**</FONT>
> > <BR><FONT SIZE=2>> * View1<Field, S1>
> specialization for indexing a field with a single</FONT>
> > <BR><FONT SIZE=2>> domain.</FONT>
> > <BR><FONT SIZE=2>> - *</FONT>
> > <BR><FONT SIZE=2>> - * Any changes to View1 should also be made to
> AltView1.</FONT>
> > <BR><FONT SIZE=2>> */</FONT>
> > <BR><FONT SIZE=2>> </FONT>
> > <BR><FONT SIZE=2>> template<class Mesh, class T, class
> EngineTag, class Sub1></FONT>
> > <BR><FONT SIZE=2>> @@ -613,8 +555,6 @@</FONT>
> > <BR><FONT SIZE=2>> </FONT>
> > <BR><FONT SIZE=2>> /**</FONT>
> > <BR><FONT SIZE=2>> * View1<Field, int>
> specialization for indexing a field with an int.</FONT>
> > <BR><FONT SIZE=2>> - *</FONT>
> > <BR><FONT SIZE=2>> - * Any changes to View1 should also be made to
> AltView1.</FONT>
> > <BR><FONT SIZE=2>> */</FONT>
> > <BR><FONT SIZE=2>> </FONT>
> > <BR><FONT SIZE=2>> template<class Mesh, class T, class
> EngineTag></FONT>
> > <BR><FONT SIZE=2>> @@ -658,71 +598,6 @@</FONT>
> > <BR><FONT SIZE=2>> </FONT>
> > <BR><FONT SIZE=2>> </FONT>
> > <BR><FONT SIZE=2>> /**</FONT>
> > <BR><FONT SIZE=2>> - * AltView1 avoids an instantiation problem that
> arises when two</FONT>
> > <BR><FONT SIZE=2>> - * classes use each other. This class's
> definition should be exactly</FONT>
> > <BR><FONT SIZE=2>> - * the same as View1 except omitting member
> functions.</FONT>
> > <BR><FONT SIZE=2>> - *</FONT>
> > <BR><FONT SIZE=2>> - * Do NOT explicitly instantiate this
> class.</FONT>
> > <BR><FONT SIZE=2>> - */</FONT>
> > <BR><FONT SIZE=2>> -</FONT>
> > <BR><FONT SIZE=2>> -template<class FieldTag, class
> DomainTag></FONT>
> > <BR><FONT SIZE=2>> -struct AltView1;</FONT>
> > <BR><FONT SIZE=2>> -</FONT>
> > <BR><FONT SIZE=2>> -template<class Mesh, class T, class
> EngineTag, class Sub1></FONT>
> > <BR><FONT SIZE=2>> -struct AltView1<Field<Mesh, T,
> EngineTag>, Sub1></FONT>
> > <BR><FONT SIZE=2>> -{</FONT>
> > <BR><FONT SIZE=2>> - // Convenience typedef for the thing
> we're taking a view of.</FONT>
> > <BR><FONT SIZE=2>> -</FONT>
> > <BR><FONT SIZE=2>> - typedef Field<Mesh, T, EngineTag>
> Subject_t;</FONT>
> > <BR><FONT SIZE=2>> -</FONT>
> > <BR><FONT SIZE=2>> - // Deduce domains for the output
> type.</FONT>
> > <BR><FONT SIZE=2>> - // At some point, we need to fix
> NewDomain1; until then, use</FONT>
> > <BR><FONT SIZE=2>> - // the temporary version from
> NewDomain.h.</FONT>
> > <BR><FONT SIZE=2>> -</FONT>
> > <BR><FONT SIZE=2>> - typedef typename Subject_t::Domain_t
> Domain_t;</FONT>
> > <BR><FONT SIZE=2>> - typedef TemporaryNewDomain1<Domain_t,
> Sub1> NewDomain_t;</FONT>
> > <BR><FONT SIZE=2>> - typedef typename NewDomain_t::SliceType_t
> SDomain_t;</FONT>
> > <BR><FONT SIZE=2>> -</FONT>
> > <BR><FONT SIZE=2>> - // Deduce appropriate version of
> implementation to dispatch to.</FONT>
> > <BR><FONT SIZE=2>> -</FONT>
> > <BR><FONT SIZE=2>> - enum { sv =
> DomainTraits<SDomain_t>::singleValued };</FONT>
> > <BR><FONT SIZE=2>> - typedef
> AltView1Implementation<Subject_t, SDomain_t, sv> Dispatch_t;</FONT>
> > <BR><FONT SIZE=2>> -</FONT>
> > <BR><FONT SIZE=2>> - // The optimized domain combiner.</FONT>
> > <BR><FONT SIZE=2>> -</FONT>
> > <BR><FONT SIZE=2>> - typedef CombineDomainOpt<NewDomain_t,
> sv> Combine_t;</FONT>
> > <BR><FONT SIZE=2>> -</FONT>
> > <BR><FONT SIZE=2>> - // The return types.</FONT>
> > <BR><FONT SIZE=2>> -</FONT>
> > <BR><FONT SIZE=2>> - typedef typename Dispatch_t::ReadType_t
> ReadType_t;</FONT>
> > <BR><FONT SIZE=2>> - typedef typename Dispatch_t::Type_t
> Type_t;</FONT>
> > <BR><FONT SIZE=2>> -};</FONT>
> > <BR><FONT SIZE=2>> -</FONT>
> > <BR><FONT SIZE=2>> -</FONT>
> > <BR><FONT SIZE=2>> -/**</FONT>
> > <BR><FONT SIZE=2>> - * AltView1 avoids an instantiation problem that
> arises when two</FONT>
> > <BR><FONT SIZE=2>> - * classes use each other. This class's
> definition should be exactly</FONT>
> > <BR><FONT SIZE=2>> - * the same as View1 except omitting member
> functions.</FONT>
> > <BR><FONT SIZE=2>> - *</FONT>
> > <BR><FONT SIZE=2>> - * Do NOT explicitly instantiate this
> class.</FONT>
> > <BR><FONT SIZE=2>> - */</FONT>
> > <BR><FONT SIZE=2>> -</FONT>
> > <BR><FONT SIZE=2>> -template<class Mesh, class T, class
> EngineTag></FONT>
> > <BR><FONT SIZE=2>> -struct AltView1<Field<Mesh, T,
> EngineTag>, int></FONT>
> > <BR><FONT SIZE=2>> -{</FONT>
> > <BR><FONT SIZE=2>> - // Convenience typedef for the thing
> we're taking a view of.</FONT>
> > <BR><FONT SIZE=2>> -</FONT>
> > <BR><FONT SIZE=2>> - typedef Field<Mesh, T, EngineTag>
> Subject_t;</FONT>
> > <BR><FONT SIZE=2>> -</FONT>
> > <BR><FONT SIZE=2>> - // The return types.</FONT>
> > <BR><FONT SIZE=2>> -</FONT>
> > <BR><FONT SIZE=2>> - typedef typename Subject_t::Element_t
> ReadType_t;</FONT>
> > <BR><FONT SIZE=2>> - typedef typename Subject_t::ElementRef_t
> Type_t;</FONT>
> > <BR><FONT SIZE=2>> -</FONT>
> > <BR><FONT SIZE=2>> -};</FONT>
> > <BR><FONT SIZE=2>> -</FONT>
> > <BR><FONT SIZE=2>> -</FONT>
> > <BR><FONT SIZE=2>> -/**</FONT>
> > <BR><FONT SIZE=2>> * View2<Field, S1, S2>
> specialization for indexing a field with two</FONT>
> > <BR><FONT SIZE=2>> * domains.</FONT>
> > <BR><FONT SIZE=2>> */</FONT>
> > <BR><FONT SIZE=2>> @@ -1455,14 +1330,14 @@</FONT>
> > <BR><FONT SIZE=2>> /// point fields the viewing
> domain is an actual centering domain.</FONT>
> > <BR><FONT SIZE=2>> //@{</FONT>
> > <BR><FONT SIZE=2>> </FONT>
> > <BR><FONT SIZE=2>> - inline typename AltView1<This_t,
> Domain_t>::ReadType_t</FONT>
> > <BR><FONT SIZE=2>> + inline typename View1<This_t,
> Domain_t>::ReadType_t</FONT>
> > <BR><FONT SIZE=2>> read() const</FONT>
> > <BR><FONT SIZE=2>> {</FONT>
> > <BR><FONT SIZE=2>> typedef
> View1<This_t, Domain_t> Ret_t;</FONT>
> > <BR><FONT SIZE=2>> return
> Ret_t::makeRead(*this, physicalDomain());</FONT>
> > <BR><FONT SIZE=2>> }</FONT>
> > <BR><FONT SIZE=2>> </FONT>
> > <BR><FONT SIZE=2>> - inline typename AltView1<This_t,
> Domain_t>::ReadType_t</FONT>
> > <BR><FONT SIZE=2>> + inline typename View1<This_t,
> Domain_t>::ReadType_t</FONT>
> > <BR><FONT SIZE=2>> readAll() const</FONT>
> > <BR><FONT SIZE=2>> {</FONT>
> > <BR><FONT SIZE=2>> typedef
> View1<This_t, Domain_t> Ret_t;</FONT>
> > <BR><FONT SIZE=2>> @@ -1470,7 +1345,7 @@</FONT>
> > <BR><FONT SIZE=2>> }</FONT>
> > <BR><FONT SIZE=2>> </FONT>
> > <BR><FONT SIZE=2>> template<class
> Sub1></FONT>
> > <BR><FONT SIZE=2>> - inline typename AltView1<This_t,
> Sub1>::ReadType_t</FONT>
> > <BR><FONT SIZE=2>> + inline typename View1<This_t,
> Sub1>::ReadType_t</FONT>
> > <BR><FONT SIZE=2>> read(const Sub1 &s1)
> const</FONT>
> > <BR><FONT SIZE=2>> {</FONT>
> > <BR><FONT SIZE=2>> typedef
> View1<This_t, Sub1> Ret_t;</FONT>
> > <BR><FONT SIZE=2>> @@ -1493,14 +1368,14 @@</FONT>
> > <BR><FONT SIZE=2>> return
> Ret_t::makeRead(*this, s1, s2, s3);</FONT>
> > <BR><FONT SIZE=2>> }</FONT>
> > <BR><FONT SIZE=2>> </FONT>
> > <BR><FONT SIZE=2>> - inline typename AltView1<This_t,
> Domain_t>::Type_t</FONT>
> > <BR><FONT SIZE=2>> + inline typename View1<This_t,
> Domain_t>::Type_t</FONT>
> > <BR><FONT SIZE=2>> operator()() const</FONT>
> > <BR><FONT SIZE=2>> {</FONT>
> > <BR><FONT SIZE=2>> typedef
> View1<This_t, Domain_t> Ret_t;</FONT>
> > <BR><FONT SIZE=2>> return
> Ret_t::make(*this, physicalDomain());</FONT>
> > <BR><FONT SIZE=2>> }</FONT>
> > <BR><FONT SIZE=2>> </FONT>
> > <BR><FONT SIZE=2>> - inline typename AltView1<This_t,
> Domain_t>::Type_t</FONT>
> > <BR><FONT SIZE=2>> + inline typename View1<This_t,
> Domain_t>::Type_t</FONT>
> > <BR><FONT SIZE=2>> all() const</FONT>
> > <BR><FONT SIZE=2>> {</FONT>
> > <BR><FONT SIZE=2>> typedef
> View1<This_t, Domain_t> Ret_t;</FONT>
> > <BR><FONT SIZE=2>> @@ -1508,7 +1383,7 @@</FONT>
> > <BR><FONT SIZE=2>> }</FONT>
> > <BR><FONT SIZE=2>> </FONT>
> > <BR><FONT SIZE=2>> template<class
> Sub1></FONT>
> > <BR><FONT SIZE=2>> - inline typename AltView1<This_t,
> Sub1>::Type_t</FONT>
> > <BR><FONT SIZE=2>> + inline typename View1<This_t,
> Sub1>::Type_t</FONT>
> > <BR><FONT SIZE=2>> operator()(const Sub1 &s1)
> const</FONT>
> > <BR><FONT SIZE=2>> {</FONT>
> > <BR><FONT SIZE=2>> typedef
> View1<This_t, Sub1> Ret_t;</FONT>
> > </P>
> >
> > </BODY>
> > </HTML>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://sourcerytools.com/pipermail/pooma-dev/attachments/20040302/23f34de7/attachment.html>
More information about the pooma-dev
mailing list