ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/branches/new_design/OOPSE-3.0/src/brains/Exclude.hpp
(Generate patch)

Comparing branches/new_design/OOPSE-3.0/src/brains/Exclude.hpp (file contents):
Revision 1683, Thu Oct 28 22:34:02 2004 UTC vs.
Revision 1721 by tim, Tue Nov 9 01:08:31 2004 UTC

# Line 3 | Line 3
3  
4   #include <set>
5   #include <utility>
6 + #include <iostream>
7  
8   using namespace std;
9  
10 < class Exclude{
10 <  
11 < public:
10 > namespace oopse {
11  
12 <  ~Exclude();
13 <  
14 <  void addPair(int i, int j);
15 <  int  hasPair(int i, int j);
16 <  void printMe( void );
17 <  int  getSize( void );  
19 <  int* getFortranArray( void );
20 <  static Exclude* Instance();
21 <
22 < protected:
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 <  set<pair<int, int> > excludeSet;
25 <  int* exPairs;
26 <  bool newFortranArrayNeeded;
27 <  Exclude();
19 >        public:
20  
21 < private:
30 <  static Exclude* _instance;  
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__

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines