UnknownVariable Class Reference

A variable with unknown value. More...

`#include <Variable.h>`

Inheritance diagram for UnknownVariable:

## Public Member Functions

| UnknownVariable (string cat_, string name_, string title_="", bool is_local=true, bool is_builtin=false, bool is_active=true)
| UnknownVariable ()
| UnknownVariable (const UnknownVariable *variable)
virtual ExpressionItem * | copy () const
virtual void | set (const ExpressionItem *item)
bool | isKnown () const
void | setAssumptions (Assumptions *ass)
void | setAssumptions (const MathStructure &mvar)
Assumptions * | assumptions ()
const MathStructure & | interval () const
void | setInterval (const MathStructure &o)
virtual int | subtype () const
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 | representsNonComplex (bool=false)
virtual bool | representsComplex (bool=false)
virtual bool | representsNonZero (bool=false)
virtual bool | representsNonMatrix ()
virtual bool | representsScalar ()
Public Member Functions inherited from Variable
| Variable (string cat_, string name_, string title_="", bool is_local=true, bool is_builtin=false, bool is_active=true)
| Variable (const Variable *variable)
virtual int | type () const
virtual bool | representsNonInteger (bool=false)
virtual bool | representsFraction (bool=false)
virtual bool | representsEven (bool=false)
virtual bool | representsOdd (bool=false)
virtual bool | representsUndefined (bool=false, bool=false, bool=false)
virtual bool | representsBoolean ()
Public Member Functions inherited from ExpressionItem
| ExpressionItem (string cat_, string name_, string title_="", string descr_="", bool is_local=true, bool is_builtin=false, bool is_active=true)
virtual bool | destroy ()
bool | isRegistered () const
void | setRegistered (bool is_registered)
| For internal use.
virtual const string & | name (bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
virtual const string & | referenceName () const
virtual const ExpressionName & | preferredName (bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
virtual const ExpressionName & | preferredInputName (bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
virtual const ExpressionName & | preferredDisplayName (bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
virtual const ExpressionName & | getName (size_t index) const
virtual void | setName (const ExpressionName &ename, size_t index=1, bool force=true)
virtual void | setName (string sname, size_t index, bool force=true)
virtual void | addName (const ExpressionName &ename, size_t index=0, bool force=true)
virtual void | addName (string sname, size_t index=0, bool force=true)
virtual size_t | countNames () const
virtual void | clearNames ()
virtual void | clearNonReferenceNames ()
virtual void | removeName (size_t index)
virtual size_t | hasName (const string &sname, bool case_sensitive=true) const
virtual size_t | hasNameCaseSensitive (const string &sname) const
virtual const ExpressionName & | findName (int abbreviation=-1, int use_unicode=-1, int plural=-1, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
virtual const string & | title (bool return_name_if_no_title=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
virtual void | setTitle (string title_)
virtual const string & | description () const
virtual void | setDescription (string descr_)
virtual const string & | category () const
virtual void | setCategory (string cat_)
virtual bool | hasChanged () const
virtual void | setChanged (bool has_changed)
virtual bool | isLocal () const
virtual bool | setLocal (bool is_local=true, int will_be_active=-1)
virtual bool | isBuiltin () const
virtual bool | isApproximate () const
virtual void | setApproximate (bool is_approx=true)
virtual int | precision () const
virtual void | setPrecision (int prec)
virtual bool | isActive () const
virtual void | setActive (bool is_active)
virtual bool | isHidden () const
virtual void | setHidden (bool is_hidden)
virtual int | refcount () const
virtual void | ref ()
virtual void | unref ()
virtual void | ref (ExpressionItem *o)
virtual void | unref (ExpressionItem *o)
virtual ExpressionItem * | getReferencer (size_t index=1) const
virtual bool | changeReference (ExpressionItem *o_from, ExpressionItem *o_to)

## Protected Attributes

Assumptions * | o_assumption
MathStructure * | mstruct
Protected Attributes inherited from ExpressionItem
string | scat
string | stitle
string | sdescr
bool | b_local
bool | b_changed
bool | b_builtin
bool | b_approx
bool | b_active
bool | b_registered
bool | b_hidden
bool | b_destroyed
int | i_ref
int | i_precision
vector< ExpressionItem * > | v_refs
vector< ExpressionName > | names

## Detailed Description

A variable with unknown value.

Unknown variables have an associated assumption object.

## Constructor & Destructor Documentation

## UnknownVariable() [1/3]

UnknownVariable::UnknownVariable | ( | string | cat_,
|  | string | name_,
|  | string | title_ = `""`,
|  | bool | is_local = `true`,
|  | bool | is_builtin = `false`,
|  | bool | is_active = `true`
| ) |  |

Create an unknown.

Parameters

  cat_ | Category that the variable belongs to.
  name_ | Initial name of the variable.
  title_ | Descriptive name.
  is_local | If the variable is local/user-defined or global.
  is_builtin | If the variable is builtin and not modifiable.
  is_active | If the variable is active and can be used in expressions.

## UnknownVariable() [2/3]

UnknownVariable::UnknownVariable | ( |  | ) |

Create an empty unknown variable.

## UnknownVariable() [3/3]

UnknownVariable::UnknownVariable | ( | const UnknownVariable * | variable | ) |

Create a copy of an unknown variable.

Parameters

  variable | Unknown variable to copy.

## Member Function Documentation

## assumptions()

Assumptions* UnknownVariable::assumptions | ( |  | ) |

Returns the assumptions of the unknown variable.

Returns
  Assumptions of the unknown variable.

## isKnown()

bool UnknownVariable::isKnown | ( |  | ) | const

inline virtual

Returns if the variable has a known value (as oppossed to assumptions).

Returns
  true if the variable is of class KnownVariable, false if UnknownVariable.

Implements Variable.

## representsPositive()

virtual bool UnknownVariable::representsPositive | ( | bool | = `false` | ) |

virtual

Returns if the variable represents a positive value.

Reimplemented from Variable.

## setAssumptions()

void UnknownVariable::setAssumptions | ( | Assumptions * | ass | ) |

Sets the assumptions of the unknown variable.

Parameters

  ass | Assumptions.

## subtype()

virtual int UnknownVariable::subtype | ( |  | ) | const

inline virtual

Returns the subtype of the variable, corresponding to which subsubclass the object belongs to.

Returns
  VariableSubtype.

Reimplemented from Variable.

References SUBTYPE_UNKNOWN_VARIABLE.

The documentation for this class was generated from the following file:

- libqalculate/Variable.h