A fuzzy logic C++ library
|
A point of a membership function = a pair (REALVAL,FUZZYVAL) More...
#include <fpoint.hpp>
Public Member Functions | |
FPOINT () | |
FPOINT (REALVAL x, FUZZYVAL y) | |
~FPOINT () | |
void | Set (REALVAL x, FUZZYVAL y) |
void | Set (const FPOINT &p) |
REALVAL | GetX () const |
FUZZYVAL | GetY () const |
void | SetX (REALVAL x) |
void | AddX (REALVAL val) |
void | SetY (FUZZYVAL y) |
I/O functions | |
void | Print (FILE *f=stderr, const char *name=NULL) const |
operators | |
bool | operator< (const FPOINT &fpt) const |
Operator needed for sorting, sorts point according to Ox axis ('real' axis) | |
bool | operator== (const FPOINT &fpt) const |
Returns true if point fpt and current point are identical, up to a certain value (see "more") | |
bool | operator!= (const FPOINT &m) const |
Private Member Functions | |
bool | P_Write_bin (std::ofstream &f) const |
Writes fuzzy point in stream f , returns true on success. | |
bool | P_Read_bin (std::ifstream &f) |
Read the fuzzy point from stream f , returns true on success. | |
bool | P_Read_XML (TiXmlElement *pElem) |
Private Attributes | |
FUZZYVAL | _y |
y-axis value of the point. Value is restricted to [0-1] | |
REALVAL | _x |
x-axis value of the point. Value is not restricted | |
Friends | |
class | MEMBFUNC |
std::ostream & | operator<< (std::ostream &Stream, const FPOINT &obj) |
A point of a membership function = a pair (REALVAL,FUZZYVAL)
All the functions that assign a value to the Fuzzy value (constructor and Set(REALVAL x, FUZZYVAL y) ) truncate the value so it always lies in the range [0:1]
Referenced by Set().
slifis::FPOINT::FPOINT | ( | REALVAL | x, |
FUZZYVAL | y | ||
) | [inline] |
void slifis::FPOINT::Set | ( | REALVAL | x, |
FUZZYVAL | y | ||
) | [inline] |
References FPOINT(), and Set().
Referenced by slifis::MEMBFUNC::P_RemoveUselessPoints(), and Set().
void slifis::FPOINT::Set | ( | const FPOINT & | p | ) | [inline] |
REALVAL slifis::FPOINT::GetX | ( | ) | const [inline] |
References _x.
Referenced by slifis::MEMBFUNC::AddPoint(), slifis::MEMBFUNC::AlphaCut(), DrawDefuzz(), slifis_plot::PLOT_FUZZY::DrawPoint(), slifis::MEMBFUNC::Fuzzify(), slifis::FuzzyBSum(), slifis::FuzzyLukas(), slifis::FuzzyProduct(), slifis::FuzzyPSum(), slifis::MEMBFUNC::GetPointsAtY(), slifis::MEMBFUNC::GetRange(), slifis::FUZZY_ROOT::IsNormalised(), slifis::MEMBFUNC::IsValid(), main(), slifis::MEMBFUNC::ModifyPoint(), slifis_plot::PLOT_FS::P_ComputeScale(), slifis_plot::PLOT_MF::P_ComputeScale(), slifis::MEMBFUNC::P_Defuzz_COA(), slifis::MEMBFUNC::P_Defuzz_COG(), slifis::MEMBFUNC::P_Defuzz_MAX(), slifis::MEMBFUNC::P_Defuzz_MEMAX(), slifis_plot::PLOT_FUZZY::P_DrawMembFunc(), slifis_plot::PLOT_MF::P_DrawPlot(), slifis_plot::PLOT_FUZZY::P_DrawVLine2Point(), slifis::P_FindLowestFunction(), slifis::P_FIP_OneSide(), slifis::MEMBFUNC::P_GetIntervalPointsVector(), slifis::MEMBFUNC::P_PointIsTooClose(), slifis::P_Process_OneSide(), slifis::MEMBFUNC::P_RemoveUselessPoints(), and slifis::SLIFIS::P_Write_FCL().
FUZZYVAL slifis::FPOINT::GetY | ( | ) | const [inline] |
References _y.
Referenced by slifis::MEMBFUNC::AlphaCut(), slifis::MEMBFUNC::Complement(), slifis_plot::PLOT_FUZZY::DrawPoint(), slifis::MEMBFUNC::Fuzzify(), slifis::MEMBFUNC::GetLeftValue(), slifis::MEMBFUNC::GetNbMaximums(), slifis::MEMBFUNC::GetPointsAtY(), slifis::MEMBFUNC::GetRightValue(), slifis::FUZZY_ROOT::IsNormalised(), slifis::MEMBFUNC::ModifyPoint(), slifis::MEMBFUNC::P_AddPoint(), slifis::MEMBFUNC::P_Defuzz_COA(), slifis::MEMBFUNC::P_Defuzz_COG(), slifis::MEMBFUNC::P_Defuzz_MAX(), slifis::MEMBFUNC::P_Defuzz_MEMAX(), slifis_plot::PLOT_FUZZY::P_DrawMembFunc(), slifis_plot::PLOT_MF::P_DrawPlot(), slifis_plot::PLOT_FUZZY::P_DrawVLine2Point(), slifis::P_FIP_OneSide(), slifis::P_Process_OneSide(), slifis::MEMBFUNC::P_RemoveUselessPoints(), slifis::SLIFIS::P_Write_FCL(), and slifis::MEMBFUNC::Scale().
void slifis::FPOINT::SetX | ( | REALVAL | x | ) | [inline] |
References _x.
void slifis::FPOINT::AddX | ( | REALVAL | val | ) | [inline] |
References _x.
Referenced by slifis::MEMBFUNC::Shift().
void slifis::FPOINT::SetY | ( | FUZZYVAL | y | ) | [inline] |
References _y.
Referenced by slifis::MEMBFUNC::Complement(), and slifis::MEMBFUNC::Scale().
void slifis::FPOINT::Print | ( | FILE * | f = stderr , |
const char * | name = NULL |
||
) | const |
bool slifis::FPOINT::operator< | ( | const FPOINT & | fpt | ) | const |
Operator needed for sorting, sorts point according to Ox axis ('real' axis)
References _x.
bool slifis::FPOINT::operator== | ( | const FPOINT & | fpt | ) | const |
Returns true if point fpt
and current point are identical, up to a certain value (see "more")
This involves doing floating-point comparison.
Was inlined up to release 0.5.1, but moved over here to keep macro FLOAT_ARE_EQUAL private (symbol not exported)
References _x, _y, FLOAT_ARE_EQUAL, and SLIFIS_EPSILON_FUZZY.
bool slifis::FPOINT::operator!= | ( | const FPOINT & | m | ) | const [inline] |
bool slifis::FPOINT::P_Write_bin | ( | std::ofstream & | f | ) | const [private] |
Writes fuzzy point in stream f
, returns true on success.
References __IN__, __OUT__, STREAM_OK_TEST, and STREAMCHECK_INIT.
bool slifis::FPOINT::P_Read_bin | ( | std::ifstream & | f | ) | [private] |
Read the fuzzy point from stream f
, returns true on success.
References __IN__, __OUT__, STREAM_OK_TEST, and STREAMCHECK_INIT.
Referenced by slifis::MEMBFUNC::P_Read_bin().
bool slifis::FPOINT::P_Read_XML | ( | TiXmlElement * | pElem | ) | [private] |
References SLIFIS_ERROR_LOG, and SLIFIS_XML_READ_DOUBLE_ATTRIB.
Referenced by slifis::MEMBFUNC::P_Read_XML().
friend class MEMBFUNC [friend] |
std::ostream& operator<< | ( | std::ostream & | Stream, |
const FPOINT & | obj | ||
) | [friend] |
FUZZYVAL slifis::FPOINT::_y [private] |
y-axis value of the point. Value is restricted to [0-1]
Referenced by FPOINT(), GetY(), operator==(), Set(), and SetY().
REALVAL slifis::FPOINT::_x [private] |
x-axis value of the point. Value is not restricted
Referenced by AddX(), FPOINT(), GetX(), operator<(), operator==(), Set(), and SetX().