A fuzzy logic C++ library
|
A class for a fuzzy value [0-1]. More...
#include <fuzzytype.hpp>
Public Member Functions | |
FUZZYVAL () | |
FUZZYVAL (double v) | |
FUZZYVAL & | operator= (const double &v) |
Assignment operator from double (does truncating) | |
bool | operator== (const double &v) const |
Equality operator for double. | |
FUZZYVAL | Complement (const FUZZYVAL &f_in) |
Complement operator. | |
operator double () const | |
Used to convert automatically to a double. | |
bool | IsZero () const |
bool | IsOne () const |
Private Attributes | |
double | _y |
The fuzzy value. | |
Friends | |
std::ostream & | operator<< (std::ostream &Stream, const FUZZYVAL &obj) |
The << operator must be defined as a friend function, see .cpp file. |
A class for a fuzzy value [0-1].
if( 1. - MyFuzzyValue > Threshold )
DoThis();
if( MyFuzzyValue.IsOne() )
DoThis();
slifis::FUZZYVAL::FUZZYVAL | ( | ) | [inline] |
References _y.
Referenced by Complement().
slifis::FUZZYVAL::FUZZYVAL | ( | double | v | ) | [inline] |
References _y.
FUZZYVAL& slifis::FUZZYVAL::operator= | ( | const double & | v | ) | [inline] |
Assignment operator from double (does truncating)
References _y.
bool slifis::FUZZYVAL::operator== | ( | const double & | v | ) | const [inline] |
Equality operator for double.
References _y, and SLIFIS_EPSILON_FUZZY.
FUZZYVAL slifis::FUZZYVAL::Complement | ( | const FUZZYVAL & | f_in | ) | [inline] |
Complement operator.
References _y, and FUZZYVAL().
slifis::FUZZYVAL::operator double | ( | ) | const [inline] |
Used to convert automatically to a double.
References _y.
bool slifis::FUZZYVAL::IsZero | ( | ) | const [inline] |
bool slifis::FUZZYVAL::IsOne | ( | ) | const [inline] |
References _y, and SLIFIS_EPSILON_FUZZY.
Referenced by slifis::FUZZY_ROOT::IsNormalised(), slifis::MEMBFUNC::Scale(), and slifis::MEMBFUNC::Truncate().
std::ostream& operator<< | ( | std::ostream & | Stream, |
const FUZZYVAL & | obj | ||
) | [friend] |
The << operator must be defined as a friend function, see .cpp file.
double slifis::FUZZYVAL::_y [private] |
The fuzzy value.
Referenced by Complement(), FUZZYVAL(), IsOne(), IsZero(), operator double(), operator=(), and operator==().