forked from ucla-vision/xivo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make the visibility graph a singleton
- Loading branch information
Showing
7 changed files
with
82 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
// The feature-group graph. | ||
// The feature-group visibility graph. | ||
// Author: Xiaohan Fei ([email protected]) | ||
#pragma once | ||
#include <functional> | ||
|
@@ -23,6 +23,9 @@ struct GroupAdj : public std::unordered_set<int> { | |
|
||
class Graph { | ||
public: | ||
static Graph* Create(); | ||
static Graph* instance(); | ||
|
||
void RemoveFeature(const FeaturePtr f); | ||
void RemoveFeatures(const std::vector<FeaturePtr> &); | ||
|
||
|
@@ -68,6 +71,11 @@ class Graph { | |
void CleanIsolatedNodes(); | ||
|
||
private: | ||
Graph() = default; | ||
Graph(const Graph&) = delete; | ||
Graph& operator=(const Graph&) = delete; | ||
static std::unique_ptr<Graph> instance_; | ||
|
||
// 2 types of nodes: feature and group | ||
std::unordered_map<int, FeaturePtr> features_; | ||
std::unordered_map<int, GroupPtr> groups_; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -74,7 +74,5 @@ int main() { | |
} | ||
optimizer->AddFeature(FeatureAdapter{gsb.size() + i, noisy_pt}, obs); | ||
} | ||
|
||
optimizer->Solve(10); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters