1 // Created on: 1991-01-14
2 // Created by: Arnaud BOUZY
3 // Copyright (c) 1991-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _Expr_GeneralFunction_HeaderFile
18 #define _Expr_GeneralFunction_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
23 #include <Standard_Transient.hxx>
24 #include <Standard_Integer.hxx>
25 #include <Standard_Real.hxx>
26 #include <Expr_Array1OfNamedUnknown.hxx>
27 #include <TColStd_Array1OfReal.hxx>
28 #include <Standard_Boolean.hxx>
29 class Standard_OutOfRange;
30 class Standard_DimensionMismatch;
31 class Standard_NumericError;
32 class Expr_NotEvaluable;
33 class Expr_NamedUnknown;
34 class TCollection_AsciiString;
37 class Expr_GeneralFunction;
38 DEFINE_STANDARD_HANDLE(Expr_GeneralFunction, Standard_Transient)
40 //! Defines the general purposes of any function.
41 class Expr_GeneralFunction : public Standard_Transient
47 //! Returns the number of variables of <me>.
48 Standard_EXPORT virtual Standard_Integer NbOfVariables() const = 0;
50 //! Returns the variable denoted by <index> in <me>.
51 //! Raises OutOfRange if index > NbOfVariables.
52 Standard_EXPORT virtual Handle(Expr_NamedUnknown) Variable (const Standard_Integer index) const = 0;
54 //! Returns a copy of <me> with the same form.
55 Standard_EXPORT virtual Handle(Expr_GeneralFunction) Copy() const = 0;
57 //! Returns Derivative of <me> for variable <var>.
58 Standard_EXPORT virtual Handle(Expr_GeneralFunction) Derivative (const Handle(Expr_NamedUnknown)& var) const = 0;
60 //! Returns Derivative of <me> for variable <var> with
62 Standard_EXPORT virtual Handle(Expr_GeneralFunction) Derivative (const Handle(Expr_NamedUnknown)& var, const Standard_Integer deg) const = 0;
64 //! Computes the value of <me> with the given variables.
65 //! Raises NotEvaluable if <vars> does not match all variables
67 Standard_EXPORT virtual Standard_Real Evaluate (const Expr_Array1OfNamedUnknown& vars, const TColStd_Array1OfReal& vals) const = 0;
69 //! Tests if <me> and <func> are similar functions (same
70 //! name and same used expression).
71 Standard_EXPORT virtual Standard_Boolean IsIdentical (const Handle(Expr_GeneralFunction)& func) const = 0;
73 //! Tests if <me> is linear on variable on range <index>
74 Standard_EXPORT virtual Standard_Boolean IsLinearOnVariable (const Standard_Integer index) const = 0;
76 Standard_EXPORT virtual TCollection_AsciiString GetStringName() const = 0;
81 DEFINE_STANDARD_RTTIEXT(Expr_GeneralFunction,Standard_Transient)
101 #endif // _Expr_GeneralFunction_HeaderFile