#include <Discrete.h>
Public Member Functions | |
Discrete () | |
Default Constructor. | |
Discrete (DCol &x, DCol &p) | |
Complete Constructor. | |
Discrete (const Discrete &g) | |
Copy Constructor. | |
void | operator= (const Discrete &g) |
Operator =. | |
DCol | expectedValue () |
Returns the expected value. | |
Decimal | covariance (int row, int col) |
Returns the (row-th, col-th) element of the covariance matrix. | |
Decimal | covariance () |
Returns the covariance matrix as a vector of vector with the appropriate size. | |
Decimal | evaluate (DCol p) |
Returns the the value of the pdf in the given position. | |
void | printCovInv () |
Print the invese of the covariance. | |
virtual string | print () |
Returns the the value of the pdf in the given position. | |
bool | findValue (int v, Decimal &pr) |
Returns if a given value is present in the distribution. | |
void | addValue (int v, Decimal pr) |
Add a new value or add the probability to an existing value. | |
void | addValue (ProbabilityMass a) |
Add a new value or add the probability to an existing value. | |
void | normalize () |
Normalize the probability to 1. |
MipBaselib::Discrete::Discrete | ( | ) |
Default Constructor.
Complete Constructor.
[in] | m | Values. |
[in] | c | probability of the values. |
MipBaselib::Discrete::Discrete | ( | const Discrete & | g | ) |
void MipBaselib::Discrete::operator= | ( | const Discrete & | g | ) |
DCol MipBaselib::Discrete::expectedValue | ( | ) | [virtual] |
Decimal MipBaselib::Discrete::covariance | ( | int | row, | |
int | col | |||
) | [virtual] |
Returns the (row-th, col-th) element of the covariance matrix.
[in] | row | Requested row. |
[in] | col | Requested column. |
Implements MipBaselib::PDF.
Decimal MipBaselib::Discrete::covariance | ( | ) |
Returns the covariance matrix as a vector of vector with the appropriate size.
Returns the the value of the pdf in the given position.
[in] | col | Requested position. |
Implements MipBaselib::PDF.
void MipBaselib::Discrete::printCovInv | ( | ) |
Print the invese of the covariance.
[in] | col | Requested position. |
string MipBaselib::Discrete::print | ( | ) | [virtual] |
Returns the the value of the pdf in the given position.
[in] | col | Requested position. |
bool MipBaselib::Discrete::findValue | ( | int | v, | |
Decimal & | pr | |||
) |
Returns if a given value is present in the distribution.
[in] | v | Requested value. |
[out] | &pr | Writes here the probability of the given value, if value is found. |
void MipBaselib::Discrete::addValue | ( | int | v, | |
Decimal | pr | |||
) |
Add a new value or add the probability to an existing value.
[in] | v | New Value. |
[in] | pr | Probability of the new value. |
void MipBaselib::Discrete::addValue | ( | ProbabilityMass | a | ) |
Add a new value or add the probability to an existing value.
[in] | v | New Probability mass. |
void MipBaselib::Discrete::normalize | ( | ) |
Normalize the probability to 1.