7fd59977 |
1 | -- File: PolyFunction.cdl |
2 | -- Created: Mon Jan 14 16:20:47 1991 |
3 | -- Author: Arnaud BOUZY |
4 | -- <adn@topsn3> |
5 | ---Copyright: Matra Datavision 1991 |
6 | |
7 | class PolyFunction from Expr |
8 | |
9 | inherits PolyExpression from Expr |
10 | |
11 | ---Purpose: Defines the use of an n-ary function in an expression |
12 | -- with given arguments. |
13 | |
14 | uses GeneralFunction from Expr, |
15 | AsciiString from TCollection, |
16 | GeneralExpression from Expr, |
17 | NamedUnknown from Expr, |
18 | Array1OfNamedUnknown from Expr, |
19 | Array1OfReal from TColStd, |
20 | Array1OfGeneralExpression from Expr |
21 | |
22 | raises NumericError from Standard, |
23 | OutOfRange from Standard, |
24 | NotEvaluable from Expr |
25 | |
26 | is |
27 | |
28 | Create(func : GeneralFunction;exps : Array1OfGeneralExpression) |
29 | ---Purpose: Creates <me> as <func>(<exps_1>,<exps_2>,...,<exps_n>) |
30 | returns mutable PolyFunction; |
31 | |
32 | Function(me) |
33 | ---Purpose: Returns the function defining <me>. |
34 | returns GeneralFunction; |
35 | |
36 | ShallowSimplified(me) |
37 | ---Purpose: Returns a GeneralExpression after a simplification |
38 | -- of the arguments of <me>. |
39 | returns any GeneralExpression |
40 | raises NumericError; |
41 | |
42 | Copy(me) |
43 | ---Purpose: Returns a copy of <me> having the same unknowns and functions. |
44 | returns mutable like me; |
45 | |
46 | IsIdentical(me; Other : GeneralExpression) |
47 | ---Purpose: Tests if <me> and <Other> define the same expression. |
48 | -- This method does not include any simplification before |
49 | -- testing. |
50 | returns Boolean; |
51 | |
52 | IsLinear(me) |
53 | returns Boolean; |
54 | |
55 | Derivative(me; X : NamedUnknown) |
56 | ---Purpose: Returns the derivative on <X> unknown of <me> |
57 | returns any GeneralExpression; |
58 | |
59 | Evaluate(me; vars : Array1OfNamedUnknown; vals : Array1OfReal) |
60 | ---Purpose: Returns the value of <me> (as a Real) by |
61 | -- replacement of <vars> by <vals>. |
62 | -- Raises NotEvaluable if <me> contains NamedUnknown not |
63 | -- in <vars> or NumericError if result cannot be computed. |
64 | returns Real |
65 | raises NotEvaluable,NumericError; |
66 | |
67 | String(me) |
68 | ---Purpose: returns a string representing <me> in a readable way. |
69 | returns AsciiString; |
70 | |
71 | fields |
72 | |
73 | myFunction : GeneralFunction; |
74 | |
75 | end PolyFunction; |