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

Comparing branches/new_design/OOPSE-4/src/brains/Exclude.cpp (file contents):
Revision 1727 by tim, Thu Nov 11 16:41:58 2004 UTC vs.
Revision 1804 by tim, Tue Nov 30 19:58:25 2004 UTC

# Line 1 | Line 1
1 < #include <iostream>
2 < #include <stdlib.h>
1 > #include <utility>
2 > #include "brains/Exclude.hpp"
3  
4 < #include "brains/Exclude.hpp" namespace oopse {
4 > namespace oopse {
5  
6 Exclude::Exclude() :
7    modified_(false) { }
8
9 Exclude::~Exclude() { }
10
6   int *Exclude::getExcludeList() {
7  
8      if (modified_) {
9          excludeList_.clear();
10          std::copy(excludeSet_.begin(), excludeSet_.end(),
11 <                  std::back_inserter(excludeList_.end()));
11 >                  std::back_inserter(excludeList_));
12          modified_ = false;
13      }
14  
15 <    return excludeList_.size() > 0 ? &excludeList_[0] : NULL;    
15 >    return excludeList_.size() > 0 ? &(excludeList_[0].first) : NULL;    
16   }
17  
18   void Exclude::addPair(int i, int j) {
# Line 32 | Line 27 | void Exclude::addPair(int i, int j) {
27              std::swap(i, j);
28          }
29  
30 <        excludeSet_.insert(make_pair(i, j));
30 >        excludeSet_.insert(std::make_pair(i, j));
31          modified_ = true;
32      }
33   }
# Line 48 | Line 43 | std::set<std::pair<int, int>>::iterator Exclude::findP
43      }
44   }
45  
46 < std::set<std::pair<int, int>>::iterator Exclude::findPair(int i, int j) {
46 > std::set<std::pair<int, int> >::iterator Exclude::findPair(int i, int j) {
47      std::set<std::pair<int, int> >::iterator position;
48  
49      if (i != j) {
50 <        if (i < j)
51 <            position = excludeSet_.find(make_pair(i, j));
52 <        else
53 <            position = excludeSet_.find(make_pair(j, i));
54 <
55 <        return excludeSet_.end;
50 >        if (i < j) {
51 >            position = excludeSet_.find(std::make_pair(i, j));
52 >        } else {
53 >            position = excludeSet_.find(std::make_pair(j, i));
54 >        }
55 >        return position;
56      } else
57          return excludeSet_.end();
58   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines