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

File Contents

# Content
1 #ifndef __EXCLUDE_H__
2 #define __EXCLUDE_H__
3
4 #include <set>
5 #include <utility>
6 #include <iostream>
7
8 using namespace std;
9
10 namespace oopse {
11
12 /**
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 class Exclude{
18
19 public:
20
21 Exclude();
22
23 ~Exclude();
24
25 /** Adds a pair into this Exclude class */
26 void addPair(int i, int j);
27
28 /** Remove a pair from Exclude class */
29 void removePair(int i, int j);
30
31 /** 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 int getSize();
38
39 /** Returns the size of exclusion list */
40 int getSizeOfExcludeList();
41
42 /** Returns the exclusion pairs in a plain array*/
43 int* getExcludeList();
44
45 /** write out the exclusion list to an ostream */
46 friend std::ostream& operator(std::ostream& o, Exclude& e);
47
48 private:
49
50 std::set<std::pair<int, int> >::iterator findPair(int i, int j);
51
52 std::set<std::pair<int, int> > excludeSet_;
53 std::vector<std::pair<int, int> > excludeList_;
54 bool modified_;
55
56 };
57
58 }//end namespace oopse
59 #endif // __EXCLUDE_H__