QNANO
CdaggerC_Iterator.h
1 #ifndef QNANO_NEW_CDAGGERC_ITERATOR_DEFINED_H
2 #define QNANO_NEW_CDAGGERC_ITERATOR_DEFINED_H
3 
4 #include "manybody/CdaggerC_Iterator_SingleI.h"
5 
7 protected:
8  Fermion_Index fi_ref;
9  int n_max;
10  int cur_col;
11 
13 
14 public:
15 
16  bool done()const{
17  return cur_col>=(int)fi_ref.size();
18  }
19  inline int get_n()const{return it.get_n();}
20  inline int get_m()const{return it.get_m();}
21  inline double get_sign()const{return it.get_sign();}
22  inline const Fermion_Index& get_fi()const{return it.get_fi();}
23 
24  CdaggerC_Iterator& operator++(){
25  ++it;
26  if(it.done()){
27  cur_col++;
28  if(cur_col<(int)fi_ref.size()){
29  it.setup(fi_ref, cur_col, n_max);
30  }
31  }
32  return *this;
33  }
34  void setup(const Fermion_Index &fi, int n_max_){
35  fi_ref=fi;
36  n_max=n_max_;
37  cur_col=0;
38  it.setup(fi, cur_col, n_max);
39  }
40 
42  setup(Fermion_Index(), 0);
43  }
44  CdaggerC_Iterator(const Fermion_Index &fi, int n_max_){
45  setup(fi, n_max_);
46  }
47 };
48 
49 #endif
Definition: CdaggerC_Iterator_SingleI.h:8
Definition: Fermion_Index.h:19
Definition: CdaggerC_Iterator.h:6