CHROMA
composite_set.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 /*! \file
3  * \brief Key for propagator colorstd::vector sources
4  */
5 
6 #ifndef __FUNC_COMPOSITE_SET_h__
7 #define __FUNC_COMPOSITE_SET_h__
8 
9 #include "chromabase.h"
10 
11 namespace Chroma
12 {
13 
14  //! Function object used for constructing a composite set
15  class CompositeSetFunc : public SetFunc
16  {
17  public:
18  CompositeSetFunc(const SetFunc& s1, const SetFunc& s2 ):set1(s1),set2(s2){
19  }
20 
21  int operator() (const multi1d<int>& coordinate) const{
22  return set1(coordinate) + set1.numSubsets()*set2(coordinate) ;
23  }
24 
25  int numSubsets() const{
26  return set1.numSubsets()*set2.numSubsets() ;
27  }
28 
29  int coloring(int s1, int s2){
30  return s1 + set1.numSubsets()*s2 ;
31  }
32 
33  private:
34  CompositeSetFunc() {} // hide default constructor
35 
36  SetFunc set1 ;
37  SetFunc set2 ;
38 
39  };
40 
41 } // namespace Chroma
42 
43 #endif
Primary include file for CHROMA library code.
Function object used for constructing a composite set.
Definition: composite_set.h:16
int operator()(const multi1d< int > &coordinate) const
Definition: composite_set.h:21
int coloring(int s1, int s2)
Definition: composite_set.h:29
CompositeSetFunc(const SetFunc &s1, const SetFunc &s2)
Definition: composite_set.h:18
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10