41 double delta = 1.0 / double(nbBins - 1);
44 for (
size_t k = 0; k < nbBins; k++)
50 for (
size_t i = 0; i < preF.
GetCols(); i++)
83 if (denominator != 0.0)
85 URealToRealFunction newF = CloneAs<RealToRealFunction>(f);
87 size_t n = newF->GetImageSize();
89 double delta = 1.0 / double(n - 1);
91 for (
size_t k = 0; k < n; k++)
93 newF->SetElement(k, newF->At(k) * x);
97 return newF->TrapezoidIntegral() / denominator;
RealToRealFunction MakeCompatibility(const RealToRealFunction &f, const RealToRealFunction &g, size_t nbBins)
Computes the compatibility function between a regular function and a approximated function...
MatrixDouble MakePreimage(double y) const
Finds the possible preimages of a given image value.
size_t GetCols() const noexcept
Returns the number of columns.
double TrapezoidIntegral() const
Evaluates the integral with the trapezoid method.
Numerical integration toolbox class.
double DefuzzificationCOG(double min, double max, const RealToRealFunction &f)
Defuzzification over an interval using center of gravity method.
void SetRightEndpoint(double d) noexcept
Sets the end of the definition interval.
const T & At(size_t pos) const noexcept
void SetImageSize(size_t s)
Sets the number of elements to be modelized if the image.
void SetLeftEndpoint(double d) noexcept
Sets the beginning of the definition interval.
double Evaluate(double x) const
Evaluates the image a given point.
An item was not found in a container.
void SetElement(size_t k, double v)
Sets a given image.