salsa  0.4.15
HyperCube.hh
1 #pragma once
2 #include <algorithm>
3 #include <bitset>
4 #include <map>
5 #include <sstream>
6 #include "Object.hh"
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 algorithm class.
Definition: HyperCube.hh:16
void createAdjMatrix()
create matrix adjacency
Definition: HyperCube.cc:23
void removeNode(std::string nodeName)
remove node from HC
Definition: HyperCube.cc:67
HyperCube(int power=3, int start=1)
Create HyperCube.
Definition: HyperCube.cc:11
std::vector< std::vector< int > > mAdjMatrix
Matrix adjacency.
Definition: HyperCube.hh:41
std::vector< std::vector< int > > mPaths
Output paths.
Definition: HyperCube.hh:42
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 print() const
Printing Hyper cube paths.
Definition: HyperCube.cc:124
void createPaths()
Creat outPut vectors.
Definition: HyperCube.cc:90
int mPower
Power.
Definition: HyperCube.hh:38
virtual ~HyperCube()
Definition: HyperCube.cc:16
std::vector< int > mPassedNodes
Passed nodes.
Definition: HyperCube.hh:40
int mStart
Starting point.
Definition: HyperCube.hh:39
Base Salsa Object class.
Definition: Object.hh:15