ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/branches/new_design/OOPSE-3.0/src/brains/Exclude.hpp
Revision: 1721
Committed: Tue Nov 9 01:08:31 2004 UTC (19 years, 9 months ago) by tim
File size: 1586 byte(s)
Log Message:
More to break

File Contents

# User Rev Content
1 gezelter 1490 #ifndef __EXCLUDE_H__
2     #define __EXCLUDE_H__
3    
4     #include <set>
5     #include <utility>
6 tim 1721 #include <iostream>
7 gezelter 1490
8     using namespace std;
9    
10 tim 1719 namespace oopse {
11 gezelter 1490
12 tim 1721 /**
13     * @class Exclude Exclude.hpp "brains/Exclude.hpp"
14     * @brief Exclude class maintains the exclusion list of the simulation by the global indices of the
15     * atoms. The exclusion list will be passed to fortran in a plain array.
16     */
17 tim 1719 class Exclude{
18 gezelter 1490
19 tim 1719 public:
20 gezelter 1490
21 tim 1721 Exclude();
22    
23 tim 1719 ~Exclude();
24 gezelter 1490
25 tim 1721 /** Adds a pair into this Exclude class */
26 tim 1719 void addPair(int i, int j);
27    
28 tim 1721 /** Remove a pair from Exclude class */
29 tim 1719 void removePair(int i, int j);
30    
31 tim 1721 /** Checks whether pair (i, j) is in this Exclude class */
32     bool hasPair(int i, int j) {
33     return findPair(i, j) != excludeSet_.end();
34     }
35    
36     /** Returns the number of exclusion pair */
37 tim 1719 int getSize();
38    
39 tim 1721 /** Returns the size of exclusion list */
40     int getSizeOfExcludeList();
41    
42     /** Returns the exclusion pairs in a plain array*/
43 tim 1719 int* getExcludeList();
44    
45 tim 1721 /** write out the exclusion list to an ostream */
46     friend std::ostream& operator(std::ostream& o, Exclude& e);
47 tim 1719
48 tim 1721 private:
49    
50     std::set<std::pair<int, int> >::iterator findPair(int i, int j);
51    
52 tim 1719 std::set<std::pair<int, int> > excludeSet_;
53     std::vector<std::pair<int, int> > excludeList_;
54     bool modified_;
55    
56 gezelter 1490 };
57    
58 tim 1719 }//end namespace oopse
59 gezelter 1490 #endif // __EXCLUDE_H__