C3D Toolkit  Kernel - 117982, Vision -

User-defined function. More...

#include <pars_user_function.h>

+ Inheritance diagram for MbUserFunc:
+ Collaboration diagram for MbUserFunc:

Public Member Functions

 MbUserFunc (const c3d::string_t &name, const std::vector< c3d::string_t > &pars)
 Constructor by function name and array of arguments.
 MbUserFunc (const MbUserFunc &other)
 MbUserFunc (const c3d::string_t &name)
 Constructor by function name.
ItUserFuncDuplicate () const override
 Create a copy.
const c3d::string_tGetName () const override
 Get function name.
bool GetDefRange (DefRange &, ItTreeVariable &var, const std::vector< BTreeNode * > &) const override
 Get function domain.
bool GetDefRange (DefRange &, size_t ind, bool stopOnBreak) const
 Get function domain. More...
size_t GetParsCount () const override
 Parameters (arguments) count.
void GetExternalVars (SSArray< ItTreeVariable * > &vars, SSArray< ItUserFunc * > &funcs) const override
 External variables.
bool IsEqual (const ItUserFunc &other) const override
 Compare symbolic (user-defined) functions.
bool IsEqual (const MbUserFunc &) const override
 Compare symbolic (user-defined) functions.
EquTreeResCode GetValue (const SArray< double > &params, double &v) const override
 Calculate the value of a function in a case of arguments array.
EquTreeResCode GetDerivates (const SArray< DerivesValues > &params, double &v, double &fd, double &sd, double &td, size_t dIndex=0) const override
 Calculate the value of a function and derivatives in a case of arguments array.
EquTreeResCode GetValue (double t, double &v) const
 Calculate the value of a function in a case of one argument.
EquTreeResCode GetDerivates (double t, double &v, double &fd, double &sd, double &td) const
 Calculate the value of a function and derivatives in a case of one argument.
bool IsConst () const
 Function is const.
bool IsLine () const
 Function is linear.
EquTreeResCode SetExpression (const c3d::string_t &expr, const BTreeNode &tree)
 Set expression.
const c3d::string_tGetExpression () const
 Get expression.
const BTreeNodeGetTree () const
 Get expression parsing tree.
bool IsEqualValue (const MbUserFunc &other) const
 Comparison with user-defined function.
bool GetExtremumPoints (size_t parIndex, const c3d::DoublePair &interval, c3d::DoubleVector &points)
 Get an array of parameters of singular points for the argument which is given by the index on the given interval.
void GetPars (RPArray< ItTreeVariable > &pars) const
 Get array of parameters.
ItTreeVariableGetPar (size_t i) const
 Get argument by index.
void WritingBeginEnd (bool begin)
 Prepare an object for writing.
const MbUserFuncoperator= (const MbUserFunc &)
 Assignment operator.
- Public Member Functions inherited from TapeBase
 TapeBase (RegistrableRec regs=noRegistrable)
 TapeBase (const TapeBase &)
virtual ~TapeBase ()
RegistrableRec GetRegistrable () const
 Whether the stream class is registrable.
void SetRegistrable (RegistrableRec regs=registrable) const
 Set the state of registration of the stream class.
virtual const char * GetPureName (const VersionContainer &) const
 Get the class name.
virtual bool IsFamilyRegistrable () const
 Whether the object belongs to a registrable family.
- Public Member Functions inherited from MbSyncItem
void Lock () const
 Switch lock on (locking happens only in parallel region).
void Unlock () const
 Switch lock off if locking has been set.

Protected Attributes

c3d::string_t m_name
 A name of user-defined function.
c3d::string_t m_expression
 A tree of expression parsing (it should be for sure).
IFC_Array< MbTreeVariablem_vars
 Formal parameters of function.
PArray< ItUserFuncm_intFuncs
 Internal functions.

Detailed Description

User-defined function.

User-defined function.

Member Function Documentation

◆ GetDefRange()

bool MbUserFunc::GetDefRange ( DefRange ,
size_t  ind,
bool  stopOnBreak 
) const

Get function domain.

Get the function domain for the parameter with index ind. The method cuts from the initial domain some parts where the function is not defined.

[in,out]dr- It is initialized by some start range. The output value will be the intersection between this range and the true function domain.
[in]ind- An index of the variable, which the domain is searched for.
[in]stopOnBreak- Searching will be stopped if the first break is found.
Returns false if domain cannot be found.

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