Logo Search packages:      
Sourcecode: libqalculate version File versions  Download package

MathFunction Class Reference

#include <Function.h>

Inheritance diagram for MathFunction:

ExpressionItem DataSet UserFunction

List of all members.


Detailed Description

Abstract base class for mathematical functions.

A mathemical function, subclassed from MathFunction, should at least reimplement calculate(MathStructure&, const MathStructure&, const EvaluationOptions&) and copy(), and preferably also the represents* functions. Argument definitions should be added in the constructor.

Definition at line 67 of file Function.h.


Public Member Functions

virtual void addName (string sname, size_t index=0, bool force=true)
virtual void addName (const ExpressionName &ename, size_t index=0, bool force=true)
void appendDefaultValues (MathStructure &vargs)
int args (const string &str, MathStructure &vargs, const ParseOptions &po=default_parse_options)
int args () const
virtual int calculate (MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo)
virtual MathStructure calculate (MathStructure &vargs, const EvaluationOptions &eo=default_evaluation_options)
virtual MathStructure calculate (const string &eq, const EvaluationOptions &eo=default_evaluation_options)
virtual const string & category () const
virtual bool changeReference (ExpressionItem *o_from, ExpressionItem *o_to)
void clearArgumentDefinitions ()
virtual void clearNames ()
virtual void clearNonReferenceNames ()
string condition () const
virtual ExpressionItemcopy () const =0
virtual size_t countNames () const
virtual const string & description () const
virtual bool destroy ()
virtual const ExpressionNamefindName (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
ArgumentgetArgumentDefinition (size_t index)
const string & getDefaultValue (size_t arg_) const
virtual const ExpressionNamegetName (size_t index) const
virtual ExpressionItemgetReferencer (size_t index=1) const
virtual bool hasChanged () const
virtual size_t hasName (const string &sname, bool case_sensitive=true) const
virtual size_t hasNameCaseSensitive (const string &sname) const
virtual bool isActive () const
virtual bool isApproximate () const
virtual bool isBuiltin () const
virtual bool isHidden () const
virtual bool isLocal () const
bool isRegistered () const
size_t lastArgumentDefinitionIndex () const
 MathFunction (const MathFunction *function)
 MathFunction (string name_, int argc_, int max_argc_=0, string cat_="", string title_="", string descr_="", bool is_active=true)
int maxargs () const
int minargs () const
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 int parse (MathStructure &mstruct, const string &eq, const ParseOptions &po=default_parse_options)
virtual MathStructure parse (const string &eq, const ParseOptions &po=default_parse_options)
virtual int precision () const
virtual const ExpressionNamepreferredDisplayName (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 ExpressionNamepreferredInputName (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 ExpressionNamepreferredName (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
string printCondition ()
MathStructure produceArgumentsVector (const MathStructure &vargs, int begin=-1, int end=-1)
MathStructure produceVector (const MathStructure &vargs, int begin=-1, int end=-1)
virtual void ref (ExpressionItem *o)
virtual void ref ()
virtual int refcount () const
virtual const string & referenceName () const
virtual void removeName (size_t index)
virtual bool representsBoolean (const MathStructure &) const
virtual bool representsComplex (const MathStructure &, bool=false) const
virtual bool representsEven (const MathStructure &, bool=false) const
virtual bool representsInteger (const MathStructure &, bool=false) const
virtual bool representsNegative (const MathStructure &, bool=false) const
virtual bool representsNonMatrix (const MathStructure &) const
virtual bool representsNonNegative (const MathStructure &, bool=false) const
virtual bool representsNonPositive (const MathStructure &, bool=false) const
virtual bool representsNonZero (const MathStructure &, bool=false) const
virtual bool representsNumber (const MathStructure &, bool=false) const
virtual bool representsOdd (const MathStructure &, bool=false) const
virtual bool representsPositive (const MathStructure &, bool=false) const
virtual bool representsRational (const MathStructure &, bool=false) const
virtual bool representsReal (const MathStructure &, bool=false) const
virtual bool representsUndefined (const MathStructure &) const
virtual void set (const ExpressionItem *item)
virtual void setActive (bool is_active)
virtual void setApproximate (bool is_approx=true)
void setArgumentDefinition (size_t index, Argument *argdef)
virtual void setCategory (string cat_)
virtual void setChanged (bool has_changed)
void setCondition (string expression)
void setDefaultValue (size_t arg_, string value_)
virtual void setDescription (string descr_)
virtual void setHidden (bool is_hidden)
virtual bool setLocal (bool is_local=true, int will_be_active=-1)
virtual void setName (string sname, size_t index, bool force=true)
virtual void setName (const ExpressionName &ename, size_t index=1, bool force=true)
virtual void setPrecision (int prec)
void setRegistered (bool is_registered)
 For internal use.
virtual void setTitle (string title_)
int stringArgs (const string &str, vector< string > &svargs)
virtual int subtype () const
bool testArgumentCount (int itmp)
bool testCondition (const MathStructure &vargs)
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 int type () const
virtual void unref (ExpressionItem *o)
virtual void unref ()

Protected Member Functions

virtual MathStructure createFunctionMathStructureFromSVArgs (vector< string > &svargs)
virtual MathStructure createFunctionMathStructureFromVArgs (const MathStructure &vargs)
bool testArguments (MathStructure &vargs)

Protected Attributes

int argc
Sgi::hash_map< size_t, Argument * > argdefs
bool b_active
bool b_approx
bool b_builtin
bool b_changed
bool b_destroyed
bool b_hidden
bool b_local
bool b_registered
vector< string > default_values
int i_precision
int i_ref
size_t last_argdef_index
int max_argc
vector< ExpressionNamenames
string scat
string scondition
string sdescr
string stitle
vector< ExpressionItem * > v_refs

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

Generated by  Doxygen 1.6.0   Back to index