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*/.
/*!@brief Avoid calculating bit value (bin size) and just set it because a resolution is known @param givenLSB @return void
-
void
setRoundDirection
(roundDirection_t direction)¶ 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 */ void setLSBByBits(uint8_t numBits, double min, double max);
- Return
void
- Parameters
direction
:
-
void
setCarryError
(bool carryErrorIn)¶ Sets the round direction (toZero, fromZero, near) for discretization.
- Return
void
- Parameters
carryErrorIn
:
-
Eigen::VectorXd
discretize
(Eigen::VectorXd undiscretizedVector)¶ Discretizes the given truth vector according to a least significant bit (binSize)
- Return
vector of discretized values
- Parameters
undiscretizedVector
:
-
Eigen::VectorXd
getDiscretizationErrors
()¶ Get the discretization errors.
- Return
the errors due to discretization in a corresponding vector
Public Members
-
Eigen::VectorXd
LSB
¶ size of bin, bit value, least significant bit
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.
-