QNANO
Fermion_Index.h
1 #ifndef QNANO_NEW_FERMION_INDEX_DEFINED
2 #define QNANO_NEW_FERMION_INDEX_DEFINED
3 
4 
5 #include "tools/List_Class.h"
6 #include <algorithm>
7 #include <fstream>
8 #include <iostream>
9 #include <complex>
10 
11 
19 struct Fermion_Index: public List_Class<int>{
20 
21 
22  //Constructors
23  Fermion_Index(){ }
24  Fermion_Index(size_t sz){ list.resize(sz);}
25  Fermion_Index(const std::vector<int> & lst){ list=lst; }
26  Fermion_Index(const Fermion_Index & other){ list=other.list; }
27  Fermion_Index & operator=(const std::vector<int> & lst){ list=lst; return *this; }
28  Fermion_Index & operator=(const Fermion_Index & other){ list=other.list; return *this; }
29  ~Fermion_Index(){ }
30 
31  //bring list of indices in the right order; return sign (-1)^(nr. swaps)
32  double sort_get_sign();
33 
34  //equality/inequality operators used for sorting:
35  bool operator==(const Fermion_Index &other) const;
36  bool operator!=(const Fermion_Index &other) const;
37  bool operator<(const Fermion_Index &other) const;
38  bool operator>(const Fermion_Index &other) const;
39 
40  void erase(int i);
41 };
42 
43 std::ostream &operator<<(std::ostream & os, const Fermion_Index & fi);
44 
45 
46 #endif
Definition: List_Class.h:8
Definition: Fermion_Index.h:19