Skip to content

Commit

Permalink
Merge pull request #110 from borglab/fix/subgraphbuilder
Browse files Browse the repository at this point in the history
Several fixes in legacy code
  • Loading branch information
dellaert authored Sep 8, 2019
2 parents 5cbcfda + cb80f27 commit 675f27b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions gtsam/linear/SubgraphBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ static vector<size_t> UniqueSampler(const vector<double> &weight,
const size_t m = weight.size();
if (n > m) throw std::invalid_argument("UniqueSampler: invalid input size");

vector<size_t> samples;
vector<size_t> results;

size_t count = 0;
vector<bool> touched(m, false);
Expand All @@ -130,12 +130,12 @@ static vector<size_t> UniqueSampler(const vector<double> &weight,
for (const size_t &index : samples) {
if (touched[index] == false) {
touched[index] = true;
samples.push_back(index);
results.push_back(index);
if (++count >= n) break;
}
}
}
return samples;
return results;
}

/****************************************************************************/
Expand Down
2 changes: 1 addition & 1 deletion gtsam_unstable/slam/PartialPriorFactor.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ namespace gtsam {

// access
const Vector& prior() const { return prior_; }
const std::vector<bool>& mask() const { return mask_; }
const std::vector<size_t>& mask() const { return mask_; }
const Matrix& H() const { return H_; }

protected:
Expand Down

0 comments on commit 675f27b

Please sign in to comment.