#include <Variable.h>
Inheritance diagram for KnownVariable:
Public Member Functions | |
KnownVariable (string cat_, string name_, const MathStructure &o, string title_="", bool is_local=true, bool is_builtin=false, bool is_active=true) | |
KnownVariable (string cat_, string name_, string expression_, string title_="", bool is_local=true, bool is_builtin=false, bool is_active=true) | |
KnownVariable () | |
KnownVariable (const KnownVariable *variable) | |
virtual ExpressionItem * | copy () const |
virtual void | set (const ExpressionItem *item) |
bool | isKnown () const |
virtual bool | isExpression () const |
virtual string | expression () const |
int | subtype () const |
virtual void | set (const MathStructure &o) |
virtual void | set (string expression_) |
virtual const MathStructure & | get () |
virtual bool | representsPositive (bool=false) |
virtual bool | representsNegative (bool=false) |
virtual bool | representsNonNegative (bool=false) |
virtual bool | representsNonPositive (bool=false) |
virtual bool | representsInteger (bool=false) |
virtual bool | representsNumber (bool=false) |
virtual bool | representsRational (bool=false) |
virtual bool | representsReal (bool=false) |
virtual bool | representsComplex (bool=false) |
virtual bool | representsNonZero (bool=false) |
virtual bool | representsEven (bool=false) |
virtual bool | representsOdd (bool=false) |
virtual bool | representsUndefined (bool=false, bool=false, bool=false) |
virtual bool | representsBoolean () |
virtual bool | representsNonMatrix () |
Protected Attributes | |
MathStructure * | mstruct |
bool | b_expression |
int | calculated_precision |
string | sexpression |
Known variables have an associated value. The value can be a simple number or a full mathematical expression. The known variable class is used both for variable values and constants.
The value can be provided as an expression in the form of a text string or as a mathematical value in the form of an object of the MathStructure class. The text string is parsed when needed, which saves time when loading many variable definitions which might not be used, at least not immediately.
|
Create a known variable with a value.
|
|
Create a known variable with an text string expression.
|
|
Create an empty known variable. Primarily for internal use. |
|
Create a copy of a known variable.
|
|
Returns the variable's string expression or an empty string if it has not got an expression.
|
|
Returns the value of the variable. If no value is set or parsed and an expression is set, the expression is parsed and resulting value returned.
Reimplemented in DynamicVariable. |
|
Returns if the variable has an text string expression instead of a value.
|
|
Returns if the variable has a known value (as oppossed to assumptions).
Implements Variable. |
|
Returns if the variable represents a positive value. Reimplemented from Variable. Reimplemented in DynamicVariable. |
|
Sets the text string expression of the variable. The value is cleared.
Reimplemented in DynamicVariable. |
|
Sets the value of the variable. If expression is set, it is cleared.
Reimplemented in DynamicVariable. |
|
Returns the subtype of the variable, corresponding to which subsubclass the object belongs to.
Reimplemented from Variable. |