QNANO
Select_Orbitals.h
1 #ifndef QNANO_NEW_SELECT_ORBITALS_DEFINED_H
2 #define QNANO_NEW_SELECT_ORBITALS_DEFINED_H
3 
4 #include "tools/List_Class.h"
5 #include "tools/Reader.h"
6 #include <cstdlib>
7 #include <iostream>
8 #include "Orbital_Index.h"
9 #include <algorithm>
10 
11 class Select_Orbitals: public List_Class<int>{
12 public:
13  int element;
14 
15  bool is_spinless() const;
16  int get_nr_orbs_per_spin() const;
17 
18  int find(int orb)const;
19  int find(const std::string &str)const;
20  int find_first_of(const std::string &str1, const std::string &str2="", \
21  const std::string &str3="", const std::string &str4="", \
22  const std::string &str5="")const;
23  bool contains(int orb)const;
24  bool contains(const std::string &str)const;
25  bool contains_s()const;
26  bool contains_p()const;
27  bool contains_d()const;
28  bool contains_sstar()const;
29 
30  void add(int i, bool spinup=false);
31  void add(const std::string &str, bool spinup=false);
32  void select_all();
33  void make_consistent();
34 
35  void read_list(const std::vector<std::string> &stringvec, size_t col=0);
36  void read_list_from_line(const std::string &line, size_t col=0);
37  void read_list_from_line(std::istream &ifs);
38  void read_from_file(const std::string &filename);
39 
40  void print_list(std::ostream &ofs)const;
41  void print(std::ostream &ofs=std::cout)const;
42 
43 
44  Select_Orbitals():element(0){}
45  Select_Orbitals(const std::string &filename):element(0) {read_from_file(filename);}
46 };
47 
48 
49 #endif
Definition: Select_Orbitals.h:11
Definition: List_Class.h:8