41 #include "../NumConstants.h" 43 #include "../VectorTools.h" 63 for (
unsigned int i = 0; i <
dim_; i++)
65 vProb_.push_back(probas[i]);
72 for (
unsigned int i = 0; i <
dim_ - 1; i++)
79 for (
unsigned int i = 0; i <
dim_ - 1; i++)
83 for (
unsigned int i = 0; i <
dim_ - 1; i++)
89 for (
size_t i = 1; i <
dim_; i++)
99 double i1 = 0, i0 = 0;
101 size_t pi = i & ~(1 << (li2 - 1));
104 size_t t = (j << li2) + pi;
109 t += (1 << (li2 - 1));
120 Simplex::Simplex(
size_t dim,
unsigned short method,
bool allowNull,
const std::string& name) :
130 for (
size_t i = 0; i <
dim_; i++)
132 vProb_.push_back(1. / static_cast<double>(
dim_));
141 for (
unsigned int i = 0; i <
dim_ - 1; i++)
148 for (
unsigned int i = 0; i <
dim_ - 1; i++)
152 for (
unsigned int i = 0; i <
dim_ - 1; i++)
158 for (
unsigned int i = 0; i <
dim_ - 1; i++)
180 for (
unsigned int i = 0; i <
dim_ - 1; i++)
189 for (
unsigned int i = 0; i <
dim_ - 1; i++)
197 for (
unsigned int i = 0; i <
dim_ - 1; i++)
203 for (
unsigned int i = 0; i <
dim_; i++)
217 for (
size_t i = 0; i <
dim_; i++)
228 if ((k + (1 << (ld - 1))) <
dim_)
255 for (
unsigned int i = 0; i <
dim_ - 1; i++)
262 for (
unsigned int i = 0; i <
dim_ - 1; i++)
265 valpha_[i] = probas[i + 1] / probas[i];
269 for (
size_t i = 1; i <
dim_; i++)
279 double i1 = 0, i0 = 0;
281 size_t pi = i & ~(1 << (li2 - 1));
284 size_t t = (j << li2) + pi;
289 t += (1 << (li2 - 1));
void fireParameterChanged(const ParameterList ¶meters)
Notify the class when one or several parameters have changed.
void setFrequencies(const std::vector< double > &)
void fireParameterChanged(const ParameterList ¶meters)
Notify the class when one or several parameters have changed.
This class allows to perform a correspondence analysis.
std::vector< double > vProb_
static const IntervalConstraint PROP_CONSTRAINT_EX
This class is designed to facilitate the manipulation of parameters.
void addParameter_(Parameter *parameter)
size_t dim_
The dimension+1 of the space simplex (ie the number of probabilities).
static std::string toString(T t)
General template method to convert to a string.
The parameter list object.
A partial implementation of the Parametrizable interface.
std::vector< double > valpha_
just used with local ratio (method 2)
The constraint interface.
Simplex(size_t dim, unsigned short method=0, bool allowNull=false, const std::string &name="Simplex.")
Builds a new Simplex object from a number of probabilities. They are initialized equal.
bool matchParametersValues(const ParameterList ¶meters)
Update the parameters from parameters.
virtual void addParameter(const Parameter ¶m)
Add a new parameter at the end of the list.
static const IntervalConstraint PROP_CONSTRAINT_IN
std::string getNamespace() const
unsigned short method_
the method of parametrization.
double getParameterValue(const std::string &name) const
Get the value for parameter of name 'name'.