b311480e |
1 | -- Created on: 1991-01-14 |
2 | -- Created by: Arnaud BOUZY |
3 | -- Copyright (c) 1991-1999 Matra Datavision |
4 | -- Copyright (c) 1999-2012 OPEN CASCADE SAS |
5 | -- |
6 | -- The content of this file is subject to the Open CASCADE Technology Public |
7 | -- License Version 6.5 (the "License"). You may not use the content of this file |
8 | -- except in compliance with the License. Please obtain a copy of the License |
9 | -- at http://www.opencascade.org and read it completely before using this file. |
10 | -- |
11 | -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its |
12 | -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. |
13 | -- |
14 | -- The Original Code and all software distributed under the License is |
15 | -- distributed on an "AS IS" basis, without warranty of any kind, and the |
16 | -- Initial Developer hereby disclaims all such warranties, including without |
17 | -- limitation, any warranties of merchantability, fitness for a particular |
18 | -- purpose or non-infringement. Please see the License for the specific terms |
19 | -- and conditions governing the rights and limitations under the License. |
20 | |
7fd59977 |
21 | |
22 | class PolyFunction from Expr |
23 | |
24 | inherits PolyExpression from Expr |
25 | |
26 | ---Purpose: Defines the use of an n-ary function in an expression |
27 | -- with given arguments. |
28 | |
29 | uses GeneralFunction from Expr, |
30 | AsciiString from TCollection, |
31 | GeneralExpression from Expr, |
32 | NamedUnknown from Expr, |
33 | Array1OfNamedUnknown from Expr, |
34 | Array1OfReal from TColStd, |
35 | Array1OfGeneralExpression from Expr |
36 | |
37 | raises NumericError from Standard, |
38 | OutOfRange from Standard, |
39 | NotEvaluable from Expr |
40 | |
41 | is |
42 | |
43 | Create(func : GeneralFunction;exps : Array1OfGeneralExpression) |
44 | ---Purpose: Creates <me> as <func>(<exps_1>,<exps_2>,...,<exps_n>) |
45 | returns mutable PolyFunction; |
46 | |
47 | Function(me) |
48 | ---Purpose: Returns the function defining <me>. |
49 | returns GeneralFunction; |
50 | |
51 | ShallowSimplified(me) |
52 | ---Purpose: Returns a GeneralExpression after a simplification |
53 | -- of the arguments of <me>. |
54 | returns any GeneralExpression |
55 | raises NumericError; |
56 | |
57 | Copy(me) |
58 | ---Purpose: Returns a copy of <me> having the same unknowns and functions. |
59 | returns mutable like me; |
60 | |
61 | IsIdentical(me; Other : GeneralExpression) |
62 | ---Purpose: Tests if <me> and <Other> define the same expression. |
63 | -- This method does not include any simplification before |
64 | -- testing. |
65 | returns Boolean; |
66 | |
67 | IsLinear(me) |
68 | returns Boolean; |
69 | |
70 | Derivative(me; X : NamedUnknown) |
71 | ---Purpose: Returns the derivative on <X> unknown of <me> |
72 | returns any GeneralExpression; |
73 | |
74 | Evaluate(me; vars : Array1OfNamedUnknown; vals : Array1OfReal) |
75 | ---Purpose: Returns the value of <me> (as a Real) by |
76 | -- replacement of <vars> by <vals>. |
77 | -- Raises NotEvaluable if <me> contains NamedUnknown not |
78 | -- in <vars> or NumericError if result cannot be computed. |
79 | returns Real |
80 | raises NotEvaluable,NumericError; |
81 | |
82 | String(me) |
83 | ---Purpose: returns a string representing <me> in a readable way. |
84 | returns AsciiString; |
85 | |
86 | fields |
87 | |
88 | myFunction : GeneralFunction; |
89 | |
90 | end PolyFunction; |