The Complexity class is used throughout the library to estimate the computational cost of the different components of the library. More...
#include <Complexity.h>
Public Types | |
typedef std::pair< std::string, scalar > | Measure |
Returns a vector containing the measures of complexity. More... | |
Public Member Functions | |
Complexity (scalar all=0.0) | |
Complexity (scalar comparison, scalar arithmetic, scalar function) | |
virtual | ~Complexity () |
Complexity & | operator+= (const Complexity &other) |
Complexity & | operator-= (const Complexity &other) |
Complexity & | operator*= (const Complexity &other) |
Complexity & | operator/= (const Complexity &other) |
Complexity | operator+ (const Complexity &rhs) const |
Complexity | operator- (const Complexity &rhs) const |
Complexity | operator* (const Complexity &rhs) const |
Complexity | operator/ (const Complexity &rhs) const |
bool | operator== (const Complexity &rhs) const |
bool | operator!= (const Complexity &rhs) const |
bool | operator< (const Complexity &rhs) const |
bool | operator<= (const Complexity &rhs) const |
bool | operator> (const Complexity &rhs) const |
bool | operator>= (const Complexity &rhs) const |
virtual Complexity & | comparison (scalar comparison) |
Increases the comparison measure by the given amount. More... | |
virtual void | setComparison (scalar comparison) |
virtual scalar | getComparison () const |
virtual Complexity & | arithmetic (scalar arithmetic) |
Increases the arithmetic measure by the given amount. More... | |
virtual void | setArithmetic (scalar arithmetic) |
virtual scalar | getArithmetic () const |
virtual Complexity & | function (scalar function) |
Increases the function measure by the given amount. More... | |
virtual void | setFunction (scalar function) |
virtual scalar | getFunction () const |
virtual std::vector< Measure > | measures () const |
virtual Complexity & | plus (const Complexity &x) |
Increases the complexity by the given parameter. More... | |
virtual Complexity & | minus (const Complexity &x) |
Reduces the complexity by the given parameter. More... | |
virtual Complexity & | multiply (const Complexity &x) |
Multiplies the complexity by the given parameter. More... | |
virtual Complexity & | divide (const Complexity &x) |
Divides the complexity by the given parameter. More... | |
virtual Complexity & | plus (scalar x) |
Increases each measure by the given parameter. More... | |
virtual Complexity & | minus (scalar x) |
Reduces each measure by the given parameter. More... | |
virtual Complexity & | multiply (scalar x) |
Multiplies each measure by the given parameter. More... | |
virtual Complexity & | divide (scalar x) |
Divides each measure by the given parameter. More... | |
virtual bool | equals (const Complexity &x, scalar macheps=fuzzylite::macheps()) const |
Compares the complexity for equality to another with the given tolerance. More... | |
virtual bool | lessThan (const Complexity &x, scalar macheps=fuzzylite::macheps()) const |
Compares the complexity for strict inequality (less than) to another with the given tolerance. More... | |
virtual bool | lessThanOrEqualsTo (const Complexity &x, scalar macheps=fuzzylite::macheps()) const |
Compares the complexity for inequality (less than or equal to) to another with the given tolerance. More... | |
virtual bool | greaterThan (const Complexity &x, scalar macheps=fuzzylite::macheps()) const |
Compares the complexity for strict inequality (greater than) to another with the given tolerance. More... | |
virtual bool | greaterThanOrEqualsTo (const Complexity &x, scalar macheps=fuzzylite::macheps()) const |
Compares the complexity for inequality (greater than or equal to) to another with the given tolerance. More... | |
virtual scalar | sum () const |
Computes the sum of the measures. More... | |
virtual scalar | norm () const |
Computes the norm of the complexity. More... | |
virtual std::string | toString () const |
Returns the measures of the complexity. More... | |
virtual Complexity | compute (const Engine *engine) const |
Computes the complexity of the given engine as the sum of complexities of the rule blocks. More... | |
virtual Complexity | compute (const InputVariable *inputVariable) const |
Computes the complexity of the given input variable. More... | |
virtual Complexity | compute (const OutputVariable *outputVariable) const |
Computes the complexity of the given output variable. More... | |
virtual Complexity | compute (const std::vector< InputVariable *> &inputVariables) const |
Computes the complexity of the given input variables. More... | |
virtual Complexity | compute (const std::vector< OutputVariable *> &outputVariables, bool complexityOfDefuzzification=false) const |
Computes the complexity of the given output variables. More... | |
virtual Complexity | compute (const std::vector< Variable *> &variables) const |
Computes the complexity of the given variables. More... | |
virtual Complexity | compute (const RuleBlock *ruleBlock) const |
Computes the complexity of the given rule block. More... | |
virtual Complexity | compute (const std::vector< RuleBlock *> &ruleBlocks) const |
Computes the complexity of the given rule blocks. More... | |
The Complexity class is used throughout the library to estimate the computational cost of the different components of the library.
Definition at line 50 of file Complexity.h.
typedef std::pair<std::string, scalar> fl::Complexity::Measure |
Returns a vector containing the measures of complexity.
Definition at line 113 of file Complexity.h.
|
explicit |
|
virtual |
|
virtual |
Increases the arithmetic measure by the given amount.
arithmetic | is the amount to increase the comparison measure by |
|
virtual |
Increases the comparison measure by the given amount.
comparison | is the amount to increase the comparison measure by |
|
virtual |
Computes the complexity of the given engine as the sum of complexities of the rule blocks.
engine | is the engine for which to compute the complexity |
|
virtual |
Computes the complexity of the given input variable.
inputVariable | is the input variable for which to compute the complexity |
|
virtual |
Computes the complexity of the given output variable.
outputVariable | is the output variable for which to compute the complexity |
|
virtual |
Computes the complexity of the given input variables.
inputVariables | is the vector of input variables for which to compute the complexity |
|
virtual |
Computes the complexity of the given output variables.
outputVariables | is the vector of output variables for which to compute the complexity |
complexityOfDefuzzification | indicates whether to compute the complexity of the variable including the defuzzification process |
|
virtual |
Computes the complexity of the given variables.
variables | is the vector of variables for which to compute the complexity |
|
virtual |
Computes the complexity of the given rule block.
ruleBlock | is the rule block for which to compute the complexity |
|
virtual |
Computes the complexity of the given rule blocks.
ruleBlocks | is the vector of rule blocks for which to compute the complexity |
|
virtual |
Divides the complexity by the given parameter.
x | is the divisor |
|
virtual |
Divides each measure by the given parameter.
x | is the divisor |
|
virtual |
Compares the complexity for equality to another with the given tolerance.
x | is the complexity to compare against |
macheps | is the tolerance to compare floating-point values |
true
if every measure in this satisfies Op::isEq(this, x, macheps), and false
otherwise
|
virtual |
Increases the function measure by the given amount.
function | is the amount to increase the function measure by |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
Compares the complexity for strict inequality (greater than) to another with the given tolerance.
x | is the complexity to compare against |
macheps | is the tolerance to compare floating-point values |
true
if every measure in this satisfies Op::isGt(this, x, macheps), and false
otherwise
|
virtual |
Compares the complexity for inequality (greater than or equal to) to another with the given tolerance.
x | is the complexity to compare against |
macheps | is the tolerance to compare floating-point values |
true
if every measure in this satisfies Op::isGE(this, x, macheps), and false
otherwise
|
virtual |
Compares the complexity for strict inequality (less than) to another with the given tolerance.
x | is the complexity to compare against |
macheps | is the tolerance to compare floating-point values |
true
if every measure in this satisfies Op::isLt(this, x, macheps), and false
otherwise
|
virtual |
Compares the complexity for inequality (less than or equal to) to another with the given tolerance.
x | is the complexity to compare against |
macheps | is the tolerance to compare floating-point values |
true
if every measure in this satisfies Op::isLE(this, x, macheps), and false
otherwise
|
virtual |
|
virtual |
Reduces the complexity by the given parameter.
x | is the subtrahend |
|
virtual |
Reduces each measure by the given parameter.
x | is the subtrahend |
|
virtual |
Multiplies the complexity by the given parameter.
x | is the multiplicand |
|
virtual |
Multiplies each measure by the given parameter.
x | is the multiplicand |
|
virtual |
Computes the norm of the complexity.
bool fl::Complexity::operator!= | ( | const Complexity & | rhs | ) | const |
Complexity fl::Complexity::operator* | ( | const Complexity & | rhs | ) | const |
Complexity& fl::Complexity::operator*= | ( | const Complexity & | other | ) |
Complexity fl::Complexity::operator+ | ( | const Complexity & | rhs | ) | const |
Complexity& fl::Complexity::operator+= | ( | const Complexity & | other | ) |
Complexity fl::Complexity::operator- | ( | const Complexity & | rhs | ) | const |
Complexity& fl::Complexity::operator-= | ( | const Complexity & | other | ) |
Complexity fl::Complexity::operator/ | ( | const Complexity & | rhs | ) | const |
Complexity& fl::Complexity::operator/= | ( | const Complexity & | other | ) |
bool fl::Complexity::operator< | ( | const Complexity & | rhs | ) | const |
bool fl::Complexity::operator<= | ( | const Complexity & | rhs | ) | const |
bool fl::Complexity::operator== | ( | const Complexity & | rhs | ) | const |
bool fl::Complexity::operator> | ( | const Complexity & | rhs | ) | const |
bool fl::Complexity::operator>= | ( | const Complexity & | rhs | ) | const |
|
virtual |
Increases the complexity by the given parameter.
x | is the addend |
|
virtual |
Increases each measure by the given parameter.
x | is the addend |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
Computes the sum of the measures.
|
virtual |
Returns the measures of the complexity.