salsa  0.4.0
HyperCube.hh
1 #pragma once
2 #include <Object.hh>
3 #include <algorithm>
4 #include <bitset>
5 #include <map>
6 #include <sstream>
7 
8 namespace Salsa {
15 
16 class HyperCube : public Object {
17 public:
19  HyperCube(int power = 3, int start = 1);
20  virtual ~HyperCube();
21 
23  void print() const;
24 
26  void createAdjMatrix();
28  void addNode(std::string nodeName);
30  void removeNode(std::string nodeName);
32  void createPaths();
33  // TODO WARN - variables _shall not_ begin with underscore!
34  // Also, all members should be private (or protected, if so required)!
35  std::map<int, std::string> _nodeMap;
36 
37 private:
38  int mPower;
39  int mStart;
40  std::vector<int> mPassedNodes;
41  std::vector<std::vector<int>> mAdjMatrix;
42  std::vector<std::vector<int>> mPaths;
43 };
44 } // namespace Salsa
HyperCube(int power=3, int start=1)
Create HyperCube.
Definition: HyperCube.cc:11
HyperCube algorithm class.
Definition: HyperCube.hh:16
int mStart
Starting point.
Definition: HyperCube.hh:39
std::vector< int > mPassedNodes
Passed nodes.
Definition: HyperCube.hh:40
void createAdjMatrix()
create matrix adjacency
Definition: HyperCube.cc:23
void createPaths()
Creat outPut vectors.
Definition: HyperCube.cc:90
int mPower
Power.
Definition: HyperCube.hh:38
std::vector< std::vector< int > > mPaths
Output paths.
Definition: HyperCube.hh:42
void print() const
Printing Hyper cube paths.
Definition: HyperCube.cc:124
std::map< int, std::string > _nodeMap
avalible nodes and their numbers
Definition: HyperCube.hh:35
void addNode(std::string nodeName)
add new node in HC
Definition: HyperCube.cc:50
void removeNode(std::string nodeName)
remove node from HC
Definition: HyperCube.cc:67
std::vector< std::vector< int > > mAdjMatrix
Matrix adjacency.
Definition: HyperCube.hh:41
Base Salsa Object class.
Definition: Object.hh:15
virtual ~HyperCube()
Definition: HyperCube.cc:16