-- File: NamedFunction.cdl -- Created: Mon Jan 14 10:52:08 1991 -- Author: Arnaud BOUZY -- ---Copyright: Matra Datavision 1991 class NamedFunction from Expr inherits GeneralFunction from Expr uses GeneralExpression from Expr, NamedUnknown from Expr, Array1OfReal from TColStd, Array1OfNamedUnknown from Expr, AsciiString from TCollection raises OutOfRange from Standard, DimensionMismatch from Standard, NumericError from Standard, NotEvaluable from Expr is Create( name : AsciiString; exp : GeneralExpression; vars : Array1OfNamedUnknown) ---Purpose: Creates a function of given variables with name -- defined by the expression . ---Level : Advanced returns mutable NamedFunction; SetName(me : mutable; newname : AsciiString) ---Purpose: Sets the name to . ---Level : Internal is static; GetName(me) ---Purpose: Returns the name assigned to ---Level : Internal returns AsciiString is static; NbOfVariables(me) ---Purpose: Returns the number of variables of . returns Integer is static; Variable(me ; index : Integer) ---Purpose: Returns the variable denoted by in . -- Raises OutOfRange if is greater than -- NbOfVariables of , or less than or equal to zero. returns NamedUnknown raises OutOfRange is static; Evaluate(me; vars : Array1OfNamedUnknown; values : Array1OfReal) ---Purpose: Computes the value of with the given variables. -- Raises DimensionMismatch if Length(vars) is different from -- Length(values). returns Real raises DimensionMismatch,NumericError,NotEvaluable; Copy(me) ---Purpose: Returns a copy of with the same form. returns mutable like me; Derivative(me; var : NamedUnknown) ---Purpose: Returns Derivative of for variable . returns GeneralFunction; Derivative(me; var : NamedUnknown; deg : Integer) ---Purpose: Returns Derivative of for variable with -- degree . returns GeneralFunction; IsIdentical(me; func : GeneralFunction) ---Purpose: Tests if and are similar functions (same -- name and same used expression). returns Boolean; IsLinearOnVariable(me; index : Integer) ---Purpose: Tests if is linear on variable on range returns Boolean; GetStringName(me) returns AsciiString from TCollection; Expression(me) ---Purpose: Returns equivalent expression of . ---Level : Internal returns GeneralExpression is static; SetExpression(me : mutable; exp : GeneralExpression); ---Purpose: Modifies expression of . -- Warning: Beware of derivatives. See FunctionDerivative ---Level : Internal fields myName : AsciiString; myExp : GeneralExpression; myVariables : Array1OfNamedUnknown; end NamedFunction;