1 -- Created on: 1991-01-10
2 -- Created by: Arnaud BOUZY
3 -- Copyright (c) 1991-1999 Matra Datavision
4 -- Copyright (c) 1999-2012 OPEN CASCADE SAS
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.
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.
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.
22 deferred class GeneralExpression from Expr
24 inherits TShared from MMgt
26 ---Purpose: Defines the general purposes of any expression.
28 uses NamedUnknown from Expr,
29 Array1OfNamedUnknown from Expr,
30 Array1OfReal from TColStd,
31 AsciiString from TCollection
33 raises OutOfRange from Standard,
34 NumericError from Standard,
35 NotEvaluable from Expr,
36 InvalidOperand from Expr
41 ---Purpose: Returns the number of sub-expressions contained
47 SubExpression(me; I : Integer)
48 ---Purpose: Returns the <I>-th sub-expression of <me>
49 -- raises OutOfRange if <I> > NbSubExpressions(me)
50 ---C++: return const &
52 returns any GeneralExpression
57 ---Purpose: Returns a GeneralExpression after replacement of
58 -- NamedUnknowns by an associated expression and after
59 -- values computation.
61 returns any GeneralExpression
66 ---Purpose: Returns a GeneralExpression after a simplification
67 -- of the arguments of <me>.
69 returns any GeneralExpression
74 ---Purpose: Returns a copy of <me> having the same unknowns and
77 returns mutable like me
81 ---Purpose: Tests if <me> contains NamedUnknowns.
86 Contains(me; exp : GeneralExpression)
87 ---Purpose: Tests if <exp> is contained in <me>.
93 ---Purpose: Tests if <me> is linear on every NamedUnknown it
100 ---Purpose: Tests if <me> can be shared by one or more expressions
101 -- or must be copied. This method returns False as a
102 -- default value. To be redefined ( especially for
105 returns Boolean is virtual;
107 IsIdentical(me; Other : GeneralExpression)
108 ---Purpose: Tests if <me> and <Other> define the same expression.
109 -- Warning: This method does not include any simplification before
110 -- testing. It could also be very slow; to be used
116 Derivative(me; X : NamedUnknown)
117 ---Purpose: Returns the derivative on <X> unknown of <me>
119 returns any GeneralExpression
122 NDerivative(me; X : NamedUnknown; N : Integer)
123 ---Purpose: Returns the <N>-th derivative on <X> unknown of <me>.
124 -- Raise OutOfRange if N <= 0
126 returns any GeneralExpression
127 raises OutOfRange is virtual;
129 Replace(me : mutable ; var : NamedUnknown ; with : GeneralExpression)
130 ---Purpose: Replaces all occurences of <var> with copies of <with>
131 -- in <me>. Copies of <with> are made with the Copy() method.
132 -- Raises InvalidOperand if <with> contains <me>.
134 raises InvalidOperand
137 Evaluate(me; vars : Array1OfNamedUnknown; vals : Array1OfReal)
138 ---Purpose: Returns the value of <me> (as a Real) by
139 -- replacement of <vars> by <vals>.
140 -- Raises NotEvaluable if <me> contains NamedUnknown not
141 -- in <vars> or NumericError if result cannot be computed.
144 raises NotEvaluable,NumericError
148 ---Purpose: Returns the value of <me> (as a Real) by
149 -- replacement of <vars> by <vals>.
150 -- Raises NotEvaluable if <me> contains NamedUnknown not
151 -- in <vars> or NumericError if result cannot be computed.
154 raises NotEvaluable,NumericError;
157 ---Purpose: returns a string representing <me> in a readable way.
162 end GeneralExpression;