CARMA C++
WalshFunction.h
Go to the documentation of this file.
1 
2 #ifndef CARMA_UTIL_WALSHFUNCTION_H
3 #define CARMA_UTIL_WALSHFUNCTION_H
4 
5 
19 #include <vector>
20 
21 
22 namespace carma {
23  namespace util {
24 
36 {
37 
38 public:
45  WalshFunction(int nStates);
46 
50  virtual ~WalshFunction();
51 
58  bool getValue(int function, int value) const;
59 
64  void dump(bool whitespace = true) const;
65 
69  void graph() const;
70 
71 private:
72  // Hide default constructor
73  WalshFunction();
74  int nStates_ ;
75  std::vector<bool> val_;
76  int width_;
77  // The generation algorithm requires a function that returns +1, -1
78  // and zero when the index is out of range
79  int getValueTriState(int function, int value) const;
80 };
81 
82 
83 } } // End namespace carma::util
84 
85 
86 
87 #endif // CARMA_UTIL_WALSHFUNCTION_H
88 
89 
90 
91 
92 
93 
94 
95 
96 
void graph() const
Graph the values to stdout, looks like __–__–.
bool getValue(int function, int value) const
Get value.
virtual ~WalshFunction()
Destructor.
void dump(bool whitespace=true) const
Dump the values to stdout.
Class to generate and manipulate Walsh functions.
Definition: WalshFunction.h:35