17 #ifndef FL_FUZZYLITE_H 18 #define FL_FUZZYLITE_H 29 #define FL_BUILD_PATH "" 32 #if defined(_WIN32) || defined(WIN32) 36 #if defined(unix) || defined(__unix__) || defined(__unix) 47 #define FL__FILE__ std::string(__FILE__).substr(std::string(FL_BUILD_PATH).size()) 49 #define FL_LOG_PREFIX FL__FILE__ << " (" << __LINE__ << "):" 51 #define FL_AT FL__FILE__, __LINE__, __FUNCTION__ 53 #define FL_LOG(message) {if (fl::fuzzylite::isLogging()){std::cout << FL_LOG_PREFIX << message << std::endl;}} 54 #define FL_LOGP(message) {if (fl::fuzzylite::isLogging()){std::cout << message << std::endl;}} 56 #define FL_DEBUG_BEGIN if (fl::fuzzylite::isDebugging()){ 57 #define FL_DEBUG_END } 59 #define FL_DBG(message) FL_DEBUG_BEGIN\ 60 std::cout << FL__FILE__ << "::" << __FUNCTION__ << "[" << __LINE__ << "]:" \ 61 << message << std::endl;\ 76 #pragma warning (disable:4251) 85 #if defined(FL_EXPORT_LIBRARY) 86 #define FL_API __declspec(dllexport) 87 #elif defined(FL_IMPORT_LIBRARY) 88 #define FL_API __declspec(dllimport) 117 #define FL_IUNUSED(x) (void) (x) 120 #define FL_IUNUSED_DECL __attribute__((unused)) 122 #define FL_IUNUSED_DECL 132 const scalar inf FL_IUNUSED_DECL = std::numeric_limits<scalar>::infinity();
142 const long null = 0L;
143 #define FL_unique_ptr std::auto_ptr 144 #define FL_move_ptr(x) x 151 #define FL_INOEXCEPT throw() 152 #define FL_ITHREAD_LOCAL 155 #define FL_DEFAULT_COPY(Class) 156 #define FL_DEFAULT_MOVE(Class) 157 #define FL_DEFAULT_COPY_AND_MOVE(Class) 159 #define FL_DISABLE_COPY(Class) \ 160 Class(const Class &);\ 161 Class &operator=(const Class &); 171 const std::nullptr_t null =
nullptr;
172 #define FL_unique_ptr std::unique_ptr 173 #define FL_move_ptr(x) std::move(x) 176 #define FL_IOVERRIDE override 177 #define FL_IFINAL final 178 #define FL_IDEFAULT = default 179 #define FL_IDELETE = delete 180 #define FL_INOEXCEPT noexcept 181 #define FL_ITHREAD_LOCAL 184 #define FL_DEFAULT_COPY(Class) \ 185 Class(const Class&) = default; \ 186 Class& operator=(const Class&) = default; 187 #define FL_DEFAULT_MOVE(Class) \ 188 Class(Class&&) = default; \ 189 Class& operator=(Class&&) = default; 190 #define FL_DEFAULT_COPY_AND_MOVE(Class) \ 191 Class(const Class&) = default; \ 192 Class& operator=(const Class&) = default;\ 193 Class(Class&&) = default; \ 194 Class& operator=(Class&&) = default; 196 #define FL_DISABLE_COPY(Class) \ 197 Class(const Class &) = delete;\ 198 Class &operator=(const Class &) = delete; 220 static int _decimals;
222 static std::ios_base::fmtflags _scalarFormat;
223 static bool _logging;
224 static bool _debugging;
230 static std::string name();
235 static std::string version();
240 static std::string library();
246 static std::string license();
252 static std::string author();
258 static std::string company();
264 static std::string website();
271 static int decimals();
278 static void setDecimals(
int decimals);
294 static void setMachEps(
scalar macheps);
302 static void setScalarFormat(std::ios_base::fmtflags scalarFormat);
309 static std::ios_base::fmtflags scalarFormat();
317 static bool isLogging();
325 static void setLogging(
bool logging);
332 static bool isDebugging();
338 static void setDebugging(
bool debugging);
344 static std::string platform();
350 static std::string floatingPoint();
362 return name() +
" " + version();
370 return "FuzzyLite License";
374 return "Juan Rada-Vilela, Ph.D.";
378 return "FuzzyLite Limited";
382 return "http://www.fuzzylite.com/";
386 _debugging = debugging;
394 _decimals = decimals;
402 _scalarFormat = scalarFormat;
406 return _scalarFormat;
static std::ios_base::fmtflags scalarFormat()
Gets the default format to be utilized for every fl::scalar passed to Op::str()
static std::string library()
Returns the name of the fuzzylite library including the version.
const std::nullptr_t null
Represents the C++11 or C++98 null pointer depending on whether the compilation flag -DFL_CPP98 is se...
The fuzzylite class contains global settings and information about the library.
static void setMachEps(scalar macheps)
Sets the minimum difference at which two floating-point values are considered equivalent.
double scalar
Represents floating-point values (typedef to float or double).
static std::string version()
Returns the version of the fuzzylite library.
static std::string name()
Returns the name of the fuzzylite library.
The Operation class contains methods for numeric operations, string manipulation, and other functions...
static int decimals()
Returns the number of decimals utilized when formatting scalar values.
static bool isDebugging()
Indicates whether the library is running in debug mode.
static void setScalarFormat(std::ios_base::fmtflags scalarFormat)
Sets the default format to be utilized for every fl::scalar passed to Op::str()
static void setDebugging(bool debugging)
Sets whether the library is set to run in debug mode.
static std::string website()
Returns the website of the fuzzylite library.
static void setDecimals(int decimals)
Sets the number of decimals utilized when formatting scalar values.
static std::string license()
Returns the license under which the fuzzylite library is released.
static std::string author()
Returns the name of the author of the fuzzylite library.
static void setLogging(bool logging)
Sets whether the library is set to log information using the macro FL_LOG
static scalar macheps()
Returns the minimum difference at which two floating-point values are considered equivalent.
static bool isLogging()
Returns whether the library is logging information via the FL_LOG macro.
static std::string company()
Returns the name of the company that owns the fuzzylite library.
const scalar nan FL_IUNUSED_DECL
Represents the Not-A-Number scalar value.