[pooma-dev] Is Default Constructable really required?

Jeffrey Oldham oldham at codesourcery.com
Mon Mar 11 23:25:52 UTC 2002


On Thu, Mar 07, 2002 at 05:36:37PM -0700, John H. Hall wrote:
> Gang:
> In the notes on Relations (in relations.h, copied below) it states "The 
> RelationFunctor must be Default Constructable...", yet from the use of 
> it, I don't see any actual requirement for this. It seems we just pass 
> around const references and use the alternate required constructor 
> mentioned below, along with a copy constructor. I need to set up some 
> state in my RelationFunctors and I would prefer to do it during 
> construction, along with providing the correct copy constructors and a 
> version of this required constructor which is essentially a copy 
> constructor++.
> 
> So I guess my question boils down to: "How do I set and keep state in 
> RelationFunctors?" Any non-trivial use of Relations will require this.

I concur with your analysis.  See src/Field/Relations/PeriodicFaceBC.h
for an example.  It does not have a default constructor but does have
a non-default, non-copy constructor.

I have attached a patch aligning the comments to the extant source
code.  Would someone (Scott? Stephen?) approve these changes?  I also
added the (gratituous) change of s/L/Target/.

Thanks,
Jeffrey D. Oldham
oldham at codesourcery.com

2002Mar11  Jeffrey D. Oldham  <oldham at codesourcery.com>

	This patch corrects functor requirement comments and improves them
	by replacing "L" by "Target".
	
	* Relations.h (Relation[0-6]): Change introductory comment, replacing
	"Default Constructable" with "Copy Constructible."  Change
	constructor specification to list "RelationFunctor" first.  Change
	"L" to "Target".
	(RelationFunctionPtr[0-6]): Change template parameter's name from
	"L" to "Target".
	(RelationMemberPtr[0-6]): Likewise.
	(newRelation): Likewise.
	(functionPtr): Likewise.
	(memberPtr): Likewise.

Tested on sequential Linux using g++ by compiling Pooma library and
	running all Field tests.
Approved by	??you??
Applied to	mainline
-------------- next part --------------
Index: Relations.h
===================================================================
RCS file: /home/pooma/Repository/r2/src/Field/Relations/Relations.h,v
retrieving revision 1.2
diff -c -p -r1.2 Relations.h
*** Relations.h	2001/10/12 17:58:43	1.2
--- Relations.h	2002/03/11 23:11:51
*************** private:
*** 105,122 ****
  // ----------------------------------------------------------------------------
  // Relation0 is a template used to construct relations, such as boundary
  // conditions, that do not depend on additional fields. The Target must be
! // a Field. The RelationFunctor must be Default Constructable and Assignable.
  // In addition, it must provide the constructor
  //
! //   template<class L>
! //   RelationFunctor(const L &, const RelationFunctor &)
  //
  // and the member function
  //
! //   template<class L>
! //   void operator()(const L &) const
  //
! // where L is a Field. The constructor should use the arguments to
  // initialize itself and the function should apply the relation.
  // ----------------------------------------------------------------------------
  
--- 105,122 ----
  // ----------------------------------------------------------------------------
  // Relation0 is a template used to construct relations, such as boundary
  // conditions, that do not depend on additional fields. The Target must be
! // a Field. The RelationFunctor must be Copy Constructible and Assignable.
  // In addition, it must provide the constructor
  //
! //   template<class Target>
! //   RelationFunctor(const RelationFunctor &, const Target &)
  //
  // and the member function
  //
! //   template<class Target>
! //   void operator()(const Target &) const
  //
! // where Target is a Field. The constructor should use the arguments to
  // initialize itself and the function should apply the relation.
  // ----------------------------------------------------------------------------
  
*************** public:
*** 159,177 ****
  // ----------------------------------------------------------------------------
  // Relation1 is a template used to construct relations that depend on one
  // additional field (e.g., a = b). The Target must be
! // a Field. The RelationFunctor must be Default Constructable and Assignable.
  // In addition, it must provide the constructor
  //
! //   template<class L, class R1, class R2>
! //   RelationFunctor(const L &, const R1 &, 
! //                   const RelationFunctor &)
  //
  // and the member function
  //
! //   template<class L, class R1>
! //   void operator()(const L &const R1 &) const
  //
! // where L and R1 are Fields. The constructor should use the arguments to
  // initialize itself and the function should apply the relation.
  // ----------------------------------------------------------------------------
  
--- 159,177 ----
  // ----------------------------------------------------------------------------
  // Relation1 is a template used to construct relations that depend on one
  // additional field (e.g., a = b). The Target must be
! // a Field. The RelationFunctor must be Copy Constructible and Assignable.
  // In addition, it must provide the constructor
  //
! //   template<class Target, class R1, class R2>
! //   RelationFunctor(const RelationFunctor &, const Target &, const R1 &)
! //
  //
  // and the member function
  //
! //   template<class Target, class R1>
! //   void operator()(const Target &, const R1 &) const
  //
! // where Target and R1 are Fields. The constructor should use the arguments to
  // initialize itself and the function should apply the relation.
  // ----------------------------------------------------------------------------
  
*************** protected:
*** 221,240 ****
  // ----------------------------------------------------------------------------
  // Relation2 is a template used to construct relations that depend on two
  // additional fields (e.g., a = b + c). The Target must be
! // a Field. The RelationFunctor must be Default Constructable and Assignable.
  // In addition, it must provide the constructor
  //
! //   template<class L, class R1, class R2>
! //   RelationFunctor(const L &, const R1 &, const R2 &, 
! //                   const RelationFunctor &)
  //
  // and the member function
  //
! //   template<class L, class R1, class R2>
! //   void operator()(const L &const R1 &, const R2 &) const
  //
! // where L, R1, and R2 are Fields. The constructor should use the arguments to
! // initialize itself and the function should apply the relation.
  // ----------------------------------------------------------------------------
  
  template<class Target, class R1, class R2, class RelationFunctor>
--- 221,241 ----
  // ----------------------------------------------------------------------------
  // Relation2 is a template used to construct relations that depend on two
  // additional fields (e.g., a = b + c). The Target must be
! // a Field. The RelationFunctor must be Copy Constructible and Assignable.
  // In addition, it must provide the constructor
  //
! //   template<class Target, class R1, class R2>
! //   RelationFunctor(const RelationFunctor &,
! //	             const Target &, const R1 &, const R2 &)
  //
  // and the member function
  //
! //   template<class Target, class R1, class R2>
! //   void operator()(const Target &, const R1 &, const R2 &) const
  //
! // where Target, R1, and R2 are Fields. The constructor should use the
! // arguments to initialize itself and the function should apply the
! // relation.
  // ----------------------------------------------------------------------------
  
  template<class Target, class R1, class R2, class RelationFunctor>
*************** protected:
*** 285,303 ****
  // ----------------------------------------------------------------------------
  // Relation3 is a template used to construct relations that depend on three
  // additional fields (e.g., a = b + c + d). The Target must be
! // a Field. The RelationFunctor must be Default Constructable and Assignable.
  // In addition, it must provide the constructor
  //
! //   template<class L, class R1, class R2, class R3>
! //   RelationFunctor(const L &, const R1 &, const R2 &, const R3 &,
  //                   const RelationFunctor &)
  //
  // and the member function
  //
! //   template<class L, class R1, class R2, class R3>
! //   void operator()(const L &const R1 &, const R2 &, const R3 &) const
  //
! // where L, R1, R2, and R3 are Fields. The constructor should use 
  // the arguments to initialize itself and the function should apply the 
  // relation.
  // ----------------------------------------------------------------------------
--- 286,304 ----
  // ----------------------------------------------------------------------------
  // Relation3 is a template used to construct relations that depend on three
  // additional fields (e.g., a = b + c + d). The Target must be
! // a Field. The RelationFunctor must be Copy Constructible and Assignable.
  // In addition, it must provide the constructor
  //
! //   template<class Target, class R1, class R2, class R3>
! //   RelationFunctor(const Target &, const R1 &, const R2 &, const R3 &,
  //                   const RelationFunctor &)
  //
  // and the member function
  //
! //   template<class Target, class R1, class R2, class R3>
! //   void operator()(const Target &const R1 &, const R2 &, const R3 &) const
  //
! // where Target, R1, R2, and R3 are Fields. The constructor should use 
  // the arguments to initialize itself and the function should apply the 
  // relation.
  // ----------------------------------------------------------------------------
*************** protected:
*** 355,374 ****
  // ----------------------------------------------------------------------------
  // Relation4 is a template used to construct relations that depend on four
  // additional fields (e.g., a = b + c + d + e). The Target must be
! // a Field. The RelationFunctor must be Default Constructable and Assignable.
  // In addition, it must provide the constructor
  //
! //   template<class L, class R1, class R2, class R3, class R4>
! //   RelationFunctor(const L &, const R1 &, const R2 &, const R3 &,
! //                   const R4 &, const RelationFunctor &)
  //
  // and the member function
  //
! //   template<class L, class R1, class R2, class R3, class R4>
! //   void operator()(const L &const R1 &, const R2 &, const R3 &,
  //                   const R4 &) const
  //
! // where L, R1, R2, R3, and R4 are Fields. The constructor should use 
  // the arguments to initialize itself and the function should apply the 
  // relation.
  // ----------------------------------------------------------------------------
--- 356,376 ----
  // ----------------------------------------------------------------------------
  // Relation4 is a template used to construct relations that depend on four
  // additional fields (e.g., a = b + c + d + e). The Target must be
! // a Field. The RelationFunctor must be Copy Constructible and Assignable.
  // In addition, it must provide the constructor
  //
! //   template<class Target, class R1, class R2, class R3, class R4>
! //   RelationFunctor(const RelationFunctor &,
! //                   const Target &, const R1 &, const R2 &, const R3 &,
! //                   const R4 &)
  //
  // and the member function
  //
! //   template<class Target, class R1, class R2, class R3, class R4>
! //   void operator()(const Target &, const R1 &, const R2 &, const R3 &,
  //                   const R4 &) const
  //
! // where Target, R1, R2, R3, and R4 are Fields. The constructor should use 
  // the arguments to initialize itself and the function should apply the 
  // relation.
  // ----------------------------------------------------------------------------
*************** protected:
*** 430,449 ****
  // ----------------------------------------------------------------------------
  // Relation5 is a template used to construct relations that depend on five
  // additional fields (e.g., a = b + c + d + e + f). The Target must be
! // a Field. The RelationFunctor must be Default Constructable and Assignable.
  // In addition, it must provide the constructor
  //
! //   template<class L, class R1, class R2, class R3, class R4, class R5>
! //   RelationFunctor(const L &, const R1 &, const R2 &, const R3 &,
! //                   const R4 &, const R5 &, const RelationFunctor &)
  //
  // and the member function
  //
! //   template<class L, class R1, class R2, class R3, class R4, class R5>
! //   void operator()(const L &const R1 &, const R2 &, const R3 &,
  //                   const R4 &, const R5 &) const
  //
! // where L, R1, R2, R3, R4, and R5 are Fields. The constructor should use 
  // the arguments to initialize itself and the function should apply the 
  // relation.
  // ----------------------------------------------------------------------------
--- 432,452 ----
  // ----------------------------------------------------------------------------
  // Relation5 is a template used to construct relations that depend on five
  // additional fields (e.g., a = b + c + d + e + f). The Target must be
! // a Field. The RelationFunctor must be Copy Constructible and Assignable.
  // In addition, it must provide the constructor
  //
! //   template<class Target, class R1, class R2, class R3, class R4, class R5>
! //   RelationFunctor(const RelationFunctor &,
! //		     const Target &, const R1 &, const R2 &, const R3 &,
! //                   const R4 &, const R5 &)
  //
  // and the member function
  //
! //   template<class Target, class R1, class R2, class R3, class R4, class R5>
! //   void operator()(const Target &, const R1 &, const R2 &, const R3 &,
  //                   const R4 &, const R5 &) const
  //
! // where Target, R1, R2, R3, R4, and R5 are Fields. The constructor should use 
  // the arguments to initialize itself and the function should apply the 
  // relation.
  // ----------------------------------------------------------------------------
*************** protected:
*** 508,532 ****
  // ----------------------------------------------------------------------------
  // Relation6 is a template used to construct relations that depend on six
  // additional fields (e.g., a = b + c + d + e + f + g). The Target must be
! // a Field. The RelationFunctor must be Default Constructable and Assignable.
  // In addition, it must provide the constructor
  //
! //   template<class L, class R1, class R2, class R3, class R4, class R5,
  //            class R6>
! //   RelationFunctor(const L &, const R1 &, const R2 &, const R3 &,
! //                   const R4 &, const R5 &, const R6 &, 
! //                   const RelationFunctor &)
  //
  // and the member function
  //
! //   template<class L, class R1, class R2, class R3, class R4, class R5,
  //            class R6>
! //   void operator()(const L &const R1 &, const R2 &, const R3 &,
  //                   const R4 &, const R5 &, const R6 &) const
  //
! // where L, R1, R2, R3, R4, R5, and R6 are Fields. The constructor should use 
! // the arguments to initialize itself and the function should apply the 
! // relation.
  // ----------------------------------------------------------------------------
  
  template<class Target, class R1, class R2, class R3, class R4, class R5,
--- 511,535 ----
  // ----------------------------------------------------------------------------
  // Relation6 is a template used to construct relations that depend on six
  // additional fields (e.g., a = b + c + d + e + f + g). The Target must be
! // a Field. The RelationFunctor must be Copy Constructible and Assignable.
  // In addition, it must provide the constructor
  //
! //   template<class Target, class R1, class R2, class R3, class R4, class R5,
  //            class R6>
! //   RelationFunctor(const RelationFunctor &,
! //		     const Target &, const R1 &, const R2 &, const R3 &,
! //                   const R4 &, const R5 &, const R6 &)
  //
  // and the member function
  //
! //   template<class Target, class R1, class R2, class R3, class R4, class R5,
  //            class R6>
! //   void operator()(const Target &, const R1 &, const R2 &, const R3 &,
  //                   const R4 &, const R5 &, const R6 &) const
  //
! // where Target, R1, R2, R3, R4, R5, and R6 are Fields. The
! // constructor should use the arguments to initialize itself and the
! // function should apply the relation.
  // ----------------------------------------------------------------------------
  
  template<class Target, class R1, class R2, class R3, class R4, class R5,
*************** protected:
*** 593,679 ****
  // Relation functors supporting the use of function pointers.
  //-----------------------------------------------------------------------------
  
! template<class L>
  class RelationFunctionPtr0 {
  public:
  
!   RelationFunctionPtr0(void (*f)(const L &)) 
    : f_m(f) 
    { }
!   RelationFunctionPtr0(const RelationFunctionPtr0<L> &init, const L &)
    : f_m(init.f_m) 
    { }
      
!   inline void operator()(const L &l)
    {
      f_m(l);
    }
  
  private:
  
!   void (*f_m)(const L &);
  };
  
! template<class L, class R1>
  class RelationFunctionPtr1 {
  public:
  
!   RelationFunctionPtr1(void (*f)(const L &, const R1 &)) 
    : f_m(f) 
    { }
!   RelationFunctionPtr1(const RelationFunctionPtr1<L, R1> &init, const L &)
    : f_m(init.f_m) 
    { }
      
!   inline void operator()(const L &l, const R1 &r1)
    {
      f_m(l, r1);
    }
  
  private:
  
!   void (*f_m)(const L &, const R1 &);
  };
  
! template<class L, class R1, class R2>
  class RelationFunctionPtr2 {
  public:
  
!   RelationFunctionPtr2(void (*f)(const L &, const R1 &, const R2 &)) 
    : f_m(f) 
    { }
!   RelationFunctionPtr2(const RelationFunctionPtr2<L, R1, R2> &init, const L &)
    : f_m(init.f_m) 
    { }
      
!   inline void operator()(const L &l, const R1 &r1, const R2 &r2)
    {
      f_m(l, r1, r2);
    }
  
  private:
  
!   void (*f_m)(const L &, const R1 &, const R2 &);
  };
  
! template<class L, class R1, class R2, class R3>
  class RelationFunctionPtr3 {
  public:
  
!   RelationFunctionPtr3(void (*f)(const L &, 
      const R1 &, const R2 &, const R3 &)) 
    : f_m(f) 
    { }
    RelationFunctionPtr3(
!     const RelationFunctionPtr3<L, R1, R2, R3> &model)
    : f_m(model.f_m)
    { }
    RelationFunctionPtr3(
!     const RelationFunctionPtr3<L, R1, R2, R3> &init, const L &)
    : f_m(init.f_m) 
    { }
      
!   inline void operator()(const L &l, const R1 &r1, const R2 &r2, 
      const R3 &r3)
    {
      f_m(l, r1, r2, r3);
--- 596,682 ----
  // Relation functors supporting the use of function pointers.
  //-----------------------------------------------------------------------------
  
! template<class Target>
  class RelationFunctionPtr0 {
  public:
  
!   RelationFunctionPtr0(void (*f)(const Target &)) 
    : f_m(f) 
    { }
!   RelationFunctionPtr0(const RelationFunctionPtr0<Target> &init, const Target &)
    : f_m(init.f_m) 
    { }
      
!   inline void operator()(const Target &l)
    {
      f_m(l);
    }
  
  private:
  
!   void (*f_m)(const Target &);
  };
  
! template<class Target, class R1>
  class RelationFunctionPtr1 {
  public:
  
!   RelationFunctionPtr1(void (*f)(const Target &, const R1 &)) 
    : f_m(f) 
    { }
!   RelationFunctionPtr1(const RelationFunctionPtr1<Target, R1> &init, const Target &)
    : f_m(init.f_m) 
    { }
      
!   inline void operator()(const Target &l, const R1 &r1)
    {
      f_m(l, r1);
    }
  
  private:
  
!   void (*f_m)(const Target &, const R1 &);
  };
  
! template<class Target, class R1, class R2>
  class RelationFunctionPtr2 {
  public:
  
!   RelationFunctionPtr2(void (*f)(const Target &, const R1 &, const R2 &)) 
    : f_m(f) 
    { }
!   RelationFunctionPtr2(const RelationFunctionPtr2<Target, R1, R2> &init, const Target &)
    : f_m(init.f_m) 
    { }
      
!   inline void operator()(const Target &l, const R1 &r1, const R2 &r2)
    {
      f_m(l, r1, r2);
    }
  
  private:
  
!   void (*f_m)(const Target &, const R1 &, const R2 &);
  };
  
! template<class Target, class R1, class R2, class R3>
  class RelationFunctionPtr3 {
  public:
  
!   RelationFunctionPtr3(void (*f)(const Target &, 
      const R1 &, const R2 &, const R3 &)) 
    : f_m(f) 
    { }
    RelationFunctionPtr3(
!     const RelationFunctionPtr3<Target, R1, R2, R3> &model)
    : f_m(model.f_m)
    { }
    RelationFunctionPtr3(
!     const RelationFunctionPtr3<Target, R1, R2, R3> &init, const Target &)
    : f_m(init.f_m) 
    { }
      
!   inline void operator()(const Target &l, const R1 &r1, const R2 &r2, 
      const R3 &r3)
    {
      f_m(l, r1, r2, r3);
*************** public:
*** 681,707 ****
  
  private:
  
!   void (*f_m)(const L &, const R1 &, const R2 &, const R3 &);
  };
  
! template<class L, class R1, class R2, class R3, class R4>
  class RelationFunctionPtr4 {
  public:
  
!   RelationFunctionPtr4(void (*f)(const L &, 
      const R1 &, const R2 &, const R3 &, const R4 &)) 
    : f_m(f) 
    { }
    RelationFunctionPtr4(
!     const RelationFunctionPtr4<L, R1, R2, R3, R4> &model)
    : f_m(model.f_m)
    { }
    RelationFunctionPtr4(
!     const RelationFunctionPtr4<L, R1, R2, R3, R4> &init, const L &)
    : f_m(init.f_m) 
    { }
      
!   inline void operator()(const L &l, const R1 &r1, const R2 &r2, 
      const R3 &r3, const R4 &r4)
    {
      f_m(l, r1, r2, r3, r4);
--- 684,710 ----
  
  private:
  
!   void (*f_m)(const Target &, const R1 &, const R2 &, const R3 &);
  };
  
! template<class Target, class R1, class R2, class R3, class R4>
  class RelationFunctionPtr4 {
  public:
  
!   RelationFunctionPtr4(void (*f)(const Target &, 
      const R1 &, const R2 &, const R3 &, const R4 &)) 
    : f_m(f) 
    { }
    RelationFunctionPtr4(
!     const RelationFunctionPtr4<Target, R1, R2, R3, R4> &model)
    : f_m(model.f_m)
    { }
    RelationFunctionPtr4(
!     const RelationFunctionPtr4<Target, R1, R2, R3, R4> &init, const Target &)
    : f_m(init.f_m) 
    { }
      
!   inline void operator()(const Target &l, const R1 &r1, const R2 &r2, 
      const R3 &r3, const R4 &r4)
    {
      f_m(l, r1, r2, r3, r4);
*************** public:
*** 709,737 ****
  
  private:
  
!   void (*f_m)(const L &, const R1 &, const R2 &, 
      const R3 &, const R4 &);
  };
  
! template<class L, 
    class R1, class R2, class R3, class R4, class R5>
  class RelationFunctionPtr5 {
  public:
  
!   RelationFunctionPtr5(void (*f)(const L &, 
      const R1 &, const R2 &, const R3 &, const R4 &, const R5 &)) 
    : f_m(f) 
    { }
    RelationFunctionPtr5(
!     const RelationFunctionPtr5<L, R1, R2, R3, R4, R5> &model)
    : f_m(model.f_m)
    { }
    RelationFunctionPtr5(
!     const RelationFunctionPtr5<L, R1, R2, R3, R4, R5> &init, const L &)
    : f_m(init.f_m) 
    { }
      
!   inline void operator()(const L &l, const R1 &r1, const R2 &r2, 
      const R3 &r3, const R4 &r4, const R5 &r5)
    {
      f_m(l, r1, r2, r3, r4, r5);
--- 712,740 ----
  
  private:
  
!   void (*f_m)(const Target &, const R1 &, const R2 &, 
      const R3 &, const R4 &);
  };
  
! template<class Target, 
    class R1, class R2, class R3, class R4, class R5>
  class RelationFunctionPtr5 {
  public:
  
!   RelationFunctionPtr5(void (*f)(const Target &, 
      const R1 &, const R2 &, const R3 &, const R4 &, const R5 &)) 
    : f_m(f) 
    { }
    RelationFunctionPtr5(
!     const RelationFunctionPtr5<Target, R1, R2, R3, R4, R5> &model)
    : f_m(model.f_m)
    { }
    RelationFunctionPtr5(
!     const RelationFunctionPtr5<Target, R1, R2, R3, R4, R5> &init, const Target &)
    : f_m(init.f_m) 
    { }
      
!   inline void operator()(const Target &l, const R1 &r1, const R2 &r2, 
      const R3 &r3, const R4 &r4, const R5 &r5)
    {
      f_m(l, r1, r2, r3, r4, r5);
*************** public:
*** 739,767 ****
  
  private:
  
!   void (*f_m)(const L &, const R1 &, const R2 &, 
      const R3 &, const R4 &, const R5 &);
  };
  
! template<class L, 
    class R1, class R2, class R3, class R4, class R5, class R6>
  class RelationFunctionPtr6 {
  public:
  
!   RelationFunctionPtr6(void (*f)(const L &, 
      const R1 &, const R2 &, const R3 &, const R4 &, const R5 &, const R6 &)) 
    : f_m(f) 
    { }
    RelationFunctionPtr6(
!     const RelationFunctionPtr6<L, R1, R2, R3, R4, R5, R6> &model)
    : f_m(model.f_m)
    { }
    RelationFunctionPtr6(
!     const RelationFunctionPtr6<L, R1, R2, R3, R4, R5, R6> &init, const L &)
    : f_m(init.f_m) 
    { }
      
!   inline void operator()(const L &l, const R1 &r1, const R2 &r2, 
      const R3 &r3, const R4 &r4, const R5 &r5, const R6 &r6)
    {
      f_m(l, r1, r2, r3, r4, r5, r6);
--- 742,770 ----
  
  private:
  
!   void (*f_m)(const Target &, const R1 &, const R2 &, 
      const R3 &, const R4 &, const R5 &);
  };
  
! template<class Target, 
    class R1, class R2, class R3, class R4, class R5, class R6>
  class RelationFunctionPtr6 {
  public:
  
!   RelationFunctionPtr6(void (*f)(const Target &, 
      const R1 &, const R2 &, const R3 &, const R4 &, const R5 &, const R6 &)) 
    : f_m(f) 
    { }
    RelationFunctionPtr6(
!     const RelationFunctionPtr6<Target, R1, R2, R3, R4, R5, R6> &model)
    : f_m(model.f_m)
    { }
    RelationFunctionPtr6(
!     const RelationFunctionPtr6<Target, R1, R2, R3, R4, R5, R6> &init, const Target &)
    : f_m(init.f_m) 
    { }
      
!   inline void operator()(const Target &l, const R1 &r1, const R2 &r2, 
      const R3 &r3, const R4 &r4, const R5 &r5, const R6 &r6)
    {
      f_m(l, r1, r2, r3, r4, r5, r6);
*************** public:
*** 769,775 ****
  
  private:
  
!   void (*f_m)(const L &, const R1 &, const R2 &, 
      const R3 &, const R4 &, const R5 &, const R6 &);
  };
  
--- 772,778 ----
  
  private:
  
!   void (*f_m)(const Target &, const R1 &, const R2 &, 
      const R3 &, const R4 &, const R5 &, const R6 &);
  };
  
*************** private:
*** 778,798 ****
  // Relation functors supporting the use of member function pointers.
  //-----------------------------------------------------------------------------
  
! template<class C, class L>
  class RelationMemberPtr0 {
  public:
  
!   RelationMemberPtr0(const C &obj, void (C::*f)(const L &)) 
    : obj_m(obj), f_m(f) 
    { }
!   RelationMemberPtr0(const RelationMemberPtr0<C, L> &model)
    : obj_m(model.obj_m), f_m(model.f_m)
    { }
!   RelationMemberPtr0(const RelationMemberPtr0<C, L> &init, const L &)
    : obj_m(init.obj_m), f_m(init.f_m) 
    { }
      
!   inline void operator()(const L &l)
    {
      (obj_m.*f_m)(l);
    }
--- 781,801 ----
  // Relation functors supporting the use of member function pointers.
  //-----------------------------------------------------------------------------
  
! template<class C, class Target>
  class RelationMemberPtr0 {
  public:
  
!   RelationMemberPtr0(const C &obj, void (C::*f)(const Target &)) 
    : obj_m(obj), f_m(f) 
    { }
!   RelationMemberPtr0(const RelationMemberPtr0<C, Target> &model)
    : obj_m(model.obj_m), f_m(model.f_m)
    { }
!   RelationMemberPtr0(const RelationMemberPtr0<C, Target> &init, const Target &)
    : obj_m(init.obj_m), f_m(init.f_m) 
    { }
      
!   inline void operator()(const Target &l)
    {
      (obj_m.*f_m)(l);
    }
*************** public:
*** 800,824 ****
  private:
  
    C obj_m;
!   void (C::*f_m)(const L &);
  };
  
! template<class C, class L, class R1>
  class RelationMemberPtr1 {
  public:
  
!   RelationMemberPtr1(const C &obj, void (C::*f)(const L &, 
      const R1 &)) 
    : obj_m(obj), f_m(f) 
    { }
!   RelationMemberPtr1(const RelationMemberPtr1<C, L, R1> &model)
    : obj_m(model.obj_m), f_m(model.f_m)
    { }
!   RelationMemberPtr1(const RelationMemberPtr1<C, L, R1> &init, const L &)
    : obj_m(init.obj_m), f_m(init.f_m) 
    { }
      
!   inline void operator()(const L &l, const R1 &r1)
    {
      (obj_m.*f_m)(l, r1);
    }
--- 803,827 ----
  private:
  
    C obj_m;
!   void (C::*f_m)(const Target &);
  };
  
! template<class C, class Target, class R1>
  class RelationMemberPtr1 {
  public:
  
!   RelationMemberPtr1(const C &obj, void (C::*f)(const Target &, 
      const R1 &)) 
    : obj_m(obj), f_m(f) 
    { }
!   RelationMemberPtr1(const RelationMemberPtr1<C, Target, R1> &model)
    : obj_m(model.obj_m), f_m(model.f_m)
    { }
!   RelationMemberPtr1(const RelationMemberPtr1<C, Target, R1> &init, const Target &)
    : obj_m(init.obj_m), f_m(init.f_m) 
    { }
      
!   inline void operator()(const Target &l, const R1 &r1)
    {
      (obj_m.*f_m)(l, r1);
    }
*************** public:
*** 826,850 ****
  private:
  
    C obj_m;
!   void (C::*f_m)(const L &, const R1 &);
  };
  
! template<class C, class L, class R1, class R2>
  class RelationMemberPtr2 {
  public:
  
!   RelationMemberPtr2(const C &obj, void (C::*f)(const L &, 
      const R1 &, const R2 &)) 
    : obj_m(obj), f_m(f) 
    { }
!   RelationMemberPtr2(const RelationMemberPtr2<C, L, R1, R2> &model)
    : obj_m(model.obj_m), f_m(model.f_m)
    { }
!   RelationMemberPtr2(const RelationMemberPtr2<C, L, R1, R2> &init, const L &)
    : obj_m(init.obj_m), f_m(init.f_m) 
    { }
      
!   inline void operator()(const L &l, const R1 &r1, const R2 &r2)
    {
      (obj_m.*f_m)(l, r1, r2);
    }
--- 829,853 ----
  private:
  
    C obj_m;
!   void (C::*f_m)(const Target &, const R1 &);
  };
  
! template<class C, class Target, class R1, class R2>
  class RelationMemberPtr2 {
  public:
  
!   RelationMemberPtr2(const C &obj, void (C::*f)(const Target &, 
      const R1 &, const R2 &)) 
    : obj_m(obj), f_m(f) 
    { }
!   RelationMemberPtr2(const RelationMemberPtr2<C, Target, R1, R2> &model)
    : obj_m(model.obj_m), f_m(model.f_m)
    { }
!   RelationMemberPtr2(const RelationMemberPtr2<C, Target, R1, R2> &init, const Target &)
    : obj_m(init.obj_m), f_m(init.f_m) 
    { }
      
!   inline void operator()(const Target &l, const R1 &r1, const R2 &r2)
    {
      (obj_m.*f_m)(l, r1, r2);
    }
*************** public:
*** 852,878 ****
  private:
  
    C obj_m;
!   void (C::*f_m)(const L &, const R1 &, const R2 &);
  };
  
! template<class C, class L, class R1, class R2, class R3>
  class RelationMemberPtr3 {
  public:
  
!   RelationMemberPtr3(const C &obj, void (C::*f)(const L &, 
      const R1 &, const R2 &, const R3 &)) 
    : obj_m(obj), f_m(f) 
    { }
    RelationMemberPtr3(
!     const RelationMemberPtr3<C, L, R1, R2, R3> &model)
    : obj_m(model.obj_m), f_m(model.f_m)
    { }
    RelationMemberPtr3(
!     const RelationMemberPtr3<C, L, R1, R2, R3> &init, const L &)
    : obj_m(init.obj_m), f_m(init.f_m) 
    { }
      
!   inline void operator()(const L &l, const R1 &r1, const R2 &r2, 
      const R3 &r3)
    {
      (obj_m.*f_m)(l, r1, r2, r3);
--- 855,881 ----
  private:
  
    C obj_m;
!   void (C::*f_m)(const Target &, const R1 &, const R2 &);
  };
  
! template<class C, class Target, class R1, class R2, class R3>
  class RelationMemberPtr3 {
  public:
  
!   RelationMemberPtr3(const C &obj, void (C::*f)(const Target &, 
      const R1 &, const R2 &, const R3 &)) 
    : obj_m(obj), f_m(f) 
    { }
    RelationMemberPtr3(
!     const RelationMemberPtr3<C, Target, R1, R2, R3> &model)
    : obj_m(model.obj_m), f_m(model.f_m)
    { }
    RelationMemberPtr3(
!     const RelationMemberPtr3<C, Target, R1, R2, R3> &init, const Target &)
    : obj_m(init.obj_m), f_m(init.f_m) 
    { }
      
!   inline void operator()(const Target &l, const R1 &r1, const R2 &r2, 
      const R3 &r3)
    {
      (obj_m.*f_m)(l, r1, r2, r3);
*************** public:
*** 881,907 ****
  private:
  
    C obj_m;
!   void (C::*f_m)(const L &, const R1 &, const R2 &, const R3 &);
  };
  
! template<class C, class L, class R1, class R2, class R3, class R4>
  class RelationMemberPtr4 {
  public:
  
!   RelationMemberPtr4(const C &obj, void (C::*f)(const L &, 
      const R1 &, const R2 &, const R3 &, const R4 &)) 
    : obj_m(obj), f_m(f) 
    { }
    RelationMemberPtr4(
!     const RelationMemberPtr4<C, L, R1, R2, R3, R4> &model)
    : obj_m(model.obj_m), f_m(model.f_m)
    { }
    RelationMemberPtr4(
!     const RelationMemberPtr4<C, L, R1, R2, R3, R4> &init, const L &)
    : obj_m(init.obj_m), f_m(init.f_m) 
    { }
      
!   inline void operator()(const L &l, const R1 &r1, const R2 &r2, 
      const R3 &r3, const R4 &r4)
    {
      (obj_m.*f_m)(l, r1, r2, r3, r4);
--- 884,910 ----
  private:
  
    C obj_m;
!   void (C::*f_m)(const Target &, const R1 &, const R2 &, const R3 &);
  };
  
! template<class C, class Target, class R1, class R2, class R3, class R4>
  class RelationMemberPtr4 {
  public:
  
!   RelationMemberPtr4(const C &obj, void (C::*f)(const Target &, 
      const R1 &, const R2 &, const R3 &, const R4 &)) 
    : obj_m(obj), f_m(f) 
    { }
    RelationMemberPtr4(
!     const RelationMemberPtr4<C, Target, R1, R2, R3, R4> &model)
    : obj_m(model.obj_m), f_m(model.f_m)
    { }
    RelationMemberPtr4(
!     const RelationMemberPtr4<C, Target, R1, R2, R3, R4> &init, const Target &)
    : obj_m(init.obj_m), f_m(init.f_m) 
    { }
      
!   inline void operator()(const Target &l, const R1 &r1, const R2 &r2, 
      const R3 &r3, const R4 &r4)
    {
      (obj_m.*f_m)(l, r1, r2, r3, r4);
*************** public:
*** 910,938 ****
  private:
  
    C obj_m;
!   void (C::*f_m)(const L &, const R1 &, const R2 &, 
      const R3 &, const R4 &);
  };
  
! template<class C, class L, 
    class R1, class R2, class R3, class R4, class R5>
  class RelationMemberPtr5 {
  public:
  
!   RelationMemberPtr5(const C &obj, void (C::*f)(const L &, 
      const R1 &, const R2 &, const R3 &, const R4 &, const R5 &)) 
    : obj_m(obj), f_m(f) 
    { }
    RelationMemberPtr5(
!     const RelationMemberPtr5<C, L, R1, R2, R3, R4, R5> &model)
    : obj_m(model.obj_m), f_m(model.f_m)
    { }
    RelationMemberPtr5(
!     const RelationMemberPtr5<C, L, R1, R2, R3, R4, R5> &init, const L &)
    : obj_m(init.obj_m), f_m(init.f_m) 
    { }
      
!   inline void operator()(const L &l, const R1 &r1, const R2 &r2, 
      const R3 &r3, const R4 &r4, const R5 &r5)
    {
      (obj_m.*f_m)(l, r1, r2, r3, r4, r5);
--- 913,941 ----
  private:
  
    C obj_m;
!   void (C::*f_m)(const Target &, const R1 &, const R2 &, 
      const R3 &, const R4 &);
  };
  
! template<class C, class Target, 
    class R1, class R2, class R3, class R4, class R5>
  class RelationMemberPtr5 {
  public:
  
!   RelationMemberPtr5(const C &obj, void (C::*f)(const Target &, 
      const R1 &, const R2 &, const R3 &, const R4 &, const R5 &)) 
    : obj_m(obj), f_m(f) 
    { }
    RelationMemberPtr5(
!     const RelationMemberPtr5<C, Target, R1, R2, R3, R4, R5> &model)
    : obj_m(model.obj_m), f_m(model.f_m)
    { }
    RelationMemberPtr5(
!     const RelationMemberPtr5<C, Target, R1, R2, R3, R4, R5> &init, const Target &)
    : obj_m(init.obj_m), f_m(init.f_m) 
    { }
      
!   inline void operator()(const Target &l, const R1 &r1, const R2 &r2, 
      const R3 &r3, const R4 &r4, const R5 &r5)
    {
      (obj_m.*f_m)(l, r1, r2, r3, r4, r5);
*************** public:
*** 941,969 ****
  private:
  
    C obj_m;
!   void (C::*f_m)(const L &, const R1 &, const R2 &, 
      const R3 &, const R4 &, const R5 &);
  };
  
! template<class C, class L, 
    class R1, class R2, class R3, class R4, class R5, class R6>
  class RelationMemberPtr6 {
  public:
  
!   RelationMemberPtr6(const C &obj, void (C::*f)(const L &, 
      const R1 &, const R2 &, const R3 &, const R4 &, const R5 &, const R6 &)) 
    : obj_m(obj), f_m(f) 
    { }
    RelationMemberPtr6(
!     const RelationMemberPtr6<C, L, R1, R2, R3, R4, R5, R6> &model)
    : obj_m(model.obj_m), f_m(model.f_m)
    { }
    RelationMemberPtr6(
!     const RelationMemberPtr6<C, L, R1, R2, R3, R4, R5, R6> &init, const L &)
    : obj_m(init.obj_m), f_m(init.f_m) 
    { }
      
!   inline void operator()(const L &l, const R1 &r1, const R2 &r2, 
      const R3 &r3, const R4 &r4, const R5 &r5, const R6 &r6)
    {
      (obj_m.*f_m)(l, r1, r2, r3, r4, r5, r6);
--- 944,972 ----
  private:
  
    C obj_m;
!   void (C::*f_m)(const Target &, const R1 &, const R2 &, 
      const R3 &, const R4 &, const R5 &);
  };
  
! template<class C, class Target, 
    class R1, class R2, class R3, class R4, class R5, class R6>
  class RelationMemberPtr6 {
  public:
  
!   RelationMemberPtr6(const C &obj, void (C::*f)(const Target &, 
      const R1 &, const R2 &, const R3 &, const R4 &, const R5 &, const R6 &)) 
    : obj_m(obj), f_m(f) 
    { }
    RelationMemberPtr6(
!     const RelationMemberPtr6<C, Target, R1, R2, R3, R4, R5, R6> &model)
    : obj_m(model.obj_m), f_m(model.f_m)
    { }
    RelationMemberPtr6(
!     const RelationMemberPtr6<C, Target, R1, R2, R3, R4, R5, R6> &init, const Target &)
    : obj_m(init.obj_m), f_m(init.f_m) 
    { }
      
!   inline void operator()(const Target &l, const R1 &r1, const R2 &r2, 
      const R3 &r3, const R4 &r4, const R5 &r5, const R6 &r6)
    {
      (obj_m.*f_m)(l, r1, r2, r3, r4, r5, r6);
*************** public:
*** 972,978 ****
  private:
  
    C obj_m;
!   void (C::*f_m)(const L &, const R1 &, const R2 &, 
      const R3 &, const R4 &, const R5 &, const R6 &);
  };
        
--- 975,981 ----
  private:
  
    C obj_m;
!   void (C::*f_m)(const Target &, const R1 &, const R2 &, 
      const R3 &, const R4 &, const R5 &, const R6 &);
  };
        
*************** namespace Pooma {
*** 999,1049 ****
    //---------------------------------------------------------------------------
    // Functor versions
    
!   template<class RelationFunctor, class L>
!   void newRelation(const RelationFunctor &f, const L &l)
    {
      for (int m = 0; m < l.numMaterials(); ++m)
        {
          for (int c = 0; c < l.centeringSize(); ++c)
            {
!             const L &lsub = l.subField(m, c);
!             RelationListItem *r = new Relation0<L, RelationFunctor>(lsub, f);
              r->setPriority(RelationFunctorTraits<RelationFunctor>::defaultPriority);
              lsub.addRelation(r);
            }
        }
    }
    
!   template<class RelationFunctor, class L, class R1>
!   void newRelation(const RelationFunctor &f, const L &l, 
                     const R1 &r1)
    {
      for (int m = 0; m < l.numMaterials(); ++m)
        {
          for (int c = 0; c < l.centeringSize(); ++c)
            {
!             const L &lsub = l.subField(m, c);
              const R1 &r1sub = r1.subField(m, c);
              
              r1sub.addRelation(new InfluenceRelation(lsub));
    
              RelationListItem *r = new 
!               Relation1<L, R1, RelationFunctor>
                  (lsub, r1sub, f);
              lsub.addRelation(r);
            }
        }
    }
    
!   template<class RelationFunctor, class L, class R1, class R2>
!   void newRelation(const RelationFunctor &f, const L &l, 
                     const R1 &r1, const R2 &r2)
    {
      for (int m = 0; m < l.numMaterials(); ++m)
        {
          for (int c = 0; c < l.centeringSize(); ++c)
            {
!             const L &lsub = l.subField(m, c);
              const R1 &r1sub = r1.subField(m, c);
              const R2 &r2sub = r2.subField(m, c);
              
--- 1002,1052 ----
    //---------------------------------------------------------------------------
    // Functor versions
    
!   template<class RelationFunctor, class Target>
!   void newRelation(const RelationFunctor &f, const Target &l)
    {
      for (int m = 0; m < l.numMaterials(); ++m)
        {
          for (int c = 0; c < l.centeringSize(); ++c)
            {
!             const Target &lsub = l.subField(m, c);
!             RelationListItem *r = new Relation0<Target, RelationFunctor>(lsub, f);
              r->setPriority(RelationFunctorTraits<RelationFunctor>::defaultPriority);
              lsub.addRelation(r);
            }
        }
    }
    
!   template<class RelationFunctor, class Target, class R1>
!   void newRelation(const RelationFunctor &f, const Target &l, 
                     const R1 &r1)
    {
      for (int m = 0; m < l.numMaterials(); ++m)
        {
          for (int c = 0; c < l.centeringSize(); ++c)
            {
!             const Target &lsub = l.subField(m, c);
              const R1 &r1sub = r1.subField(m, c);
              
              r1sub.addRelation(new InfluenceRelation(lsub));
    
              RelationListItem *r = new 
!               Relation1<Target, R1, RelationFunctor>
                  (lsub, r1sub, f);
              lsub.addRelation(r);
            }
        }
    }
    
!   template<class RelationFunctor, class Target, class R1, class R2>
!   void newRelation(const RelationFunctor &f, const Target &l, 
                     const R1 &r1, const R2 &r2)
    {
      for (int m = 0; m < l.numMaterials(); ++m)
        {
          for (int c = 0; c < l.centeringSize(); ++c)
            {
!             const Target &lsub = l.subField(m, c);
              const R1 &r1sub = r1.subField(m, c);
              const R2 &r2sub = r2.subField(m, c);
              
*************** namespace Pooma {
*** 1051,1071 ****
              r2sub.addRelation(new InfluenceRelation(lsub));
    
              RelationListItem *r = 
!               new Relation2<L, R1, R2, RelationFunctor>(lsub, r1sub, r2sub, f);
              lsub.addRelation(r);
            }
        }
    }
    
!   template<class RelationFunctor, class L, class R1, class R2, class R3>
!   void newRelation(const RelationFunctor &f, const L &l, 
                     const R1 &r1, const R2 &r2, const R3 &r3)
    {
      for (int m = 0; m < l.numMaterials(); ++m)
        {
          for (int c = 0; c < l.centeringSize(); ++c)
            {
!             const L &lsub = l.subField(m, c);
              const R1 &r1sub = r1.subField(m, c);
              const R2 &r2sub = r2.subField(m, c);
              const R3 &r3sub = r3.subField(m, c);
--- 1054,1074 ----
              r2sub.addRelation(new InfluenceRelation(lsub));
    
              RelationListItem *r = 
!               new Relation2<Target, R1, R2, RelationFunctor>(lsub, r1sub, r2sub, f);
              lsub.addRelation(r);
            }
        }
    }
    
!   template<class RelationFunctor, class Target, class R1, class R2, class R3>
!   void newRelation(const RelationFunctor &f, const Target &l, 
                     const R1 &r1, const R2 &r2, const R3 &r3)
    {
      for (int m = 0; m < l.numMaterials(); ++m)
        {
          for (int c = 0; c < l.centeringSize(); ++c)
            {
!             const Target &lsub = l.subField(m, c);
              const R1 &r1sub = r1.subField(m, c);
              const R2 &r2sub = r2.subField(m, c);
              const R3 &r3sub = r3.subField(m, c);
*************** namespace Pooma {
*** 1075,1090 ****
              r3sub.addRelation(new InfluenceRelation(lsub));
    
              RelationListItem *r = new 
!               Relation3<L, R1, R2, R3, RelationFunctor>
                  (lsub, r1sub, r2sub, r3sub, f);
              lsub.addRelation(r);
            }
        }
    }
    
!   template<class RelationFunctor, class L, class R1, class R2, class R3,
      class R4>
!   void newRelation(const RelationFunctor &f, const L &l, 
                     const R1 &r1, const R2 &r2, 
                     const R3 &r3, const R4 &r4)
    {
--- 1078,1093 ----
              r3sub.addRelation(new InfluenceRelation(lsub));
    
              RelationListItem *r = new 
!               Relation3<Target, R1, R2, R3, RelationFunctor>
                  (lsub, r1sub, r2sub, r3sub, f);
              lsub.addRelation(r);
            }
        }
    }
    
!   template<class RelationFunctor, class Target, class R1, class R2, class R3,
      class R4>
!   void newRelation(const RelationFunctor &f, const Target &l, 
                     const R1 &r1, const R2 &r2, 
                     const R3 &r3, const R4 &r4)
    {
*************** namespace Pooma {
*** 1092,1098 ****
        {
          for (int c = 0; c < l.centeringSize(); ++c)
            {
!             const L &lsub = l.subField(m, c);
              const R1 &r1sub = r1.subField(m, c);
              const R2 &r2sub = r2.subField(m, c);
              const R3 &r3sub = r3.subField(m, c);
--- 1095,1101 ----
        {
          for (int c = 0; c < l.centeringSize(); ++c)
            {
!             const Target &lsub = l.subField(m, c);
              const R1 &r1sub = r1.subField(m, c);
              const R2 &r2sub = r2.subField(m, c);
              const R3 &r3sub = r3.subField(m, c);
*************** namespace Pooma {
*** 1104,1119 ****
              r4sub.addRelation(new InfluenceRelation(lsub));
    
              RelationListItem *r = new 
!               Relation4<L, R1, R2, R3, R4, RelationFunctor>
                  (lsub, r1sub, r2sub, r3sub, r4sub, f);
              lsub.addRelation(r);
            }
        }
    }
    
!   template<class RelationFunctor, class L, class R1, class R2, class R3,
      class R4, class R5>
!   void newRelation(const RelationFunctor &f, const L &l, 
                     const R1 &r1, const R2 &r2, 
                     const R3 &r3, const R4 &r4, const R5 &r5)
    {
--- 1107,1122 ----
              r4sub.addRelation(new InfluenceRelation(lsub));
    
              RelationListItem *r = new 
!               Relation4<Target, R1, R2, R3, R4, RelationFunctor>
                  (lsub, r1sub, r2sub, r3sub, r4sub, f);
              lsub.addRelation(r);
            }
        }
    }
    
!   template<class RelationFunctor, class Target, class R1, class R2, class R3,
      class R4, class R5>
!   void newRelation(const RelationFunctor &f, const Target &l, 
                     const R1 &r1, const R2 &r2, 
                     const R3 &r3, const R4 &r4, const R5 &r5)
    {
*************** namespace Pooma {
*** 1121,1127 ****
        {
          for (int c = 0; c < l.centeringSize(); ++c)
            {
!             const L &lsub = l.subField(m, c);
              const R1 &r1sub = r1.subField(m, c);
              const R2 &r2sub = r2.subField(m, c);
              const R3 &r3sub = r3.subField(m, c);
--- 1124,1130 ----
        {
          for (int c = 0; c < l.centeringSize(); ++c)
            {
!             const Target &lsub = l.subField(m, c);
              const R1 &r1sub = r1.subField(m, c);
              const R2 &r2sub = r2.subField(m, c);
              const R3 &r3sub = r3.subField(m, c);
*************** namespace Pooma {
*** 1135,1150 ****
              r5sub.addRelation(new InfluenceRelation(lsub));
    
              RelationListItem *r = new 
!               Relation5<L, R1, R2, R3, R4, R5, RelationFunctor>
                  (lsub, r1sub, r2sub, r3sub, r4sub, r5sub, f);
              lsub.addRelation(r);
            }
        }
    }
    
!   template<class RelationFunctor, class L, class R1, class R2, class R3,
      class R4, class R5, class R6>
!   void newRelation(const RelationFunctor &f, const L &l, 
                     const R1 &r1, const R2 &r2, 
                     const R3 &r3, const R4 &r4, const R5 &r5, const R6 &r6)
    {
--- 1138,1153 ----
              r5sub.addRelation(new InfluenceRelation(lsub));
    
              RelationListItem *r = new 
!               Relation5<Target, R1, R2, R3, R4, R5, RelationFunctor>
                  (lsub, r1sub, r2sub, r3sub, r4sub, r5sub, f);
              lsub.addRelation(r);
            }
        }
    }
    
!   template<class RelationFunctor, class Target, class R1, class R2, class R3,
      class R4, class R5, class R6>
!   void newRelation(const RelationFunctor &f, const Target &l, 
                     const R1 &r1, const R2 &r2, 
                     const R3 &r3, const R4 &r4, const R5 &r5, const R6 &r6)
    {
*************** namespace Pooma {
*** 1152,1158 ****
        {
          for (int c = 0; c < l.centeringSize(); ++c)
            {
!             const L &lsub = l.subField(m, c);
              const R1 &r1sub = r1.subField(m, c);
              const R2 &r2sub = r2.subField(m, c);
              const R3 &r3sub = r3.subField(m, c);
--- 1155,1161 ----
        {
          for (int c = 0; c < l.centeringSize(); ++c)
            {
!             const Target &lsub = l.subField(m, c);
              const R1 &r1sub = r1.subField(m, c);
              const R2 &r2sub = r2.subField(m, c);
              const R3 &r3sub = r3.subField(m, c);
*************** namespace Pooma {
*** 1168,1174 ****
              r6sub.addRelation(new InfluenceRelation(lsub));
    
              RelationListItem *r = new 
!               Relation6<L, R1, R2, R3, R4, R5, R6, RelationFunctor>
                  (lsub, r1sub, r2sub, r3sub, r4sub, r5sub, r6sub, f);
              lsub.addRelation(r);
            }
--- 1171,1177 ----
              r6sub.addRelation(new InfluenceRelation(lsub));
    
              RelationListItem *r = new 
!               Relation6<Target, R1, R2, R3, R4, R5, R6, RelationFunctor>
                  (lsub, r1sub, r2sub, r3sub, r4sub, r5sub, r6sub, f);
              lsub.addRelation(r);
            }
*************** namespace Pooma {
*** 1178,1297 ****
    //---------------------------------------------------------------------------
    // Function pointer versions
    
!   template<class L>
!   RelationFunctionPtr0<L> 
!   functionPtr(void (*f)(const L &))
    {
!     return RelationFunctionPtr0<L>(f);
    }
    
!   template<class L, class R1>
!   RelationFunctionPtr1<L, R1> 
!   functionPtr(void (*f)(const L &, const R1 &))
    {
!     return RelationFunctionPtr1<L, R1>(f);
    }
    
!   template<class L, class R1, class R2>
!   RelationFunctionPtr2<L, R1, R2>
!   functionPtr(void (*f)(const L &, const R1 &, const R2 &))
    {
!     return RelationFunctionPtr2<L, R1, R2>(f);
    }
    
!   template<class L, class R1, class R2, class R3>
!   RelationFunctionPtr3<L, R1, R2, R3>
!   functionPtr(void (*f)(const L &, const R1 &, const R2 &, const R3 &))
    {
!     return RelationFunctionPtr3<L, R1, R2, R3>(f);
    }
     
!   template<class L, class R1, class R2, class R3, class R4>
!   RelationFunctionPtr4<L, R1, R2, R3, R4>
!   functionPtr(void (*f)(const L &, const R1 &, const R2 &, const R3 &, 
      const R4 &r4))
    {
!     return RelationFunctionPtr4<L, R1, R2, R3, R4>(f);
    }
   
!   template<class L, class R1, class R2, class R3,
      class R4, class R5>
!   RelationFunctionPtr5<L, R1, R2, R3, R4, R5>
!   functionPtr(void (*f)(const L &, const R1 &, const R2 &, const R3 &, 
      const R4 &r4, const R5 &r5))
    {
!     return RelationFunctionPtr5<L, R1, R2, R3, R4, R5>(f);
    }
    
!   template<class L, class R1, class R2, class R3,
      class R4, class R5, class R6>
!   RelationFunctionPtr6<L, R1, R2, R3, R4, R5, R6>
!   functionPtr(void (*f)(const L &, const R1 &, const R2 &, const R3 &, 
      const R4 &r4, const R5 &r5, const R6 &r6))
    {
!     return RelationFunctionPtr6<L, R1, R2, R3, R4, R5, R6>(f);
    }
  
    //---------------------------------------------------------------------------
    // Member function pointer versions
    
!   template<class C, class L>
!   RelationMemberPtr0<C, L> 
!   memberPtr(const C &obj, void (C::*f)(const L &))
    {
!     return RelationMemberPtr0<C, L>(obj, f);
    }
    
!   template<class C, class L, class R1>
!   RelationMemberPtr1<C, L, R1> 
!   memberPtr(const C &obj, void (C::*f)(const L &, const R1 &))
    {
!     return RelationMemberPtr1<C, L, R1>(obj, f);
    }
    
!   template<class C, class L, class R1, class R2>
!   RelationMemberPtr2<C, L, R1, R2> 
!   memberPtr(const C &obj,  void (C::*f)(const L &, const R1 &, const R2 &))
    {
!     return RelationMemberPtr2<C, L, R1, R2>(obj, f);
    }
    
!   template<class C, class L, class R1, class R2, class R3>
!   RelationMemberPtr3<C, L, R1, R2, R3> 
    memberPtr(const C &obj, 
!     void (C::*f)(const L &, const R1 &, const R2 &, const R3 &))
    {
!     return RelationMemberPtr3<C, L, R1, R2, R3>(obj, f);
    }
    
!   template<class C, class L, class R1, class R2, class R3,
      class R4>
!   RelationMemberPtr4<C, L, R1, R2, R3, R4> 
    memberPtr(const C &obj, 
!     void (C::*f)(const L &, const R1 &, const R2 &, const R3 &, 
      const R4 &r4))
    {
!     return RelationMemberPtr4<C, L, R1, R2, R3, R4>(obj, f);
    }
    
!   template<class C, class L, class R1, class R2, class R3,
      class R4, class R5>
!   RelationMemberPtr5<C, L, R1, R2, R3, R4, R5> 
    memberPtr(const C &obj, 
!     void (C::*f)(const L &, const R1 &, const R2 &, const R3 &, 
      const R4 &r4, const R5 &r5))
    {
!     return RelationMemberPtr5<C, L, R1, R2, R3, R4, R5>(obj, f);
    }
    
!   template<class C, class L, class R1, class R2, class R3,
      class R4, class R5, class R6>
!   RelationMemberPtr6<C, L, R1, R2, R3, R4, R5, R6> 
    memberPtr(const C &obj, 
!     void (C::*f)(const L &, const R1 &, const R2 &, const R3 &, 
      const R4 &r4, const R5 &r5, const R6 &r6))
    {
!     return RelationMemberPtr6<C, L, R1, R2, R3, R4, R5, R6>(obj, f);
    }
    
  } // namespace Pooma
--- 1181,1300 ----
    //---------------------------------------------------------------------------
    // Function pointer versions
    
!   template<class Target>
!   RelationFunctionPtr0<Target> 
!   functionPtr(void (*f)(const Target &))
    {
!     return RelationFunctionPtr0<Target>(f);
    }
    
!   template<class Target, class R1>
!   RelationFunctionPtr1<Target, R1> 
!   functionPtr(void (*f)(const Target &, const R1 &))
    {
!     return RelationFunctionPtr1<Target, R1>(f);
    }
    
!   template<class Target, class R1, class R2>
!   RelationFunctionPtr2<Target, R1, R2>
!   functionPtr(void (*f)(const Target &, const R1 &, const R2 &))
    {
!     return RelationFunctionPtr2<Target, R1, R2>(f);
    }
    
!   template<class Target, class R1, class R2, class R3>
!   RelationFunctionPtr3<Target, R1, R2, R3>
!   functionPtr(void (*f)(const Target &, const R1 &, const R2 &, const R3 &))
    {
!     return RelationFunctionPtr3<Target, R1, R2, R3>(f);
    }
     
!   template<class Target, class R1, class R2, class R3, class R4>
!   RelationFunctionPtr4<Target, R1, R2, R3, R4>
!   functionPtr(void (*f)(const Target &, const R1 &, const R2 &, const R3 &, 
      const R4 &r4))
    {
!     return RelationFunctionPtr4<Target, R1, R2, R3, R4>(f);
    }
   
!   template<class Target, class R1, class R2, class R3,
      class R4, class R5>
!   RelationFunctionPtr5<Target, R1, R2, R3, R4, R5>
!   functionPtr(void (*f)(const Target &, const R1 &, const R2 &, const R3 &, 
      const R4 &r4, const R5 &r5))
    {
!     return RelationFunctionPtr5<Target, R1, R2, R3, R4, R5>(f);
    }
    
!   template<class Target, class R1, class R2, class R3,
      class R4, class R5, class R6>
!   RelationFunctionPtr6<Target, R1, R2, R3, R4, R5, R6>
!   functionPtr(void (*f)(const Target &, const R1 &, const R2 &, const R3 &, 
      const R4 &r4, const R5 &r5, const R6 &r6))
    {
!     return RelationFunctionPtr6<Target, R1, R2, R3, R4, R5, R6>(f);
    }
  
    //---------------------------------------------------------------------------
    // Member function pointer versions
    
!   template<class C, class Target>
!   RelationMemberPtr0<C, Target> 
!   memberPtr(const C &obj, void (C::*f)(const Target &))
    {
!     return RelationMemberPtr0<C, Target>(obj, f);
    }
    
!   template<class C, class Target, class R1>
!   RelationMemberPtr1<C, Target, R1> 
!   memberPtr(const C &obj, void (C::*f)(const Target &, const R1 &))
    {
!     return RelationMemberPtr1<C, Target, R1>(obj, f);
    }
    
!   template<class C, class Target, class R1, class R2>
!   RelationMemberPtr2<C, Target, R1, R2> 
!   memberPtr(const C &obj,  void (C::*f)(const Target &, const R1 &, const R2 &))
    {
!     return RelationMemberPtr2<C, Target, R1, R2>(obj, f);
    }
    
!   template<class C, class Target, class R1, class R2, class R3>
!   RelationMemberPtr3<C, Target, R1, R2, R3> 
    memberPtr(const C &obj, 
!     void (C::*f)(const Target &, const R1 &, const R2 &, const R3 &))
    {
!     return RelationMemberPtr3<C, Target, R1, R2, R3>(obj, f);
    }
    
!   template<class C, class Target, class R1, class R2, class R3,
      class R4>
!   RelationMemberPtr4<C, Target, R1, R2, R3, R4> 
    memberPtr(const C &obj, 
!     void (C::*f)(const Target &, const R1 &, const R2 &, const R3 &, 
      const R4 &r4))
    {
!     return RelationMemberPtr4<C, Target, R1, R2, R3, R4>(obj, f);
    }
    
!   template<class C, class Target, class R1, class R2, class R3,
      class R4, class R5>
!   RelationMemberPtr5<C, Target, R1, R2, R3, R4, R5> 
    memberPtr(const C &obj, 
!     void (C::*f)(const Target &, const R1 &, const R2 &, const R3 &, 
      const R4 &r4, const R5 &r5))
    {
!     return RelationMemberPtr5<C, Target, R1, R2, R3, R4, R5>(obj, f);
    }
    
!   template<class C, class Target, class R1, class R2, class R3,
      class R4, class R5, class R6>
!   RelationMemberPtr6<C, Target, R1, R2, R3, R4, R5, R6> 
    memberPtr(const C &obj, 
!     void (C::*f)(const Target &, const R1 &, const R2 &, const R3 &, 
      const R4 &r4, const R5 &r5, const R6 &r6))
    {
!     return RelationMemberPtr6<C, Target, R1, R2, R3, R4, R5, R6>(obj, f);
    }
    
  } // namespace Pooma


More information about the pooma-dev mailing list