discretize¶
-
class
Discretize
¶ - #include <discretize.h>
This module discretizes data for output. It has the option to carry over discretization error or not.
Public Functions
-
Discretize
()¶ The constructor initialies the random number generator used for the walks
-
Discretize
(uint8_t numStates)¶ This lets the user initialized the discretization model to the right size
-
~Discretize
()¶ The destructor is a placeholder for one that might do something
-
void
setLSB
(Eigen::VectorXd givenLSB)¶ Method determines the size of an output data bin (bit-value) making sure that zero is a possible output and giving proportionate numbers of bits to the size of max and min void.
-
void
setRoundDirection
(roundDirection_t direction)¶ Avoid calculating bit value (bin size) and just set it because a resolution is known.
Sets the round direction (toZero, fromZero, near) for discretization.
This method calculates the least significant bit size given the maximum state value, minimum state value, and number of bits to use..
/*!
- Return
void
- Return
void */ void setLSBByBits(uint8_t numBits, double min, double max);
- Return
void
-
void
setCarryError
(bool carryErrorIn)¶ Sets the round direction (toZero, fromZero, near) for discretization.
- Return
void
-
Eigen::VectorXd
discretize
(Eigen::VectorXd undiscretizedVector)¶ Sets the round direction (toZero, fromZero, near) for discretization.
Discretizes the given truth vector according to a least significant bit (binSize)
- Return
void
- Return
vector of discretized values
- Parameters
newBounds
: the bounds to put on the random walk states
Public Members
Private Members
-
roundDirection_t
roundDirection
¶ Direction to round when discretizing. “toZero”, “fromZero”, and “near” are the options.
-
uint8_t
numStates
¶ Number of states to be discretized (length of vector fed in)
-
Eigen::VectorXd
discErrors
¶ Errors from discretization. Can be returned to adjusted integrated values.
-
bool
carryError
¶ true if discError should be added next time around, false if not.
-