mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-24 13:50:49 +03:00
0024002: Overall code and build procedure refactoring -- automatic
Automatic upgrade of OCCT code by command "occt_upgrade . -nocdl": - WOK-generated header files from inc and sources from drv are moved to src - CDL files removed - All packages are converted to nocdlpack
This commit is contained in:
@@ -1,118 +0,0 @@
|
||||
-- Created on: 1991-01-14
|
||||
-- Created by: Arnaud BOUZY
|
||||
-- Copyright (c) 1991-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
package Expr
|
||||
|
||||
---Purpose: This package describes the data structure of any
|
||||
-- expression, relation or function used in mathematics.
|
||||
-- It also describes the assignment of variables. Standard
|
||||
-- mathematical functions are implemented such as
|
||||
-- trigonometrics, hyperbolics, and log functions.
|
||||
|
||||
|
||||
uses TColStd,TCollection,MMgt,Standard
|
||||
|
||||
is
|
||||
|
||||
deferred class GeneralExpression;
|
||||
class NumericValue;
|
||||
deferred class NamedExpression;
|
||||
class NamedConstant;
|
||||
class NamedUnknown;
|
||||
deferred class UnaryExpression;
|
||||
class Absolute;
|
||||
class ArcCosine;
|
||||
class ArcSine;
|
||||
class ArcTangent;
|
||||
class ArgCosh;
|
||||
class ArgSinh;
|
||||
class ArgTanh;
|
||||
class Cosh;
|
||||
class Cosine;
|
||||
class Exponential;
|
||||
class LogOf10;
|
||||
class LogOfe;
|
||||
class Sign;
|
||||
class Sine;
|
||||
class Sinh;
|
||||
class Square;
|
||||
class SquareRoot;
|
||||
class Tangent;
|
||||
class Tanh;
|
||||
class UnaryFunction;
|
||||
class UnaryMinus;
|
||||
deferred class BinaryExpression;
|
||||
class BinaryFunction;
|
||||
class Difference;
|
||||
class Division;
|
||||
class Exponentiate;
|
||||
deferred class PolyExpression;
|
||||
class PolyFunction;
|
||||
class Product;
|
||||
class Sum;
|
||||
class UnknownIterator;
|
||||
deferred class GeneralRelation;
|
||||
deferred class SingleRelation;
|
||||
class Different;
|
||||
class Equal;
|
||||
class GreaterThan;
|
||||
class GreaterThanOrEqual;
|
||||
class LessThan;
|
||||
class LessThanOrEqual;
|
||||
class SystemRelation;
|
||||
class RelationIterator;
|
||||
class RUIterator;
|
||||
deferred class GeneralFunction;
|
||||
class NamedFunction;
|
||||
class FunctionDerivative;
|
||||
|
||||
exception ExprFailure inherits Failure;
|
||||
exception NotAssigned inherits ExprFailure ;
|
||||
exception InvalidAssignment inherits ExprFailure;
|
||||
exception InvalidFunction inherits ExprFailure;
|
||||
exception InvalidOperand inherits ExprFailure;
|
||||
exception NotEvaluable inherits ExprFailure;
|
||||
|
||||
imported SequenceOfGeneralExpression;
|
||||
|
||||
imported Array1OfGeneralExpression;
|
||||
|
||||
imported Array1OfNamedUnknown;
|
||||
|
||||
imported MapOfNamedUnknown;
|
||||
|
||||
imported Array1OfSingleRelation;
|
||||
|
||||
imported SequenceOfGeneralRelation;
|
||||
|
||||
CopyShare(exp : GeneralExpression)
|
||||
---Level : Internal
|
||||
returns GeneralExpression;
|
||||
|
||||
NbOfFreeVariables(exp : GeneralExpression from Expr)
|
||||
---Level : Internal
|
||||
returns Integer;
|
||||
|
||||
NbOfFreeVariables(exp : GeneralRelation from Expr)
|
||||
---Level : Internal
|
||||
returns Integer;
|
||||
|
||||
Sign(val : Real from Standard)
|
||||
---Level : Internal
|
||||
returns Real from Standard;
|
||||
|
||||
end Expr;
|
||||
|
175
src/Expr/Expr.hxx
Normal file
175
src/Expr/Expr.hxx
Normal file
@@ -0,0 +1,175 @@
|
||||
// Created on: 1991-01-14
|
||||
// Created by: Arnaud BOUZY
|
||||
// Copyright (c) 1991-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Expr_HeaderFile
|
||||
#define _Expr_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
class Expr_GeneralExpression;
|
||||
class Expr_GeneralRelation;
|
||||
class Expr_GeneralExpression;
|
||||
class Expr_NumericValue;
|
||||
class Expr_NamedExpression;
|
||||
class Expr_NamedConstant;
|
||||
class Expr_NamedUnknown;
|
||||
class Expr_UnaryExpression;
|
||||
class Expr_Absolute;
|
||||
class Expr_ArcCosine;
|
||||
class Expr_ArcSine;
|
||||
class Expr_ArcTangent;
|
||||
class Expr_ArgCosh;
|
||||
class Expr_ArgSinh;
|
||||
class Expr_ArgTanh;
|
||||
class Expr_Cosh;
|
||||
class Expr_Cosine;
|
||||
class Expr_Exponential;
|
||||
class Expr_LogOf10;
|
||||
class Expr_LogOfe;
|
||||
class Expr_Sign;
|
||||
class Expr_Sine;
|
||||
class Expr_Sinh;
|
||||
class Expr_Square;
|
||||
class Expr_SquareRoot;
|
||||
class Expr_Tangent;
|
||||
class Expr_Tanh;
|
||||
class Expr_UnaryFunction;
|
||||
class Expr_UnaryMinus;
|
||||
class Expr_BinaryExpression;
|
||||
class Expr_BinaryFunction;
|
||||
class Expr_Difference;
|
||||
class Expr_Division;
|
||||
class Expr_Exponentiate;
|
||||
class Expr_PolyExpression;
|
||||
class Expr_PolyFunction;
|
||||
class Expr_Product;
|
||||
class Expr_Sum;
|
||||
class Expr_UnknownIterator;
|
||||
class Expr_GeneralRelation;
|
||||
class Expr_SingleRelation;
|
||||
class Expr_Different;
|
||||
class Expr_Equal;
|
||||
class Expr_GreaterThan;
|
||||
class Expr_GreaterThanOrEqual;
|
||||
class Expr_LessThan;
|
||||
class Expr_LessThanOrEqual;
|
||||
class Expr_SystemRelation;
|
||||
class Expr_RelationIterator;
|
||||
class Expr_RUIterator;
|
||||
class Expr_GeneralFunction;
|
||||
class Expr_NamedFunction;
|
||||
class Expr_FunctionDerivative;
|
||||
|
||||
|
||||
//! This package describes the data structure of any
|
||||
//! expression, relation or function used in mathematics.
|
||||
//! It also describes the assignment of variables. Standard
|
||||
//! mathematical functions are implemented such as
|
||||
//! trigonometrics, hyperbolics, and log functions.
|
||||
class Expr
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
Standard_EXPORT static Handle(Expr_GeneralExpression) CopyShare (const Handle(Expr_GeneralExpression)& exp);
|
||||
|
||||
Standard_EXPORT static Standard_Integer NbOfFreeVariables (const Handle(Expr_GeneralExpression)& exp);
|
||||
|
||||
Standard_EXPORT static Standard_Integer NbOfFreeVariables (const Handle(Expr_GeneralRelation)& exp);
|
||||
|
||||
Standard_EXPORT static Standard_Real Sign (const Standard_Real val);
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
friend class Expr_GeneralExpression;
|
||||
friend class Expr_NumericValue;
|
||||
friend class Expr_NamedExpression;
|
||||
friend class Expr_NamedConstant;
|
||||
friend class Expr_NamedUnknown;
|
||||
friend class Expr_UnaryExpression;
|
||||
friend class Expr_Absolute;
|
||||
friend class Expr_ArcCosine;
|
||||
friend class Expr_ArcSine;
|
||||
friend class Expr_ArcTangent;
|
||||
friend class Expr_ArgCosh;
|
||||
friend class Expr_ArgSinh;
|
||||
friend class Expr_ArgTanh;
|
||||
friend class Expr_Cosh;
|
||||
friend class Expr_Cosine;
|
||||
friend class Expr_Exponential;
|
||||
friend class Expr_LogOf10;
|
||||
friend class Expr_LogOfe;
|
||||
friend class Expr_Sign;
|
||||
friend class Expr_Sine;
|
||||
friend class Expr_Sinh;
|
||||
friend class Expr_Square;
|
||||
friend class Expr_SquareRoot;
|
||||
friend class Expr_Tangent;
|
||||
friend class Expr_Tanh;
|
||||
friend class Expr_UnaryFunction;
|
||||
friend class Expr_UnaryMinus;
|
||||
friend class Expr_BinaryExpression;
|
||||
friend class Expr_BinaryFunction;
|
||||
friend class Expr_Difference;
|
||||
friend class Expr_Division;
|
||||
friend class Expr_Exponentiate;
|
||||
friend class Expr_PolyExpression;
|
||||
friend class Expr_PolyFunction;
|
||||
friend class Expr_Product;
|
||||
friend class Expr_Sum;
|
||||
friend class Expr_UnknownIterator;
|
||||
friend class Expr_GeneralRelation;
|
||||
friend class Expr_SingleRelation;
|
||||
friend class Expr_Different;
|
||||
friend class Expr_Equal;
|
||||
friend class Expr_GreaterThan;
|
||||
friend class Expr_GreaterThanOrEqual;
|
||||
friend class Expr_LessThan;
|
||||
friend class Expr_LessThanOrEqual;
|
||||
friend class Expr_SystemRelation;
|
||||
friend class Expr_RelationIterator;
|
||||
friend class Expr_RUIterator;
|
||||
friend class Expr_GeneralFunction;
|
||||
friend class Expr_NamedFunction;
|
||||
friend class Expr_FunctionDerivative;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Expr_HeaderFile
|
@@ -1,71 +0,0 @@
|
||||
-- Created on: 1991-01-14
|
||||
-- Created by: Arnaud BOUZY
|
||||
-- Copyright (c) 1991-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class Absolute from Expr
|
||||
|
||||
inherits UnaryExpression from Expr
|
||||
|
||||
uses GeneralExpression from Expr,
|
||||
Array1OfNamedUnknown from Expr,
|
||||
Array1OfReal from TColStd,
|
||||
AsciiString from TCollection,
|
||||
NamedUnknown from Expr
|
||||
|
||||
raises NumericError from Standard,
|
||||
NotEvaluable from Expr
|
||||
|
||||
is
|
||||
|
||||
Create(exp : GeneralExpression)
|
||||
---Purpose: Creates the Abs of <exp>
|
||||
returns Absolute;
|
||||
|
||||
ShallowSimplified(me)
|
||||
---Purpose: Returns a GeneralExpression after a simplification
|
||||
-- of the arguments of <me>.
|
||||
returns any GeneralExpression
|
||||
raises NumericError;
|
||||
|
||||
Copy(me)
|
||||
---Purpose: Returns a copy of <me> having the same unknowns and functions.
|
||||
returns like me;
|
||||
|
||||
IsIdentical(me; Other : GeneralExpression)
|
||||
---Purpose: Tests if <me> and <Other> define the same expression.
|
||||
-- This method does not include any simplification before
|
||||
-- testing.
|
||||
returns Boolean;
|
||||
|
||||
IsLinear(me)
|
||||
returns Boolean;
|
||||
|
||||
Derivative(me; X : NamedUnknown)
|
||||
---Purpose: Returns the derivative on <X> unknown of <me>
|
||||
returns any GeneralExpression;
|
||||
|
||||
Evaluate(me; vars : Array1OfNamedUnknown; vals : Array1OfReal)
|
||||
---Purpose: Returns the value of <me> (as a Real) by
|
||||
-- replacement of <vars> by <vals>.
|
||||
-- Raises NotEvaluable if <me> contains NamedUnknown not
|
||||
-- in <vars> or NumericError if result cannot be computed.
|
||||
returns Real
|
||||
raises NotEvaluable,NumericError;
|
||||
|
||||
String(me)
|
||||
---Purpose: returns a string representing <me> in a readable way.
|
||||
returns AsciiString;
|
||||
|
||||
end Absolute;
|
@@ -14,13 +14,20 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Expr_Absolute.ixx>
|
||||
#include <Expr_NumericValue.hxx>
|
||||
#include <Expr_UnaryMinus.hxx>
|
||||
#include <Expr_Sign.hxx>
|
||||
#include <Expr_Product.hxx>
|
||||
#include <Expr_Operators.hxx>
|
||||
|
||||
#include <Expr.hxx>
|
||||
#include <Expr_Absolute.hxx>
|
||||
#include <Expr_GeneralExpression.hxx>
|
||||
#include <Expr_NamedUnknown.hxx>
|
||||
#include <Expr_NotEvaluable.hxx>
|
||||
#include <Expr_NumericValue.hxx>
|
||||
#include <Expr_Operators.hxx>
|
||||
#include <Expr_Product.hxx>
|
||||
#include <Expr_Sign.hxx>
|
||||
#include <Expr_UnaryMinus.hxx>
|
||||
#include <Standard_NumericError.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
|
||||
Expr_Absolute::Expr_Absolute (const Handle(Expr_GeneralExpression)& exp)
|
||||
{
|
||||
|
97
src/Expr/Expr_Absolute.hxx
Normal file
97
src/Expr/Expr_Absolute.hxx
Normal file
@@ -0,0 +1,97 @@
|
||||
// Created on: 1991-01-14
|
||||
// Created by: Arnaud BOUZY
|
||||
// Copyright (c) 1991-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Expr_Absolute_HeaderFile
|
||||
#define _Expr_Absolute_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Expr_UnaryExpression.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Expr_Array1OfNamedUnknown.hxx>
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
class Standard_NumericError;
|
||||
class Expr_NotEvaluable;
|
||||
class Expr_GeneralExpression;
|
||||
class Expr_NamedUnknown;
|
||||
class TCollection_AsciiString;
|
||||
|
||||
|
||||
class Expr_Absolute;
|
||||
DEFINE_STANDARD_HANDLE(Expr_Absolute, Expr_UnaryExpression)
|
||||
|
||||
|
||||
class Expr_Absolute : public Expr_UnaryExpression
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Creates the Abs of <exp>
|
||||
Standard_EXPORT Expr_Absolute(const Handle(Expr_GeneralExpression)& exp);
|
||||
|
||||
//! Returns a GeneralExpression after a simplification
|
||||
//! of the arguments of <me>.
|
||||
Standard_EXPORT Handle(Expr_GeneralExpression) ShallowSimplified() const;
|
||||
|
||||
//! Returns a copy of <me> having the same unknowns and functions.
|
||||
Standard_EXPORT Handle(Expr_GeneralExpression) Copy() const;
|
||||
|
||||
//! Tests if <me> and <Other> define the same expression.
|
||||
//! This method does not include any simplification before
|
||||
//! testing.
|
||||
Standard_EXPORT Standard_Boolean IsIdentical (const Handle(Expr_GeneralExpression)& Other) const;
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsLinear() const;
|
||||
|
||||
//! Returns the derivative on <X> unknown of <me>
|
||||
Standard_EXPORT Handle(Expr_GeneralExpression) Derivative (const Handle(Expr_NamedUnknown)& X) const;
|
||||
|
||||
//! Returns the value of <me> (as a Real) by
|
||||
//! replacement of <vars> by <vals>.
|
||||
//! Raises NotEvaluable if <me> contains NamedUnknown not
|
||||
//! in <vars> or NumericError if result cannot be computed.
|
||||
Standard_EXPORT Standard_Real Evaluate (const Expr_Array1OfNamedUnknown& vars, const TColStd_Array1OfReal& vals) const;
|
||||
|
||||
//! returns a string representing <me> in a readable way.
|
||||
Standard_EXPORT TCollection_AsciiString String() const;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(Expr_Absolute,Expr_UnaryExpression)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Expr_Absolute_HeaderFile
|
@@ -1,71 +0,0 @@
|
||||
-- Created on: 1991-01-14
|
||||
-- Created by: Arnaud BOUZY
|
||||
-- Copyright (c) 1991-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class ArcCosine from Expr
|
||||
|
||||
inherits UnaryExpression from Expr
|
||||
|
||||
uses GeneralExpression from Expr,
|
||||
AsciiString from TCollection,
|
||||
Array1OfNamedUnknown from Expr,
|
||||
Array1OfReal from TColStd,
|
||||
NamedUnknown from Expr
|
||||
|
||||
raises NumericError from Standard,
|
||||
NotEvaluable from Expr
|
||||
|
||||
is
|
||||
|
||||
Create(exp : GeneralExpression)
|
||||
---Purpose: Creates the Arccos of <exp>
|
||||
returns ArcCosine;
|
||||
|
||||
ShallowSimplified(me)
|
||||
---Purpose: Returns a GeneralExpression after a simplification
|
||||
-- of the arguments of <me>.
|
||||
returns any GeneralExpression
|
||||
raises NumericError;
|
||||
|
||||
Copy(me)
|
||||
---Purpose: Returns a copy of <me> having the same unknowns and functions.
|
||||
returns like me;
|
||||
|
||||
IsIdentical(me; Other : GeneralExpression)
|
||||
---Purpose: Tests if <me> and <Other> define the same expression.
|
||||
-- This method does not include any simplification before
|
||||
-- testing.
|
||||
returns Boolean;
|
||||
|
||||
IsLinear(me)
|
||||
returns Boolean;
|
||||
|
||||
Derivative(me; X : NamedUnknown)
|
||||
---Purpose: Returns the derivative on <X> unknown of <me>.
|
||||
returns any GeneralExpression;
|
||||
|
||||
Evaluate(me; vars : Array1OfNamedUnknown; vals : Array1OfReal)
|
||||
---Purpose: Returns the value of <me> (as a Real) by
|
||||
-- replacement of <vars> by <vals>.
|
||||
-- Raises NotEvaluable if <me> contains NamedUnknown not
|
||||
-- in <vars> or NumericError if result cannot be computed.
|
||||
returns Real
|
||||
raises NotEvaluable,NumericError;
|
||||
|
||||
String(me)
|
||||
---Purpose: returns a string representing <me> in a readable way.
|
||||
returns AsciiString;
|
||||
|
||||
end ArcCosine;
|
@@ -14,17 +14,24 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Expr_ArcCosine.ixx>
|
||||
#include <Expr_NumericValue.hxx>
|
||||
|
||||
#include <Expr.hxx>
|
||||
#include <Expr_ArcCosine.hxx>
|
||||
#include <Expr_Cosine.hxx>
|
||||
#include <Expr_Division.hxx>
|
||||
#include <Expr_Square.hxx>
|
||||
#include <Expr_Difference.hxx>
|
||||
#include <Expr_Division.hxx>
|
||||
#include <Expr_GeneralExpression.hxx>
|
||||
#include <Expr_NamedUnknown.hxx>
|
||||
#include <Expr_NotEvaluable.hxx>
|
||||
#include <Expr_NumericValue.hxx>
|
||||
#include <Expr_Operators.hxx>
|
||||
#include <Expr_Product.hxx>
|
||||
#include <Expr_Square.hxx>
|
||||
#include <Expr_SquareRoot.hxx>
|
||||
#include <Expr_UnaryMinus.hxx>
|
||||
#include <Expr_Product.hxx>
|
||||
#include <Expr_Operators.hxx>
|
||||
#include <Expr.hxx>
|
||||
#include <Standard_NumericError.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
|
||||
Expr_ArcCosine::Expr_ArcCosine (const Handle(Expr_GeneralExpression)& exp)
|
||||
{
|
||||
|
97
src/Expr/Expr_ArcCosine.hxx
Normal file
97
src/Expr/Expr_ArcCosine.hxx
Normal file
@@ -0,0 +1,97 @@
|
||||
// Created on: 1991-01-14
|
||||
// Created by: Arnaud BOUZY
|
||||
// Copyright (c) 1991-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Expr_ArcCosine_HeaderFile
|
||||
#define _Expr_ArcCosine_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Expr_UnaryExpression.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Expr_Array1OfNamedUnknown.hxx>
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
class Standard_NumericError;
|
||||
class Expr_NotEvaluable;
|
||||
class Expr_GeneralExpression;
|
||||
class Expr_NamedUnknown;
|
||||
class TCollection_AsciiString;
|
||||
|
||||
|
||||
class Expr_ArcCosine;
|
||||
DEFINE_STANDARD_HANDLE(Expr_ArcCosine, Expr_UnaryExpression)
|
||||
|
||||
|
||||
class Expr_ArcCosine : public Expr_UnaryExpression
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Creates the Arccos of <exp>
|
||||
Standard_EXPORT Expr_ArcCosine(const Handle(Expr_GeneralExpression)& exp);
|
||||
|
||||
//! Returns a GeneralExpression after a simplification
|
||||
//! of the arguments of <me>.
|
||||
Standard_EXPORT Handle(Expr_GeneralExpression) ShallowSimplified() const;
|
||||
|
||||
//! Returns a copy of <me> having the same unknowns and functions.
|
||||
Standard_EXPORT Handle(Expr_GeneralExpression) Copy() const;
|
||||
|
||||
//! Tests if <me> and <Other> define the same expression.
|
||||
//! This method does not include any simplification before
|
||||
//! testing.
|
||||
Standard_EXPORT Standard_Boolean IsIdentical (const Handle(Expr_GeneralExpression)& Other) const;
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsLinear() const;
|
||||
|
||||
//! Returns the derivative on <X> unknown of <me>.
|
||||
Standard_EXPORT Handle(Expr_GeneralExpression) Derivative (const Handle(Expr_NamedUnknown)& X) const;
|
||||
|
||||
//! Returns the value of <me> (as a Real) by
|
||||
//! replacement of <vars> by <vals>.
|
||||
//! Raises NotEvaluable if <me> contains NamedUnknown not
|
||||
//! in <vars> or NumericError if result cannot be computed.
|
||||
Standard_EXPORT Standard_Real Evaluate (const Expr_Array1OfNamedUnknown& vars, const TColStd_Array1OfReal& vals) const;
|
||||
|
||||
//! returns a string representing <me> in a readable way.
|
||||
Standard_EXPORT TCollection_AsciiString String() const;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(Expr_ArcCosine,Expr_UnaryExpression)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Expr_ArcCosine_HeaderFile
|
@@ -1,71 +0,0 @@
|
||||
-- Created on: 1991-01-14
|
||||
-- Created by: Arnaud BOUZY
|
||||
-- Copyright (c) 1991-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class ArcSine from Expr
|
||||
|
||||
inherits UnaryExpression from Expr
|
||||
|
||||
uses GeneralExpression from Expr,
|
||||
AsciiString from TCollection,
|
||||
Array1OfNamedUnknown from Expr,
|
||||
Array1OfReal from TColStd,
|
||||
NamedUnknown from Expr
|
||||
|
||||
raises NumericError from Standard,
|
||||
NotEvaluable from Expr
|
||||
|
||||
is
|
||||
|
||||
Create(exp : GeneralExpression)
|
||||
---Purpose: Creates the Arcsin of <exp>
|
||||
returns ArcSine;
|
||||
|
||||
ShallowSimplified(me)
|
||||
---Purpose: Returns a GeneralExpression after a simplification
|
||||
-- of the arguments of <me>.
|
||||
returns any GeneralExpression
|
||||
raises NumericError;
|
||||
|
||||
Copy(me)
|
||||
---Purpose: Returns a copy of <me> having the same unknowns and functions.
|
||||
returns like me;
|
||||
|
||||
IsIdentical(me; Other : GeneralExpression)
|
||||
---Purpose: Tests if <me> and <Other> define the same expression.
|
||||
-- This method does not include any simplification before
|
||||
-- testing.
|
||||
returns Boolean;
|
||||
|
||||
IsLinear(me)
|
||||
returns Boolean;
|
||||
|
||||
Derivative(me; X : NamedUnknown)
|
||||
---Purpose: Returns the derivative on <X> unknown of <me>.
|
||||
returns any GeneralExpression;
|
||||
|
||||
Evaluate(me; vars : Array1OfNamedUnknown; vals : Array1OfReal)
|
||||
---Purpose: Returns the value of <me> (as a Real) by
|
||||
-- replacement of <vars> by <vals>.
|
||||
-- Raises NotEvaluable if <me> contains NamedUnknown not
|
||||
-- in <vars> or NumericError if result cannot be computed.
|
||||
returns Real
|
||||
raises NotEvaluable,NumericError;
|
||||
|
||||
String(me)
|
||||
---Purpose: returns a string representing <me> in a readable way.
|
||||
returns AsciiString;
|
||||
|
||||
end ArcSine;
|
@@ -14,15 +14,22 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Expr_ArcSine.ixx>
|
||||
#include <Expr_NumericValue.hxx>
|
||||
#include <Expr_Sine.hxx>
|
||||
#include <Expr_Division.hxx>
|
||||
#include <Expr_Square.hxx>
|
||||
#include <Expr_Difference.hxx>
|
||||
#include <Expr_SquareRoot.hxx>
|
||||
#include <Expr_Operators.hxx>
|
||||
|
||||
#include <Expr.hxx>
|
||||
#include <Expr_ArcSine.hxx>
|
||||
#include <Expr_Difference.hxx>
|
||||
#include <Expr_Division.hxx>
|
||||
#include <Expr_GeneralExpression.hxx>
|
||||
#include <Expr_NamedUnknown.hxx>
|
||||
#include <Expr_NotEvaluable.hxx>
|
||||
#include <Expr_NumericValue.hxx>
|
||||
#include <Expr_Operators.hxx>
|
||||
#include <Expr_Sine.hxx>
|
||||
#include <Expr_Square.hxx>
|
||||
#include <Expr_SquareRoot.hxx>
|
||||
#include <Standard_NumericError.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
|
||||
Expr_ArcSine::Expr_ArcSine (const Handle(Expr_GeneralExpression)& exp)
|
||||
{
|
||||
|
97
src/Expr/Expr_ArcSine.hxx
Normal file
97
src/Expr/Expr_ArcSine.hxx
Normal file
@@ -0,0 +1,97 @@
|
||||
// Created on: 1991-01-14
|
||||
// Created by: Arnaud BOUZY
|
||||
// Copyright (c) 1991-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Expr_ArcSine_HeaderFile
|
||||
#define _Expr_ArcSine_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Expr_UnaryExpression.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Expr_Array1OfNamedUnknown.hxx>
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
class Standard_NumericError;
|
||||
class Expr_NotEvaluable;
|
||||
class Expr_GeneralExpression;
|
||||
class Expr_NamedUnknown;
|
||||
class TCollection_AsciiString;
|
||||
|
||||
|
||||
class Expr_ArcSine;
|
||||
DEFINE_STANDARD_HANDLE(Expr_ArcSine, Expr_UnaryExpression)
|
||||
|
||||
|
||||
class Expr_ArcSine : public Expr_UnaryExpression
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Creates the Arcsin of <exp>
|
||||
Standard_EXPORT Expr_ArcSine(const Handle(Expr_GeneralExpression)& exp);
|
||||
|
||||
//! Returns a GeneralExpression after a simplification
|
||||
//! of the arguments of <me>.
|
||||
Standard_EXPORT Handle(Expr_GeneralExpression) ShallowSimplified() const;
|
||||
|
||||
//! Returns a copy of <me> having the same unknowns and functions.
|
||||
Standard_EXPORT Handle(Expr_GeneralExpression) Copy() const;
|
||||
|
||||
//! Tests if <me> and <Other> define the same expression.
|
||||
//! This method does not include any simplification before
|
||||
//! testing.
|
||||
Standard_EXPORT Standard_Boolean IsIdentical (const Handle(Expr_GeneralExpression)& Other) const;
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsLinear() const;
|
||||
|
||||
//! Returns the derivative on <X> unknown of <me>.
|
||||
Standard_EXPORT Handle(Expr_GeneralExpression) Derivative (const Handle(Expr_NamedUnknown)& X) const;
|
||||
|
||||
//! Returns the value of <me> (as a Real) by
|
||||
//! replacement of <vars> by <vals>.
|
||||
//! Raises NotEvaluable if <me> contains NamedUnknown not
|
||||
//! in <vars> or NumericError if result cannot be computed.
|
||||
Standard_EXPORT Standard_Real Evaluate (const Expr_Array1OfNamedUnknown& vars, const TColStd_Array1OfReal& vals) const;
|
||||
|
||||
//! returns a string representing <me> in a readable way.
|
||||
Standard_EXPORT TCollection_AsciiString String() const;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(Expr_ArcSine,Expr_UnaryExpression)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Expr_ArcSine_HeaderFile
|
@@ -1,71 +0,0 @@
|
||||
-- Created on: 1991-01-14
|
||||
-- Created by: Arnaud BOUZY
|
||||
-- Copyright (c) 1991-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class ArcTangent from Expr
|
||||
|
||||
inherits UnaryExpression from Expr
|
||||
|
||||
uses GeneralExpression from Expr,
|
||||
AsciiString from TCollection,
|
||||
Array1OfNamedUnknown from Expr,
|
||||
Array1OfReal from TColStd,
|
||||
NamedUnknown from Expr
|
||||
|
||||
raises NumericError from Standard,
|
||||
NotEvaluable from Expr
|
||||
|
||||
is
|
||||
|
||||
Create(exp : GeneralExpression)
|
||||
---Purpose: Creates the Arctan of <exp>.
|
||||
returns ArcTangent;
|
||||
|
||||
ShallowSimplified(me)
|
||||
---Purpose: Returns a GeneralExpression after a simplification
|
||||
-- of the arguments of <me>.
|
||||
returns any GeneralExpression
|
||||
raises NumericError;
|
||||
|
||||
Copy(me)
|
||||
---Purpose: Returns a copy of <me> having the same unknowns and functions.
|
||||
returns like me;
|
||||
|
||||
IsIdentical(me; Other : GeneralExpression)
|
||||
---Purpose: Tests if <me> and <Other> define the same expression.
|
||||
-- This method does not include any simplification before
|
||||
-- testing.
|
||||
returns Boolean;
|
||||
|
||||
IsLinear(me)
|
||||
returns Boolean;
|
||||
|
||||
Derivative(me; X : NamedUnknown)
|
||||
---Purpose: Returns the derivative on <X> unknown of <me>.
|
||||
returns any GeneralExpression;
|
||||
|
||||
Evaluate(me; vars : Array1OfNamedUnknown; vals : Array1OfReal)
|
||||
---Purpose: Returns the value of <me> (as a Real) by
|
||||
-- replacement of <vars> by <vals>.
|
||||
-- Raises NotEvaluable if <me> contains NamedUnknown not
|
||||
-- in <vars> or NumericError if result cannot be computed.
|
||||
returns Real
|
||||
raises NotEvaluable,NumericError;
|
||||
|
||||
String(me)
|
||||
---Purpose: returns a string representing <me> in a readable way.
|
||||
returns AsciiString;
|
||||
|
||||
end ArcTangent;
|
@@ -14,14 +14,21 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Expr_ArcTangent.ixx>
|
||||
#include <Expr_NumericValue.hxx>
|
||||
#include <Expr_Tangent.hxx>
|
||||
|
||||
#include <Expr.hxx>
|
||||
#include <Expr_ArcTangent.hxx>
|
||||
#include <Expr_Division.hxx>
|
||||
#include <Expr_GeneralExpression.hxx>
|
||||
#include <Expr_NamedUnknown.hxx>
|
||||
#include <Expr_NotEvaluable.hxx>
|
||||
#include <Expr_NumericValue.hxx>
|
||||
#include <Expr_Operators.hxx>
|
||||
#include <Expr_Square.hxx>
|
||||
#include <Expr_Sum.hxx>
|
||||
#include <Expr_Operators.hxx>
|
||||
#include <Expr.hxx>
|
||||
#include <Expr_Tangent.hxx>
|
||||
#include <Standard_NumericError.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
|
||||
Expr_ArcTangent::Expr_ArcTangent (const Handle(Expr_GeneralExpression)& exp)
|
||||
{
|
||||
|
97
src/Expr/Expr_ArcTangent.hxx
Normal file
97
src/Expr/Expr_ArcTangent.hxx
Normal file
@@ -0,0 +1,97 @@
|
||||
// Created on: 1991-01-14
|
||||
// Created by: Arnaud BOUZY
|
||||
// Copyright (c) 1991-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Expr_ArcTangent_HeaderFile
|
||||
#define _Expr_ArcTangent_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Expr_UnaryExpression.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Expr_Array1OfNamedUnknown.hxx>
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
class Standard_NumericError;
|
||||
class Expr_NotEvaluable;
|
||||
class Expr_GeneralExpression;
|
||||
class Expr_NamedUnknown;
|
||||
class TCollection_AsciiString;
|
||||
|
||||
|
||||
class Expr_ArcTangent;
|
||||
DEFINE_STANDARD_HANDLE(Expr_ArcTangent, Expr_UnaryExpression)
|
||||
|
||||
|
||||
class Expr_ArcTangent : public Expr_UnaryExpression
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Creates the Arctan of <exp>.
|
||||
Standard_EXPORT Expr_ArcTangent(const Handle(Expr_GeneralExpression)& exp);
|
||||
|
||||
//! Returns a GeneralExpression after a simplification
|
||||
//! of the arguments of <me>.
|
||||
Standard_EXPORT Handle(Expr_GeneralExpression) ShallowSimplified() const;
|
||||
|
||||
//! Returns a copy of <me> having the same unknowns and functions.
|
||||
Standard_EXPORT Handle(Expr_GeneralExpression) Copy() const;
|
||||
|
||||
//! Tests if <me> and <Other> define the same expression.
|
||||
//! This method does not include any simplification before
|
||||
//! testing.
|
||||
Standard_EXPORT Standard_Boolean IsIdentical (const Handle(Expr_GeneralExpression)& Other) const;
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsLinear() const;
|
||||
|
||||
//! Returns the derivative on <X> unknown of <me>.
|
||||
Standard_EXPORT Handle(Expr_GeneralExpression) Derivative (const Handle(Expr_NamedUnknown)& X) const;
|
||||
|
||||
//! Returns the value of <me> (as a Real) by
|
||||
//! replacement of <vars> by <vals>.
|
||||
//! Raises NotEvaluable if <me> contains NamedUnknown not
|
||||
//! in <vars> or NumericError if result cannot be computed.
|
||||
Standard_EXPORT Standard_Real Evaluate (const Expr_Array1OfNamedUnknown& vars, const TColStd_Array1OfReal& vals) const;
|
||||
|
||||
//! returns a string representing <me> in a readable way.
|
||||
Standard_EXPORT TCollection_AsciiString String() const;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(Expr_ArcTangent,Expr_UnaryExpression)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Expr_ArcTangent_HeaderFile
|
@@ -1,71 +0,0 @@
|
||||
-- Created on: 1991-01-14
|
||||
-- Created by: Arnaud BOUZY
|
||||
-- Copyright (c) 1991-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class ArgCosh from Expr
|
||||
|
||||
inherits UnaryExpression from Expr
|
||||
|
||||
uses GeneralExpression from Expr,
|
||||
AsciiString from TCollection,
|
||||
Array1OfNamedUnknown from Expr,
|
||||
Array1OfReal from TColStd,
|
||||
NamedUnknown from Expr
|
||||
|
||||
raises NumericError from Standard,
|
||||
NotEvaluable from Expr
|
||||
|
||||
is
|
||||
|
||||
Create(exp : GeneralExpression)
|
||||
---Purpose: Creates the ArgCosh of <exp>
|
||||
returns ArgCosh;
|
||||
|
||||
ShallowSimplified(me)
|
||||
---Purpose: Returns a GeneralExpression after a simplification
|
||||
-- of the arguments of <me>.
|
||||
returns any GeneralExpression
|
||||
raises NumericError;
|
||||
|
||||
Copy(me)
|
||||
---Purpose: Returns a copy of <me> having the same unknowns and functions.
|
||||
returns like me;
|
||||
|
||||
IsIdentical(me; Other : GeneralExpression)
|
||||
---Purpose: Tests if <me> and <Other> define the same expression.
|
||||
-- This method does not include any simplification before
|
||||
-- testing.
|
||||
returns Boolean;
|
||||
|
||||
IsLinear(me)
|
||||
returns Boolean;
|
||||
|
||||
Derivative(me; X : NamedUnknown)
|
||||
---Purpose: Returns the derivative on <X> unknown of <me>.
|
||||
returns any GeneralExpression;
|
||||
|
||||
Evaluate(me; vars : Array1OfNamedUnknown; vals : Array1OfReal)
|
||||
---Purpose: Returns the value of <me> (as a Real) by
|
||||
-- replacement of <vars> by <vals>.
|
||||
-- Raises NotEvaluable if <me> contains NamedUnknown not
|
||||
-- in <vars> or NumericError if result cannot be computed.
|
||||
returns Real
|
||||
raises NotEvaluable,NumericError;
|
||||
|
||||
String(me)
|
||||
---Purpose: returns a string representing <me> in a readable way.
|
||||
returns AsciiString;
|
||||
|
||||
end ArgCosh;
|
@@ -14,15 +14,22 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Expr_ArgCosh.ixx>
|
||||
#include <Expr_NumericValue.hxx>
|
||||
#include <Expr_Cosh.hxx>
|
||||
#include <Expr_Division.hxx>
|
||||
#include <Expr_Square.hxx>
|
||||
#include <Expr_Difference.hxx>
|
||||
#include <Expr_SquareRoot.hxx>
|
||||
#include <Expr_Operators.hxx>
|
||||
|
||||
#include <Expr.hxx>
|
||||
#include <Expr_ArgCosh.hxx>
|
||||
#include <Expr_Cosh.hxx>
|
||||
#include <Expr_Difference.hxx>
|
||||
#include <Expr_Division.hxx>
|
||||
#include <Expr_GeneralExpression.hxx>
|
||||
#include <Expr_NamedUnknown.hxx>
|
||||
#include <Expr_NotEvaluable.hxx>
|
||||
#include <Expr_NumericValue.hxx>
|
||||
#include <Expr_Operators.hxx>
|
||||
#include <Expr_Square.hxx>
|
||||
#include <Expr_SquareRoot.hxx>
|
||||
#include <Standard_NumericError.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
|
||||
Expr_ArgCosh::Expr_ArgCosh (const Handle(Expr_GeneralExpression)& exp)
|
||||
{
|
||||
|
97
src/Expr/Expr_ArgCosh.hxx
Normal file
97
src/Expr/Expr_ArgCosh.hxx
Normal file
@@ -0,0 +1,97 @@
|
||||
// Created on: 1991-01-14
|
||||
// Created by: Arnaud BOUZY
|
||||
// Copyright (c) 1991-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Expr_ArgCosh_HeaderFile
|
||||
#define _Expr_ArgCosh_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Expr_UnaryExpression.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Expr_Array1OfNamedUnknown.hxx>
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
class Standard_NumericError;
|
||||
class Expr_NotEvaluable;
|
||||
class Expr_GeneralExpression;
|
||||
class Expr_NamedUnknown;
|
||||
class TCollection_AsciiString;
|
||||
|
||||
|
||||
class Expr_ArgCosh;
|
||||
DEFINE_STANDARD_HANDLE(Expr_ArgCosh, Expr_UnaryExpression)
|
||||
|
||||
|
||||
class Expr_ArgCosh : public Expr_UnaryExpression
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Creates the ArgCosh of <exp>
|
||||
Standard_EXPORT Expr_ArgCosh(const Handle(Expr_GeneralExpression)& exp);
|
||||
|
||||
//! Returns a GeneralExpression after a simplification
|
||||
//! of the arguments of <me>.
|
||||
Standard_EXPORT Handle(Expr_GeneralExpression) ShallowSimplified() const;
|
||||
|
||||
//! Returns a copy of <me> having the same unknowns and functions.
|
||||
Standard_EXPORT Handle(Expr_GeneralExpression) Copy() const;
|
||||
|
||||
//! Tests if <me> and <Other> define the same expression.
|
||||
//! This method does not include any simplification before
|
||||
//! testing.
|
||||
Standard_EXPORT Standard_Boolean IsIdentical (const Handle(Expr_GeneralExpression)& Other) const;
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsLinear() const;
|
||||
|
||||
//! Returns the derivative on <X> unknown of <me>.
|
||||
Standard_EXPORT Handle(Expr_GeneralExpression) Derivative (const Handle(Expr_NamedUnknown)& X) const;
|
||||
|
||||
//! Returns the value of <me> (as a Real) by
|
||||
//! replacement of <vars> by <vals>.
|
||||
//! Raises NotEvaluable if <me> contains NamedUnknown not
|
||||
//! in <vars> or NumericError if result cannot be computed.
|
||||
Standard_EXPORT Standard_Real Evaluate (const Expr_Array1OfNamedUnknown& vars, const TColStd_Array1OfReal& vals) const;
|
||||
|
||||
//! returns a string representing <me> in a readable way.
|
||||
Standard_EXPORT TCollection_AsciiString String() const;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(Expr_ArgCosh,Expr_UnaryExpression)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Expr_ArgCosh_HeaderFile
|
@@ -1,71 +0,0 @@
|
||||
-- Created on: 1991-01-14
|
||||
-- Created by: Arnaud BOUZY
|
||||
-- Copyright (c) 1991-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class ArgSinh from Expr
|
||||
|
||||
inherits UnaryExpression from Expr
|
||||
|
||||
uses GeneralExpression from Expr,
|
||||
Array1OfNamedUnknown from Expr,
|
||||
Array1OfReal from TColStd,
|
||||
AsciiString from TCollection,
|
||||
NamedUnknown from Expr
|
||||
|
||||
raises NumericError from Standard,
|
||||
NotEvaluable from Expr
|
||||
|
||||
is
|
||||
|
||||
Create(exp : GeneralExpression)
|
||||
---Purpose: Creates the ArgSinh of <exp>.
|
||||
returns ArgSinh;
|
||||
|
||||
ShallowSimplified(me)
|
||||
---Purpose: Returns a GeneralExpression after a simplification
|
||||
-- of the arguments of <me>.
|
||||
returns any GeneralExpression
|
||||
raises NumericError;
|
||||
|
||||
Copy(me)
|
||||
---Purpose: Returns a copy of <me> having the same unknowns and functions.
|
||||
returns like me;
|
||||
|
||||
IsIdentical(me; Other : GeneralExpression)
|
||||
---Purpose: Tests if <me> and <Other> define the same expression.
|
||||
-- This method does not include any simplification before
|
||||
-- testing.
|
||||
returns Boolean;
|
||||
|
||||
IsLinear(me)
|
||||
returns Boolean;
|
||||
|
||||
Derivative(me; X : NamedUnknown)
|
||||
---Purpose: Returns the derivative on <X> unknown of <me>.
|
||||
returns any GeneralExpression;
|
||||
|
||||
Evaluate(me; vars : Array1OfNamedUnknown; vals : Array1OfReal)
|
||||
---Purpose: Returns the value of <me> (as a Real) by
|
||||
-- replacement of <vars> by <vals>.
|
||||
-- Raises NotEvaluable if <me> contains NamedUnknown not
|
||||
-- in <vars> or NumericError if result cannot be computed.
|
||||
returns Real
|
||||
raises NotEvaluable;
|
||||
|
||||
String(me)
|
||||
---Purpose: returns a string representing <me> in a readable way.
|
||||
returns AsciiString;
|
||||
|
||||
end ArgSinh;
|
@@ -14,15 +14,22 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Expr_ArgSinh.ixx>
|
||||
#include <Expr_NumericValue.hxx>
|
||||
#include <Expr_Sinh.hxx>
|
||||
#include <Expr_Division.hxx>
|
||||
#include <Expr_Square.hxx>
|
||||
#include <Expr_Sum.hxx>
|
||||
#include <Expr_SquareRoot.hxx>
|
||||
#include <Expr_Operators.hxx>
|
||||
|
||||
#include <Expr.hxx>
|
||||
#include <Expr_ArgSinh.hxx>
|
||||
#include <Expr_Division.hxx>
|
||||
#include <Expr_GeneralExpression.hxx>
|
||||
#include <Expr_NamedUnknown.hxx>
|
||||
#include <Expr_NotEvaluable.hxx>
|
||||
#include <Expr_NumericValue.hxx>
|
||||
#include <Expr_Operators.hxx>
|
||||
#include <Expr_Sinh.hxx>
|
||||
#include <Expr_Square.hxx>
|
||||
#include <Expr_SquareRoot.hxx>
|
||||
#include <Expr_Sum.hxx>
|
||||
#include <Standard_NumericError.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
|
||||
Expr_ArgSinh::Expr_ArgSinh (const Handle(Expr_GeneralExpression)& exp)
|
||||
{
|
||||
|
97
src/Expr/Expr_ArgSinh.hxx
Normal file
97
src/Expr/Expr_ArgSinh.hxx
Normal file
@@ -0,0 +1,97 @@
|
||||
// Created on: 1991-01-14
|
||||
// Created by: Arnaud BOUZY
|
||||
// Copyright (c) 1991-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Expr_ArgSinh_HeaderFile
|
||||
#define _Expr_ArgSinh_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Expr_UnaryExpression.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Expr_Array1OfNamedUnknown.hxx>
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
class Standard_NumericError;
|
||||
class Expr_NotEvaluable;
|
||||
class Expr_GeneralExpression;
|
||||
class Expr_NamedUnknown;
|
||||
class TCollection_AsciiString;
|
||||
|
||||
|
||||
class Expr_ArgSinh;
|
||||
DEFINE_STANDARD_HANDLE(Expr_ArgSinh, Expr_UnaryExpression)
|
||||
|
||||
|
||||
class Expr_ArgSinh : public Expr_UnaryExpression
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Creates the ArgSinh of <exp>.
|
||||
Standard_EXPORT Expr_ArgSinh(const Handle(Expr_GeneralExpression)& exp);
|
||||
|
||||
//! Returns a GeneralExpression after a simplification
|
||||
//! of the arguments of <me>.
|
||||
Standard_EXPORT Handle(Expr_GeneralExpression) ShallowSimplified() const;
|
||||
|
||||
//! Returns a copy of <me> having the same unknowns and functions.
|
||||
Standard_EXPORT Handle(Expr_GeneralExpression) Copy() const;
|
||||
|
||||
//! Tests if <me> and <Other> define the same expression.
|
||||
//! This method does not include any simplification before
|
||||
//! testing.
|
||||
Standard_EXPORT Standard_Boolean IsIdentical (const Handle(Expr_GeneralExpression)& Other) const;
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsLinear() const;
|
||||
|
||||
//! Returns the derivative on <X> unknown of <me>.
|
||||
Standard_EXPORT Handle(Expr_GeneralExpression) Derivative (const Handle(Expr_NamedUnknown)& X) const;
|
||||
|
||||
//! Returns the value of <me> (as a Real) by
|
||||
//! replacement of <vars> by <vals>.
|
||||
//! Raises NotEvaluable if <me> contains NamedUnknown not
|
||||
//! in <vars> or NumericError if result cannot be computed.
|
||||
Standard_EXPORT Standard_Real Evaluate (const Expr_Array1OfNamedUnknown& vars, const TColStd_Array1OfReal& vals) const;
|
||||
|
||||
//! returns a string representing <me> in a readable way.
|
||||
Standard_EXPORT TCollection_AsciiString String() const;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(Expr_ArgSinh,Expr_UnaryExpression)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Expr_ArgSinh_HeaderFile
|
@@ -1,72 +0,0 @@
|
||||
-- Created on: 1991-01-14
|
||||
-- Created by: Arnaud BOUZY
|
||||
-- Copyright (c) 1991-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class ArgTanh from Expr
|
||||
|
||||
inherits UnaryExpression from Expr
|
||||
|
||||
uses GeneralExpression from Expr,
|
||||
Array1OfNamedUnknown from Expr,
|
||||
Array1OfReal from TColStd,
|
||||
AsciiString from TCollection,
|
||||
NamedUnknown from Expr
|
||||
|
||||
raises NumericError from Standard,
|
||||
NotEvaluable from Expr
|
||||
|
||||
is
|
||||
|
||||
Create(exp : GeneralExpression)
|
||||
---Purpose: Creates the Argtanh of <exp>.
|
||||
returns ArgTanh;
|
||||
|
||||
ShallowSimplified(me)
|
||||
---Purpose: Returns a GeneralExpression after a simplification
|
||||
-- of the arguments of <me>.
|
||||
returns any GeneralExpression
|
||||
raises NumericError;
|
||||
|
||||
Copy(me)
|
||||
---Purpose: Returns a copy of <me> having the same unknowns and functions.
|
||||
returns like me;
|
||||
|
||||
IsIdentical(me; Other : GeneralExpression)
|
||||
---Purpose: Tests if <me> and <Other> define the same expression.
|
||||
-- This method does not include any simplification before
|
||||
-- testing.
|
||||
returns Boolean;
|
||||
|
||||
IsLinear(me)
|
||||
returns Boolean;
|
||||
|
||||
Derivative(me; X : NamedUnknown)
|
||||
---Purpose: Returns the derivative on <X> unknown of <me>.
|
||||
returns any GeneralExpression;
|
||||
|
||||
Evaluate(me; vars : Array1OfNamedUnknown; vals : Array1OfReal)
|
||||
---Purpose: Returns the value of <me> (as a Real) by
|
||||
-- replacement of <vars> by <vals>.
|
||||
-- Raises NotEvaluable if <me> contains NamedUnknown not
|
||||
-- in <vars> or NumericError if result cannot be computed.
|
||||
returns Real
|
||||
raises NotEvaluable,NumericError;
|
||||
|
||||
String(me)
|
||||
---Purpose: returns a string representing <me> in a readable way.
|
||||
returns AsciiString;
|
||||
|
||||
end ArgTanh;
|
||||
|
@@ -14,14 +14,21 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Expr_ArgTanh.ixx>
|
||||
#include <Expr_NumericValue.hxx>
|
||||
#include <Expr_Tanh.hxx>
|
||||
#include <Expr_Division.hxx>
|
||||
#include <Expr_Square.hxx>
|
||||
#include <Expr_Difference.hxx>
|
||||
#include <Expr_Operators.hxx>
|
||||
|
||||
#include <Expr.hxx>
|
||||
#include <Expr_ArgTanh.hxx>
|
||||
#include <Expr_Difference.hxx>
|
||||
#include <Expr_Division.hxx>
|
||||
#include <Expr_GeneralExpression.hxx>
|
||||
#include <Expr_NamedUnknown.hxx>
|
||||
#include <Expr_NotEvaluable.hxx>
|
||||
#include <Expr_NumericValue.hxx>
|
||||
#include <Expr_Operators.hxx>
|
||||
#include <Expr_Square.hxx>
|
||||
#include <Expr_Tanh.hxx>
|
||||
#include <Standard_NumericError.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
|
||||
Expr_ArgTanh::Expr_ArgTanh (const Handle(Expr_GeneralExpression)& exp)
|
||||
{
|
||||
|
97
src/Expr/Expr_ArgTanh.hxx
Normal file
97
src/Expr/Expr_ArgTanh.hxx
Normal file
@@ -0,0 +1,97 @@
|
||||
// Created on: 1991-01-14
|
||||
// Created by: Arnaud BOUZY
|
||||
// Copyright (c) 1991-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Expr_ArgTanh_HeaderFile
|
||||
#define _Expr_ArgTanh_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Expr_UnaryExpression.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Expr_Array1OfNamedUnknown.hxx>
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
class Standard_NumericError;
|
||||
class Expr_NotEvaluable;
|
||||
class Expr_GeneralExpression;
|
||||
class Expr_NamedUnknown;
|
||||
class TCollection_AsciiString;
|
||||
|
||||
|
||||
class Expr_ArgTanh;
|
||||
DEFINE_STANDARD_HANDLE(Expr_ArgTanh, Expr_UnaryExpression)
|
||||
|
||||
|
||||
class Expr_ArgTanh : public Expr_UnaryExpression
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Creates the Argtanh of <exp>.
|
||||
Standard_EXPORT Expr_ArgTanh(const Handle(Expr_GeneralExpression)& exp);
|
||||
|
||||
//! Returns a GeneralExpression after a simplification
|
||||
//! of the arguments of <me>.
|
||||
Standard_EXPORT Handle(Expr_GeneralExpression) ShallowSimplified() const;
|
||||
|
||||
//! Returns a copy of <me> having the same unknowns and functions.
|
||||
Standard_EXPORT Handle(Expr_GeneralExpression) Copy() const;
|
||||
|
||||
//! Tests if <me> and <Other> define the same expression.
|
||||
//! This method does not include any simplification before
|
||||
//! testing.
|
||||
Standard_EXPORT Standard_Boolean IsIdentical (const Handle(Expr_GeneralExpression)& Other) const;
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsLinear() const;
|
||||
|
||||
//! Returns the derivative on <X> unknown of <me>.
|
||||
Standard_EXPORT Handle(Expr_GeneralExpression) Derivative (const Handle(Expr_NamedUnknown)& X) const;
|
||||
|
||||
//! Returns the value of <me> (as a Real) by
|
||||
//! replacement of <vars> by <vals>.
|
||||
//! Raises NotEvaluable if <me> contains NamedUnknown not
|
||||
//! in <vars> or NumericError if result cannot be computed.
|
||||
Standard_EXPORT Standard_Real Evaluate (const Expr_Array1OfNamedUnknown& vars, const TColStd_Array1OfReal& vals) const;
|
||||
|
||||
//! returns a string representing <me> in a readable way.
|
||||
Standard_EXPORT TCollection_AsciiString String() const;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(Expr_ArgTanh,Expr_UnaryExpression)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Expr_ArgTanh_HeaderFile
|
@@ -1,112 +0,0 @@
|
||||
-- Created on: 1991-01-10
|
||||
-- Created by: Arnaud BOUZY
|
||||
-- Copyright (c) 1991-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
deferred class BinaryExpression from Expr
|
||||
|
||||
inherits GeneralExpression from Expr
|
||||
---Purpose: Defines all binary expressions. The order of the two
|
||||
-- operands is significant.
|
||||
|
||||
uses NamedUnknown from Expr
|
||||
|
||||
raises OutOfRange from Standard,
|
||||
NumericError from Standard,
|
||||
InvalidOperand from Expr
|
||||
|
||||
is
|
||||
|
||||
FirstOperand(me)
|
||||
---C++: inline
|
||||
---C++: return const &
|
||||
---Level : Internal
|
||||
returns any GeneralExpression
|
||||
is static;
|
||||
|
||||
SecondOperand(me)
|
||||
---C++: inline
|
||||
---C++: return const &
|
||||
---Level : Internal
|
||||
returns any GeneralExpression
|
||||
is static;
|
||||
|
||||
SetFirstOperand(me : mutable; exp : GeneralExpression)
|
||||
---Purpose: Sets first operand of <me>
|
||||
-- Raises InvalidOperand if exp = me
|
||||
---Level : Internal
|
||||
raises InvalidOperand
|
||||
is static;
|
||||
|
||||
SetSecondOperand(me : mutable; exp : GeneralExpression)
|
||||
---Purpose: Sets second operand of <me>
|
||||
-- Raises InvalidOperand if <exp> contains <me>.
|
||||
---Level : Internal
|
||||
raises InvalidOperand
|
||||
is static;
|
||||
|
||||
CreateFirstOperand(me : mutable; exp : GeneralExpression)
|
||||
---Purpose: Sets first operand of <me>
|
||||
---Level : Internal
|
||||
is static protected;
|
||||
|
||||
CreateSecondOperand(me : mutable; exp : GeneralExpression)
|
||||
---Purpose: Sets second operand of <me>
|
||||
-- Raises InvalidOperand if <exp> contains <me>.
|
||||
---Level : Internal
|
||||
is static protected;
|
||||
|
||||
NbSubExpressions(me)
|
||||
---Purpose: returns the number of sub-expressions contained
|
||||
-- in <me> ( >= 0)
|
||||
returns Integer
|
||||
is static;
|
||||
|
||||
SubExpression(me; I : Integer)
|
||||
---Purpose: returns the <I>-th sub-expression of <me>
|
||||
-- raises OutOfRange if <I> > NbSubExpressions(me)
|
||||
---C++: return const &
|
||||
returns any GeneralExpression
|
||||
raises OutOfRange
|
||||
is static;
|
||||
|
||||
ContainsUnknowns(me)
|
||||
---Purpose: Does <me> contain NamedUnknown ?
|
||||
returns Boolean
|
||||
is static;
|
||||
|
||||
Contains(me; exp : GeneralExpression)
|
||||
---Purpose: Tests if <me> contains <exp>.
|
||||
returns Boolean
|
||||
is static;
|
||||
|
||||
Replace(me : mutable ; var : NamedUnknown ; with : GeneralExpression)
|
||||
---Purpose: Replaces all occurences of <var> with <with> in <me>.
|
||||
-- Raises InvalidOperand if <with> contains <me>.
|
||||
raises InvalidOperand
|
||||
is static;
|
||||
|
||||
Simplified(me)
|
||||
---Purpose: Returns a GeneralExpression after replacement of
|
||||
-- NamedUnknowns by an associated expression and after
|
||||
-- values computation.
|
||||
returns any GeneralExpression
|
||||
raises NumericError;
|
||||
|
||||
fields
|
||||
|
||||
myFirstOperand : GeneralExpression;
|
||||
mySecondOperand : GeneralExpression;
|
||||
|
||||
end BinaryExpression;
|
@@ -14,11 +14,14 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Expr_BinaryExpression.ixx>
|
||||
#include <Expr_NamedUnknown.hxx>
|
||||
#include <Expr_InvalidOperand.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
|
||||
#include <Expr_BinaryExpression.hxx>
|
||||
#include <Expr_GeneralExpression.hxx>
|
||||
#include <Expr_InvalidOperand.hxx>
|
||||
#include <Expr_NamedUnknown.hxx>
|
||||
#include <Standard_NumericError.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
void Expr_BinaryExpression::SetFirstOperand (const Handle(Expr_GeneralExpression)& exp)
|
||||
{
|
||||
|
112
src/Expr/Expr_BinaryExpression.hxx
Normal file
112
src/Expr/Expr_BinaryExpression.hxx
Normal file
@@ -0,0 +1,112 @@
|
||||
// Created on: 1991-01-10
|
||||
// Created by: Arnaud BOUZY
|
||||
// Copyright (c) 1991-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Expr_BinaryExpression_HeaderFile
|
||||
#define _Expr_BinaryExpression_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Expr_GeneralExpression.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
class Expr_GeneralExpression;
|
||||
class Standard_OutOfRange;
|
||||
class Standard_NumericError;
|
||||
class Expr_InvalidOperand;
|
||||
class Expr_NamedUnknown;
|
||||
|
||||
|
||||
class Expr_BinaryExpression;
|
||||
DEFINE_STANDARD_HANDLE(Expr_BinaryExpression, Expr_GeneralExpression)
|
||||
|
||||
//! Defines all binary expressions. The order of the two
|
||||
//! operands is significant.
|
||||
class Expr_BinaryExpression : public Expr_GeneralExpression
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
const Handle(Expr_GeneralExpression)& FirstOperand() const;
|
||||
|
||||
const Handle(Expr_GeneralExpression)& SecondOperand() const;
|
||||
|
||||
//! Sets first operand of <me>
|
||||
//! Raises InvalidOperand if exp = me
|
||||
Standard_EXPORT void SetFirstOperand (const Handle(Expr_GeneralExpression)& exp);
|
||||
|
||||
//! Sets second operand of <me>
|
||||
//! Raises InvalidOperand if <exp> contains <me>.
|
||||
Standard_EXPORT void SetSecondOperand (const Handle(Expr_GeneralExpression)& exp);
|
||||
|
||||
//! returns the number of sub-expressions contained
|
||||
//! in <me> ( >= 0)
|
||||
Standard_EXPORT Standard_Integer NbSubExpressions() const;
|
||||
|
||||
//! returns the <I>-th sub-expression of <me>
|
||||
//! raises OutOfRange if <I> > NbSubExpressions(me)
|
||||
Standard_EXPORT const Handle(Expr_GeneralExpression)& SubExpression (const Standard_Integer I) const;
|
||||
|
||||
//! Does <me> contain NamedUnknown ?
|
||||
Standard_EXPORT Standard_Boolean ContainsUnknowns() const;
|
||||
|
||||
//! Tests if <me> contains <exp>.
|
||||
Standard_EXPORT Standard_Boolean Contains (const Handle(Expr_GeneralExpression)& exp) const;
|
||||
|
||||
//! Replaces all occurences of <var> with <with> in <me>.
|
||||
//! Raises InvalidOperand if <with> contains <me>.
|
||||
Standard_EXPORT void Replace (const Handle(Expr_NamedUnknown)& var, const Handle(Expr_GeneralExpression)& with);
|
||||
|
||||
//! Returns a GeneralExpression after replacement of
|
||||
//! NamedUnknowns by an associated expression and after
|
||||
//! values computation.
|
||||
Standard_EXPORT Handle(Expr_GeneralExpression) Simplified() const;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(Expr_BinaryExpression,Expr_GeneralExpression)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
//! Sets first operand of <me>
|
||||
Standard_EXPORT void CreateFirstOperand (const Handle(Expr_GeneralExpression)& exp);
|
||||
|
||||
//! Sets second operand of <me>
|
||||
//! Raises InvalidOperand if <exp> contains <me>.
|
||||
Standard_EXPORT void CreateSecondOperand (const Handle(Expr_GeneralExpression)& exp);
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Handle(Expr_GeneralExpression) myFirstOperand;
|
||||
Handle(Expr_GeneralExpression) mySecondOperand;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#include <Expr_BinaryExpression.lxx>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Expr_BinaryExpression_HeaderFile
|
@@ -1,86 +0,0 @@
|
||||
-- Created on: 1991-01-14
|
||||
-- Created by: Arnaud BOUZY
|
||||
-- Copyright (c) 1991-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class BinaryFunction from Expr
|
||||
|
||||
inherits BinaryExpression from Expr
|
||||
|
||||
---Purpose: Defines the use of a binary function in an expression
|
||||
-- with given arguments.
|
||||
|
||||
uses GeneralFunction from Expr,
|
||||
AsciiString from TCollection,
|
||||
GeneralExpression from Expr,
|
||||
Array1OfNamedUnknown from Expr,
|
||||
Array1OfReal from TColStd,
|
||||
NamedUnknown from Expr
|
||||
|
||||
raises InvalidFunction from Expr,
|
||||
NumericError from Standard,
|
||||
NotEvaluable from Expr
|
||||
|
||||
is
|
||||
|
||||
Create(func : GeneralFunction; exp1,exp2 : GeneralExpression)
|
||||
---Purpose: Creates <me> as <func> (<exp1>,<exp2>).
|
||||
-- Raises exception if <func> is not binary.
|
||||
returns BinaryFunction
|
||||
raises InvalidFunction;
|
||||
|
||||
Function(me)
|
||||
---Purpose: Returns the function defining <me>.
|
||||
returns GeneralFunction;
|
||||
|
||||
ShallowSimplified(me)
|
||||
---Purpose: Returns a GeneralExpression after a simplification
|
||||
-- of the arguments of <me>.
|
||||
returns any GeneralExpression
|
||||
raises NumericError;
|
||||
|
||||
Copy(me)
|
||||
---Purpose: Returns a copy of <me> having the same unknowns and functions.
|
||||
returns like me;
|
||||
|
||||
IsIdentical(me; Other : GeneralExpression)
|
||||
---Purpose: Tests if <me> and <Other> define the same expression.
|
||||
-- This method does not include any simplification before
|
||||
-- testing.
|
||||
returns Boolean;
|
||||
|
||||
IsLinear(me)
|
||||
returns Boolean;
|
||||
|
||||
Derivative(me; X : NamedUnknown)
|
||||
---Purpose: Returns the derivative on <X> unknown of <me>
|
||||
returns any GeneralExpression;
|
||||
|
||||
Evaluate(me; vars : Array1OfNamedUnknown; vals : Array1OfReal)
|
||||
---Purpose: Returns the value of <me> (as a Real) by
|
||||
-- replacement of <vars> by <vals>.
|
||||
-- Raises NotEvaluable if <me> contains NamedUnknown not
|
||||
-- in <vars> or NumericError if result cannot be computed.
|
||||
returns Real
|
||||
raises NotEvaluable,NumericError;
|
||||
|
||||
String(me)
|
||||
---Purpose: returns a string representing <me> in a readable way.
|
||||
returns AsciiString;
|
||||
|
||||
fields
|
||||
|
||||
myFunction : GeneralFunction;
|
||||
|
||||
end BinaryFunction;
|
@@ -19,16 +19,24 @@
|
||||
#define No_Standard_OutOfRange
|
||||
#endif
|
||||
|
||||
#include <Expr_BinaryFunction.ixx>
|
||||
#include <Expr_InvalidFunction.hxx>
|
||||
#include <Expr_Array1OfNamedUnknown.hxx>
|
||||
|
||||
#include <Expr.hxx>
|
||||
#include <Expr_Array1OfGeneralExpression.hxx>
|
||||
#include <Expr_Array1OfNamedUnknown.hxx>
|
||||
#include <Expr_BinaryFunction.hxx>
|
||||
#include <Expr_FunctionDerivative.hxx>
|
||||
#include <Expr_GeneralExpression.hxx>
|
||||
#include <Expr_GeneralFunction.hxx>
|
||||
#include <Expr_InvalidFunction.hxx>
|
||||
#include <Expr_NamedUnknown.hxx>
|
||||
#include <Expr_NotEvaluable.hxx>
|
||||
#include <Expr_NumericValue.hxx>
|
||||
#include <Expr_Operators.hxx>
|
||||
#include <Expr_Product.hxx>
|
||||
#include <Expr_Sum.hxx>
|
||||
#include <Expr_Operators.hxx>
|
||||
#include <Expr.hxx>
|
||||
#include <Expr_NumericValue.hxx>
|
||||
#include <Standard_NumericError.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
|
||||
Expr_BinaryFunction::Expr_BinaryFunction (const Handle(Expr_GeneralFunction)& func, const Handle(Expr_GeneralExpression)& exp1, const Handle(Expr_GeneralExpression)& exp2)
|
||||
{
|
||||
|
105
src/Expr/Expr_BinaryFunction.hxx
Normal file
105
src/Expr/Expr_BinaryFunction.hxx
Normal file
@@ -0,0 +1,105 @@
|
||||
// Created on: 1991-01-14
|
||||
// Created by: Arnaud BOUZY
|
||||
// Copyright (c) 1991-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Expr_BinaryFunction_HeaderFile
|
||||
#define _Expr_BinaryFunction_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Expr_BinaryExpression.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Expr_Array1OfNamedUnknown.hxx>
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
class Expr_GeneralFunction;
|
||||
class Expr_InvalidFunction;
|
||||
class Standard_NumericError;
|
||||
class Expr_NotEvaluable;
|
||||
class Expr_GeneralExpression;
|
||||
class Expr_NamedUnknown;
|
||||
class TCollection_AsciiString;
|
||||
|
||||
|
||||
class Expr_BinaryFunction;
|
||||
DEFINE_STANDARD_HANDLE(Expr_BinaryFunction, Expr_BinaryExpression)
|
||||
|
||||
//! Defines the use of a binary function in an expression
|
||||
//! with given arguments.
|
||||
class Expr_BinaryFunction : public Expr_BinaryExpression
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Creates <me> as <func> (<exp1>,<exp2>).
|
||||
//! Raises exception if <func> is not binary.
|
||||
Standard_EXPORT Expr_BinaryFunction(const Handle(Expr_GeneralFunction)& func, const Handle(Expr_GeneralExpression)& exp1, const Handle(Expr_GeneralExpression)& exp2);
|
||||
|
||||
//! Returns the function defining <me>.
|
||||
Standard_EXPORT Handle(Expr_GeneralFunction) Function() const;
|
||||
|
||||
//! Returns a GeneralExpression after a simplification
|
||||
//! of the arguments of <me>.
|
||||
Standard_EXPORT Handle(Expr_GeneralExpression) ShallowSimplified() const;
|
||||
|
||||
//! Returns a copy of <me> having the same unknowns and functions.
|
||||
Standard_EXPORT Handle(Expr_GeneralExpression) Copy() const;
|
||||
|
||||
//! Tests if <me> and <Other> define the same expression.
|
||||
//! This method does not include any simplification before
|
||||
//! testing.
|
||||
Standard_EXPORT Standard_Boolean IsIdentical (const Handle(Expr_GeneralExpression)& Other) const;
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsLinear() const;
|
||||
|
||||
//! Returns the derivative on <X> unknown of <me>
|
||||
Standard_EXPORT Handle(Expr_GeneralExpression) Derivative (const Handle(Expr_NamedUnknown)& X) const;
|
||||
|
||||
//! Returns the value of <me> (as a Real) by
|
||||
//! replacement of <vars> by <vals>.
|
||||
//! Raises NotEvaluable if <me> contains NamedUnknown not
|
||||
//! in <vars> or NumericError if result cannot be computed.
|
||||
Standard_EXPORT Standard_Real Evaluate (const Expr_Array1OfNamedUnknown& vars, const TColStd_Array1OfReal& vals) const;
|
||||
|
||||
//! returns a string representing <me> in a readable way.
|
||||
Standard_EXPORT TCollection_AsciiString String() const;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(Expr_BinaryFunction,Expr_BinaryExpression)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Handle(Expr_GeneralFunction) myFunction;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Expr_BinaryFunction_HeaderFile
|
@@ -1,71 +0,0 @@
|
||||
-- Created on: 1991-01-14
|
||||
-- Created by: Arnaud BOUZY
|
||||
-- Copyright (c) 1991-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class Cosh from Expr
|
||||
|
||||
inherits UnaryExpression from Expr
|
||||
|
||||
uses GeneralExpression from Expr,
|
||||
AsciiString from TCollection,
|
||||
Array1OfNamedUnknown from Expr,
|
||||
Array1OfReal from TColStd,
|
||||
NamedUnknown from Expr
|
||||
|
||||
raises NumericError from Standard,
|
||||
NotEvaluable from Expr
|
||||
|
||||
is
|
||||
|
||||
Create(exp : GeneralExpression)
|
||||
---Purpose: Creates the Cosh of <exp>
|
||||
returns Cosh;
|
||||
|
||||
ShallowSimplified(me)
|
||||
---Purpose: Returns a GeneralExpression after a simplification
|
||||
-- of the arguments of <me>.
|
||||
returns any GeneralExpression
|
||||
raises NumericError;
|
||||
|
||||
Copy(me)
|
||||
---Purpose: Returns a copy of <me> having the same unknowns and functions.
|
||||
returns like me;
|
||||
|
||||
IsIdentical(me; Other : GeneralExpression)
|
||||
---Purpose: Tests if <me> and <Other> define the same expression.
|
||||
-- This method does not include any simplification before
|
||||
-- testing.
|
||||
returns Boolean;
|
||||
|
||||
IsLinear(me)
|
||||
returns Boolean;
|
||||
|
||||
Derivative(me; X : NamedUnknown)
|
||||
---Purpose: Returns the derivative on <X> unknown of <me>.
|
||||
returns any GeneralExpression;
|
||||
|
||||
Evaluate(me; vars : Array1OfNamedUnknown; vals : Array1OfReal)
|
||||
---Purpose: Returns the value of <me> (as a Real) by
|
||||
-- replacement of <vars> by <vals>.
|
||||
-- Raises NotEvaluable if <me> contains NamedUnknown not
|
||||
-- in <vars> or NumericError if result cannot be computed.
|
||||
returns Real
|
||||
raises NotEvaluable,NumericError;
|
||||
|
||||
String(me)
|
||||
---Purpose: returns a string representing <me> in a readable way.
|
||||
returns AsciiString;
|
||||
|
||||
end Cosh;
|
@@ -14,13 +14,20 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Expr_Cosh.ixx>
|
||||
#include <Expr_NumericValue.hxx>
|
||||
#include <Expr_ArgCosh.hxx>
|
||||
#include <Expr_Sinh.hxx>
|
||||
#include <Expr_Product.hxx>
|
||||
#include <Expr_Operators.hxx>
|
||||
|
||||
#include <Expr.hxx>
|
||||
#include <Expr_ArgCosh.hxx>
|
||||
#include <Expr_Cosh.hxx>
|
||||
#include <Expr_GeneralExpression.hxx>
|
||||
#include <Expr_NamedUnknown.hxx>
|
||||
#include <Expr_NotEvaluable.hxx>
|
||||
#include <Expr_NumericValue.hxx>
|
||||
#include <Expr_Operators.hxx>
|
||||
#include <Expr_Product.hxx>
|
||||
#include <Expr_Sinh.hxx>
|
||||
#include <Standard_NumericError.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
|
||||
Expr_Cosh::Expr_Cosh(const Handle(Expr_GeneralExpression)& exp)
|
||||
{
|
||||
|
97
src/Expr/Expr_Cosh.hxx
Normal file
97
src/Expr/Expr_Cosh.hxx
Normal file
@@ -0,0 +1,97 @@
|
||||
// Created on: 1991-01-14
|
||||
// Created by: Arnaud BOUZY
|
||||
// Copyright (c) 1991-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Expr_Cosh_HeaderFile
|
||||
#define _Expr_Cosh_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Expr_UnaryExpression.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Expr_Array1OfNamedUnknown.hxx>
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
class Standard_NumericError;
|
||||
class Expr_NotEvaluable;
|
||||
class Expr_GeneralExpression;
|
||||
class Expr_NamedUnknown;
|
||||
class TCollection_AsciiString;
|
||||
|
||||
|
||||
class Expr_Cosh;
|
||||
DEFINE_STANDARD_HANDLE(Expr_Cosh, Expr_UnaryExpression)
|
||||
|
||||
|
||||
class Expr_Cosh : public Expr_UnaryExpression
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Creates the Cosh of <exp>
|
||||
Standard_EXPORT Expr_Cosh(const Handle(Expr_GeneralExpression)& exp);
|
||||
|
||||
//! Returns a GeneralExpression after a simplification
|
||||
//! of the arguments of <me>.
|
||||
Standard_EXPORT Handle(Expr_GeneralExpression) ShallowSimplified() const;
|
||||
|
||||
//! Returns a copy of <me> having the same unknowns and functions.
|
||||
Standard_EXPORT Handle(Expr_GeneralExpression) Copy() const;
|
||||
|
||||
//! Tests if <me> and <Other> define the same expression.
|
||||
//! This method does not include any simplification before
|
||||
//! testing.
|
||||
Standard_EXPORT Standard_Boolean IsIdentical (const Handle(Expr_GeneralExpression)& Other) const;
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsLinear() const;
|
||||
|
||||
//! Returns the derivative on <X> unknown of <me>.
|
||||
Standard_EXPORT Handle(Expr_GeneralExpression) Derivative (const Handle(Expr_NamedUnknown)& X) const;
|
||||
|
||||
//! Returns the value of <me> (as a Real) by
|
||||
//! replacement of <vars> by <vals>.
|
||||
//! Raises NotEvaluable if <me> contains NamedUnknown not
|
||||
//! in <vars> or NumericError if result cannot be computed.
|
||||
Standard_EXPORT Standard_Real Evaluate (const Expr_Array1OfNamedUnknown& vars, const TColStd_Array1OfReal& vals) const;
|
||||
|
||||
//! returns a string representing <me> in a readable way.
|
||||
Standard_EXPORT TCollection_AsciiString String() const;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(Expr_Cosh,Expr_UnaryExpression)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Expr_Cosh_HeaderFile
|
@@ -1,71 +0,0 @@
|
||||
-- Created on: 1991-01-14
|
||||
-- Created by: Arnaud BOUZY
|
||||
-- Copyright (c) 1991-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class Cosine from Expr
|
||||
|
||||
inherits UnaryExpression from Expr
|
||||
|
||||
uses GeneralExpression from Expr,
|
||||
AsciiString from TCollection,
|
||||
Array1OfNamedUnknown from Expr,
|
||||
Array1OfReal from TColStd,
|
||||
NamedUnknown from Expr
|
||||
|
||||
raises NumericError from Standard,
|
||||
NotEvaluable from Expr
|
||||
|
||||
is
|
||||
|
||||
Create(Exp : GeneralExpression)
|
||||
---Purpose: Creates the cosine of Exp
|
||||
returns Cosine;
|
||||
|
||||
ShallowSimplified(me)
|
||||
---Purpose: Returns a GeneralExpression after a simplification
|
||||
-- of the arguments of <me>.
|
||||
returns any GeneralExpression
|
||||
raises NumericError;
|
||||
|
||||
Copy(me)
|
||||
---Purpose: Returns a copy of <me> having the same unknowns and functions.
|
||||
returns like me;
|
||||
|
||||
IsIdentical(me; Other : GeneralExpression)
|
||||
---Purpose: Tests if <me> and <Other> define the same expression.
|
||||
-- This method does not include any simplification before
|
||||
-- testing.
|
||||
returns Boolean;
|
||||
|
||||
IsLinear(me)
|
||||
returns Boolean;
|
||||
|
||||
Derivative(me; X : NamedUnknown)
|
||||
---Purpose: Returns the derivative on <X> unknown of <me>
|
||||
returns any GeneralExpression;
|
||||
|
||||
Evaluate(me; vars : Array1OfNamedUnknown; vals : Array1OfReal)
|
||||
---Purpose: Returns the value of <me> (as a Real) by
|
||||
-- replacement of <vars> by <vals>.
|
||||
-- Raises NotEvaluable if <me> contains NamedUnknown not
|
||||
-- in <vars> or NumericError if result cannot be computed.
|
||||
returns Real
|
||||
raises NotEvaluable,NumericError;
|
||||
|
||||
String(me)
|
||||
---Purpose: returns a string representing <me> in a readable way.
|
||||
returns AsciiString;
|
||||
|
||||
end Cosine;
|
@@ -14,14 +14,21 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Expr_Cosine.ixx>
|
||||
#include <Expr_NumericValue.hxx>
|
||||
|
||||
#include <Expr.hxx>
|
||||
#include <Expr_ArcCosine.hxx>
|
||||
#include <Expr_Cosine.hxx>
|
||||
#include <Expr_GeneralExpression.hxx>
|
||||
#include <Expr_NamedUnknown.hxx>
|
||||
#include <Expr_NotEvaluable.hxx>
|
||||
#include <Expr_NumericValue.hxx>
|
||||
#include <Expr_Operators.hxx>
|
||||
#include <Expr_Product.hxx>
|
||||
#include <Expr_Sine.hxx>
|
||||
#include <Expr_UnaryMinus.hxx>
|
||||
#include <Expr_Product.hxx>
|
||||
#include <Expr_Operators.hxx>
|
||||
#include <Expr.hxx>
|
||||
#include <Standard_NumericError.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
|
||||
Expr_Cosine::Expr_Cosine(const Handle(Expr_GeneralExpression)& exp)
|
||||
{
|
||||
|
97
src/Expr/Expr_Cosine.hxx
Normal file
97
src/Expr/Expr_Cosine.hxx
Normal file
@@ -0,0 +1,97 @@
|
||||
// Created on: 1991-01-14
|
||||
// Created by: Arnaud BOUZY
|
||||
// Copyright (c) 1991-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Expr_Cosine_HeaderFile
|
||||
#define _Expr_Cosine_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Expr_UnaryExpression.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Expr_Array1OfNamedUnknown.hxx>
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
class Standard_NumericError;
|
||||
class Expr_NotEvaluable;
|
||||
class Expr_GeneralExpression;
|
||||
class Expr_NamedUnknown;
|
||||
class TCollection_AsciiString;
|
||||
|
||||
|
||||
class Expr_Cosine;
|
||||
DEFINE_STANDARD_HANDLE(Expr_Cosine, Expr_UnaryExpression)
|
||||
|
||||
|
||||
class Expr_Cosine : public Expr_UnaryExpression
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Creates the cosine of Exp
|
||||
Standard_EXPORT Expr_Cosine(const Handle(Expr_GeneralExpression)& Exp);
|
||||
|
||||
//! Returns a GeneralExpression after a simplification
|
||||
//! of the arguments of <me>.
|
||||
Standard_EXPORT Handle(Expr_GeneralExpression) ShallowSimplified() const;
|
||||
|
||||
//! Returns a copy of <me> having the same unknowns and functions.
|
||||
Standard_EXPORT Handle(Expr_GeneralExpression) Copy() const;
|
||||
|
||||
//! Tests if <me> and <Other> define the same expression.
|
||||
//! This method does not include any simplification before
|
||||
//! testing.
|
||||
Standard_EXPORT Standard_Boolean IsIdentical (const Handle(Expr_GeneralExpression)& Other) const;
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsLinear() const;
|
||||
|
||||
//! Returns the derivative on <X> unknown of <me>
|
||||
Standard_EXPORT Handle(Expr_GeneralExpression) Derivative (const Handle(Expr_NamedUnknown)& X) const;
|
||||
|
||||
//! Returns the value of <me> (as a Real) by
|
||||
//! replacement of <vars> by <vals>.
|
||||
//! Raises NotEvaluable if <me> contains NamedUnknown not
|
||||
//! in <vars> or NumericError if result cannot be computed.
|
||||
Standard_EXPORT Standard_Real Evaluate (const Expr_Array1OfNamedUnknown& vars, const TColStd_Array1OfReal& vals) const;
|
||||
|
||||
//! returns a string representing <me> in a readable way.
|
||||
Standard_EXPORT TCollection_AsciiString String() const;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(Expr_Cosine,Expr_UnaryExpression)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Expr_Cosine_HeaderFile
|
@@ -1,79 +0,0 @@
|
||||
-- Created on: 1991-01-14
|
||||
-- Created by: Arnaud BOUZY
|
||||
-- Copyright (c) 1991-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class Difference from Expr
|
||||
|
||||
inherits BinaryExpression from Expr
|
||||
|
||||
uses GeneralExpression from Expr,
|
||||
AsciiString from TCollection,
|
||||
Array1OfNamedUnknown from Expr,
|
||||
Array1OfReal from TColStd,
|
||||
NamedUnknown from Expr
|
||||
|
||||
raises OutOfRange from Standard,
|
||||
NumericError from Standard,
|
||||
NotEvaluable from Expr
|
||||
|
||||
is
|
||||
|
||||
Create(exp1,exp2 : GeneralExpression)
|
||||
---Purpose: Creates the difference <exp1> - <exp2>.
|
||||
returns Difference;
|
||||
|
||||
ShallowSimplified(me)
|
||||
---Purpose: Returns a GeneralExpression after a simplification
|
||||
-- of the arguments of <me>.
|
||||
returns any GeneralExpression
|
||||
raises NumericError;
|
||||
|
||||
Copy(me)
|
||||
---Purpose: Returns a copy of <me> having the same unknowns and functions.
|
||||
returns like me;
|
||||
|
||||
IsIdentical(me; Other : GeneralExpression)
|
||||
---Purpose: Tests if <me> and <Other> define the same expression.
|
||||
-- This method does not include any simplification before
|
||||
-- testing.
|
||||
returns Boolean;
|
||||
|
||||
IsLinear(me)
|
||||
returns Boolean;
|
||||
|
||||
Derivative(me; X : NamedUnknown)
|
||||
---Purpose: Returns the derivative on <X> unknown of <me>
|
||||
returns any GeneralExpression;
|
||||
|
||||
NDerivative(me; X : NamedUnknown; N : Integer)
|
||||
---Purpose: Returns the <N>-th derivative on <X> unknown of <me>.
|
||||
-- Raises OutOfRange if <N> <= 0
|
||||
returns any GeneralExpression
|
||||
raises OutOfRange
|
||||
is redefined;
|
||||
|
||||
Evaluate(me; vars : Array1OfNamedUnknown; vals : Array1OfReal)
|
||||
---Purpose: Returns the value of <me> (as a Real) by
|
||||
-- replacement of <vars> by <vals>.
|
||||
-- Raises NotEvaluable if <me> contains NamedUnknown not
|
||||
-- in <vars> or NumericError if result cannot be computed.
|
||||
returns Real
|
||||
raises NotEvaluable,NumericError;
|
||||
|
||||
String(me)
|
||||
---Purpose: returns a string representing <me> in a readable way.
|
||||
returns AsciiString;
|
||||
|
||||
end Difference;
|
@@ -14,13 +14,20 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Expr_Difference.ixx>
|
||||
#include <Expr_UnaryMinus.hxx>
|
||||
#include <Expr_NumericValue.hxx>
|
||||
#include <Expr_Sum.hxx>
|
||||
#include <Expr_Operators.hxx>
|
||||
|
||||
#include <Expr.hxx>
|
||||
#include <Expr_Difference.hxx>
|
||||
#include <Expr_GeneralExpression.hxx>
|
||||
#include <Expr_NamedUnknown.hxx>
|
||||
#include <Expr_NotEvaluable.hxx>
|
||||
#include <Expr_NumericValue.hxx>
|
||||
#include <Expr_Operators.hxx>
|
||||
#include <Expr_Sum.hxx>
|
||||
#include <Expr_UnaryMinus.hxx>
|
||||
#include <Standard_NumericError.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
|
||||
Expr_Difference::Expr_Difference (const Handle(Expr_GeneralExpression)& exp1, const Handle(Expr_GeneralExpression)& exp2)
|
||||
{
|
||||
|
103
src/Expr/Expr_Difference.hxx
Normal file
103
src/Expr/Expr_Difference.hxx
Normal file
@@ -0,0 +1,103 @@
|
||||
// Created on: 1991-01-14
|
||||
// Created by: Arnaud BOUZY
|
||||
// Copyright (c) 1991-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Expr_Difference_HeaderFile
|
||||
#define _Expr_Difference_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Expr_BinaryExpression.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Expr_Array1OfNamedUnknown.hxx>
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
class Standard_OutOfRange;
|
||||
class Standard_NumericError;
|
||||
class Expr_NotEvaluable;
|
||||
class Expr_GeneralExpression;
|
||||
class Expr_NamedUnknown;
|
||||
class TCollection_AsciiString;
|
||||
|
||||
|
||||
class Expr_Difference;
|
||||
DEFINE_STANDARD_HANDLE(Expr_Difference, Expr_BinaryExpression)
|
||||
|
||||
|
||||
class Expr_Difference : public Expr_BinaryExpression
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Creates the difference <exp1> - <exp2>.
|
||||
Standard_EXPORT Expr_Difference(const Handle(Expr_GeneralExpression)& exp1, const Handle(Expr_GeneralExpression)& exp2);
|
||||
|
||||
//! Returns a GeneralExpression after a simplification
|
||||
//! of the arguments of <me>.
|
||||
Standard_EXPORT Handle(Expr_GeneralExpression) ShallowSimplified() const;
|
||||
|
||||
//! Returns a copy of <me> having the same unknowns and functions.
|
||||
Standard_EXPORT Handle(Expr_GeneralExpression) Copy() const;
|
||||
|
||||
//! Tests if <me> and <Other> define the same expression.
|
||||
//! This method does not include any simplification before
|
||||
//! testing.
|
||||
Standard_EXPORT Standard_Boolean IsIdentical (const Handle(Expr_GeneralExpression)& Other) const;
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsLinear() const;
|
||||
|
||||
//! Returns the derivative on <X> unknown of <me>
|
||||
Standard_EXPORT Handle(Expr_GeneralExpression) Derivative (const Handle(Expr_NamedUnknown)& X) const;
|
||||
|
||||
//! Returns the <N>-th derivative on <X> unknown of <me>.
|
||||
//! Raises OutOfRange if <N> <= 0
|
||||
Standard_EXPORT virtual Handle(Expr_GeneralExpression) NDerivative (const Handle(Expr_NamedUnknown)& X, const Standard_Integer N) const Standard_OVERRIDE;
|
||||
|
||||
//! Returns the value of <me> (as a Real) by
|
||||
//! replacement of <vars> by <vals>.
|
||||
//! Raises NotEvaluable if <me> contains NamedUnknown not
|
||||
//! in <vars> or NumericError if result cannot be computed.
|
||||
Standard_EXPORT Standard_Real Evaluate (const Expr_Array1OfNamedUnknown& vars, const TColStd_Array1OfReal& vals) const;
|
||||
|
||||
//! returns a string representing <me> in a readable way.
|
||||
Standard_EXPORT TCollection_AsciiString String() const;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(Expr_Difference,Expr_BinaryExpression)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Expr_Difference_HeaderFile
|
@@ -1,57 +0,0 @@
|
||||
-- Created on: 1991-01-14
|
||||
-- Created by: Arnaud BOUZY
|
||||
-- Copyright (c) 1991-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class Different from Expr
|
||||
|
||||
inherits SingleRelation from Expr
|
||||
|
||||
uses GeneralExpression from Expr,
|
||||
GeneralRelation from Expr,
|
||||
AsciiString from TCollection
|
||||
|
||||
raises NumericError from Standard
|
||||
|
||||
is
|
||||
|
||||
Create(exp1 : GeneralExpression ; exp2 : GeneralExpression)
|
||||
---Purpose: Creates the relation <exp1> # <exp2>.
|
||||
returns Different;
|
||||
|
||||
IsSatisfied(me)
|
||||
returns Boolean;
|
||||
|
||||
Simplified(me)
|
||||
---Purpose: Returns a GeneralRelation after replacement of
|
||||
-- NamedUnknowns by an associated expression, and after
|
||||
-- values computation.
|
||||
returns GeneralRelation
|
||||
raises NumericError;
|
||||
|
||||
Simplify(me : mutable)
|
||||
---Purpose: Replaces NamedUnknowns by associated expressions,
|
||||
-- and computes values in <me>.
|
||||
raises NumericError;
|
||||
|
||||
Copy(me)
|
||||
---Purpose: Returns a copy of <me> having the same unknowns and
|
||||
-- functions.
|
||||
returns like me;
|
||||
|
||||
String(me)
|
||||
---Purpose: returns a string representing <me> in a readable way.
|
||||
returns AsciiString;
|
||||
|
||||
end Different;
|
@@ -14,9 +14,14 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Expr_Different.ixx>
|
||||
|
||||
#include <Expr.hxx>
|
||||
#include <Expr_Different.hxx>
|
||||
#include <Expr_GeneralExpression.hxx>
|
||||
#include <Expr_GeneralRelation.hxx>
|
||||
#include <Standard_NumericError.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
|
||||
Expr_Different::Expr_Different (const Handle(Expr_GeneralExpression)& exp1, const Handle(Expr_GeneralExpression)& exp2)
|
||||
{
|
||||
|
85
src/Expr/Expr_Different.hxx
Normal file
85
src/Expr/Expr_Different.hxx
Normal file
@@ -0,0 +1,85 @@
|
||||
// Created on: 1991-01-14
|
||||
// Created by: Arnaud BOUZY
|
||||
// Copyright (c) 1991-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Expr_Different_HeaderFile
|
||||
#define _Expr_Different_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Expr_SingleRelation.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
class Standard_NumericError;
|
||||
class Expr_GeneralExpression;
|
||||
class Expr_GeneralRelation;
|
||||
class TCollection_AsciiString;
|
||||
|
||||
|
||||
class Expr_Different;
|
||||
DEFINE_STANDARD_HANDLE(Expr_Different, Expr_SingleRelation)
|
||||
|
||||
|
||||
class Expr_Different : public Expr_SingleRelation
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Creates the relation <exp1> # <exp2>.
|
||||
Standard_EXPORT Expr_Different(const Handle(Expr_GeneralExpression)& exp1, const Handle(Expr_GeneralExpression)& exp2);
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsSatisfied() const;
|
||||
|
||||
//! Returns a GeneralRelation after replacement of
|
||||
//! NamedUnknowns by an associated expression, and after
|
||||
//! values computation.
|
||||
Standard_EXPORT Handle(Expr_GeneralRelation) Simplified() const;
|
||||
|
||||
//! Replaces NamedUnknowns by associated expressions,
|
||||
//! and computes values in <me>.
|
||||
Standard_EXPORT void Simplify();
|
||||
|
||||
//! Returns a copy of <me> having the same unknowns and
|
||||
//! functions.
|
||||
Standard_EXPORT Handle(Expr_GeneralRelation) Copy() const;
|
||||
|
||||
//! returns a string representing <me> in a readable way.
|
||||
Standard_EXPORT TCollection_AsciiString String() const;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(Expr_Different,Expr_SingleRelation)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Expr_Different_HeaderFile
|
@@ -1,71 +0,0 @@
|
||||
-- Created on: 1991-01-14
|
||||
-- Created by: Arnaud BOUZY
|
||||
-- Copyright (c) 1991-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class Division from Expr
|
||||
|
||||
inherits BinaryExpression from Expr
|
||||
|
||||
uses GeneralExpression from Expr,
|
||||
AsciiString from TCollection,
|
||||
Array1OfNamedUnknown from Expr,
|
||||
Array1OfReal from TColStd,
|
||||
NamedUnknown from Expr
|
||||
|
||||
raises NumericError from Standard,
|
||||
NotEvaluable from Expr
|
||||
|
||||
is
|
||||
|
||||
Create(exp1,exp2 : GeneralExpression)
|
||||
---Purpose: Creates the division <exp1>/<exp2>
|
||||
returns Division;
|
||||
|
||||
ShallowSimplified(me)
|
||||
---Purpose: Returns a GeneralExpression after a simplification
|
||||
-- of the arguments of <me>.
|
||||
returns any GeneralExpression
|
||||
raises NumericError;
|
||||
|
||||
Copy(me)
|
||||
---Purpose: Returns a copy of <me> having the same unknowns and functions.
|
||||
returns like me;
|
||||
|
||||
IsIdentical(me; Other : GeneralExpression)
|
||||
---Purpose: Tests if <me> and <Other> define the same expression.
|
||||
-- This method does not include any simplification before
|
||||
-- testing.
|
||||
returns Boolean;
|
||||
|
||||
IsLinear(me)
|
||||
returns Boolean;
|
||||
|
||||
Derivative(me; X : NamedUnknown)
|
||||
---Purpose: Returns the derivative on <X> unknown of <me>.
|
||||
returns any GeneralExpression;
|
||||
|
||||
Evaluate(me; vars : Array1OfNamedUnknown; vals : Array1OfReal)
|
||||
---Purpose: Returns the value of <me> (as a Real) by
|
||||
-- replacement of <vars> by <vals>.
|
||||
-- Raises NotEvaluable if <me> contains NamedUnknown not
|
||||
-- in <vars> or NumericError if result cannot be computed.
|
||||
returns Real
|
||||
raises NotEvaluable,NumericError;
|
||||
|
||||
String(me)
|
||||
---Purpose: returns a string representing <me> in a readable way.
|
||||
returns AsciiString;
|
||||
|
||||
end Division;
|
@@ -14,15 +14,21 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Expr_Division.ixx>
|
||||
|
||||
#include <Expr.hxx>
|
||||
#include <Expr_Difference.hxx>
|
||||
#include <Expr_Division.hxx>
|
||||
#include <Expr_GeneralExpression.hxx>
|
||||
#include <Expr_NamedUnknown.hxx>
|
||||
#include <Expr_NotEvaluable.hxx>
|
||||
#include <Expr_NumericValue.hxx>
|
||||
#include <Expr_Operators.hxx>
|
||||
#include <Expr_Product.hxx>
|
||||
#include <Expr_Square.hxx>
|
||||
#include <Expr_UnaryMinus.hxx>
|
||||
#include <Expr_Difference.hxx>
|
||||
#include <Expr_NumericValue.hxx>
|
||||
#include <Expr_Operators.hxx>
|
||||
#include <Expr.hxx>
|
||||
#include <Expr_NamedUnknown.hxx>
|
||||
#include <Standard_NumericError.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
|
||||
Expr_Division::Expr_Division (const Handle(Expr_GeneralExpression)& exp1, const Handle(Expr_GeneralExpression)& exp2)
|
||||
{
|
||||
|
97
src/Expr/Expr_Division.hxx
Normal file
97
src/Expr/Expr_Division.hxx
Normal file
@@ -0,0 +1,97 @@
|
||||
// Created on: 1991-01-14
|
||||
// Created by: Arnaud BOUZY
|
||||
// Copyright (c) 1991-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Expr_Division_HeaderFile
|
||||
#define _Expr_Division_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Expr_BinaryExpression.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Expr_Array1OfNamedUnknown.hxx>
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
class Standard_NumericError;
|
||||
class Expr_NotEvaluable;
|
||||
class Expr_GeneralExpression;
|
||||
class Expr_NamedUnknown;
|
||||
class TCollection_AsciiString;
|
||||
|
||||
|
||||
class Expr_Division;
|
||||
DEFINE_STANDARD_HANDLE(Expr_Division, Expr_BinaryExpression)
|
||||
|
||||
|
||||
class Expr_Division : public Expr_BinaryExpression
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Creates the division <exp1>/<exp2>
|
||||
Standard_EXPORT Expr_Division(const Handle(Expr_GeneralExpression)& exp1, const Handle(Expr_GeneralExpression)& exp2);
|
||||
|
||||
//! Returns a GeneralExpression after a simplification
|
||||
//! of the arguments of <me>.
|
||||
Standard_EXPORT Handle(Expr_GeneralExpression) ShallowSimplified() const;
|
||||
|
||||
//! Returns a copy of <me> having the same unknowns and functions.
|
||||
Standard_EXPORT Handle(Expr_GeneralExpression) Copy() const;
|
||||
|
||||
//! Tests if <me> and <Other> define the same expression.
|
||||
//! This method does not include any simplification before
|
||||
//! testing.
|
||||
Standard_EXPORT Standard_Boolean IsIdentical (const Handle(Expr_GeneralExpression)& Other) const;
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsLinear() const;
|
||||
|
||||
//! Returns the derivative on <X> unknown of <me>.
|
||||
Standard_EXPORT Handle(Expr_GeneralExpression) Derivative (const Handle(Expr_NamedUnknown)& X) const;
|
||||
|
||||
//! Returns the value of <me> (as a Real) by
|
||||
//! replacement of <vars> by <vals>.
|
||||
//! Raises NotEvaluable if <me> contains NamedUnknown not
|
||||
//! in <vars> or NumericError if result cannot be computed.
|
||||
Standard_EXPORT Standard_Real Evaluate (const Expr_Array1OfNamedUnknown& vars, const TColStd_Array1OfReal& vals) const;
|
||||
|
||||
//! returns a string representing <me> in a readable way.
|
||||
Standard_EXPORT TCollection_AsciiString String() const;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(Expr_Division,Expr_BinaryExpression)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Expr_Division_HeaderFile
|
@@ -1,56 +0,0 @@
|
||||
-- Created on: 1991-01-14
|
||||
-- Created by: Arnaud BOUZY
|
||||
-- Copyright (c) 1991-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class Equal from Expr
|
||||
|
||||
inherits SingleRelation from Expr
|
||||
|
||||
uses GeneralExpression from Expr,
|
||||
GeneralRelation from Expr,
|
||||
AsciiString from TCollection
|
||||
|
||||
raises NumericError from Standard
|
||||
|
||||
is
|
||||
|
||||
Create(exp1 : GeneralExpression ; exp2 : GeneralExpression)
|
||||
---Purpose: Creates the relation <exp1> = <exp2>.
|
||||
returns Equal;
|
||||
|
||||
IsSatisfied(me)
|
||||
returns Boolean;
|
||||
|
||||
Simplified(me)
|
||||
---Purpose: returns a GeneralRelation after replacement of
|
||||
-- NamedUnknowns by an associated expression and after
|
||||
-- values computation.
|
||||
returns GeneralRelation
|
||||
raises NumericError;
|
||||
|
||||
Simplify(me : mutable)
|
||||
---Purpose: Replaces NamedUnknowns by an associated expressions
|
||||
-- and computes values in <me>.
|
||||
raises NumericError;
|
||||
|
||||
Copy(me)
|
||||
---Purpose: Returns a copy of <me> having the same unknowns and functions.
|
||||
returns like me;
|
||||
|
||||
String(me)
|
||||
---Purpose: returns a string representing <me> in a readable way.
|
||||
returns AsciiString;
|
||||
|
||||
end Equal;
|
@@ -14,9 +14,14 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Expr_Equal.ixx>
|
||||
|
||||
#include <Expr.hxx>
|
||||
#include <Expr_Equal.hxx>
|
||||
#include <Expr_GeneralExpression.hxx>
|
||||
#include <Expr_GeneralRelation.hxx>
|
||||
#include <Standard_NumericError.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
|
||||
Expr_Equal::Expr_Equal (const Handle(Expr_GeneralExpression)& exp1, const Handle(Expr_GeneralExpression)& exp2)
|
||||
{
|
||||
|
84
src/Expr/Expr_Equal.hxx
Normal file
84
src/Expr/Expr_Equal.hxx
Normal file
@@ -0,0 +1,84 @@
|
||||
// Created on: 1991-01-14
|
||||
// Created by: Arnaud BOUZY
|
||||
// Copyright (c) 1991-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Expr_Equal_HeaderFile
|
||||
#define _Expr_Equal_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Expr_SingleRelation.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
class Standard_NumericError;
|
||||
class Expr_GeneralExpression;
|
||||
class Expr_GeneralRelation;
|
||||
class TCollection_AsciiString;
|
||||
|
||||
|
||||
class Expr_Equal;
|
||||
DEFINE_STANDARD_HANDLE(Expr_Equal, Expr_SingleRelation)
|
||||
|
||||
|
||||
class Expr_Equal : public Expr_SingleRelation
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Creates the relation <exp1> = <exp2>.
|
||||
Standard_EXPORT Expr_Equal(const Handle(Expr_GeneralExpression)& exp1, const Handle(Expr_GeneralExpression)& exp2);
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsSatisfied() const;
|
||||
|
||||
//! returns a GeneralRelation after replacement of
|
||||
//! NamedUnknowns by an associated expression and after
|
||||
//! values computation.
|
||||
Standard_EXPORT Handle(Expr_GeneralRelation) Simplified() const;
|
||||
|
||||
//! Replaces NamedUnknowns by an associated expressions
|
||||
//! and computes values in <me>.
|
||||
Standard_EXPORT void Simplify();
|
||||
|
||||
//! Returns a copy of <me> having the same unknowns and functions.
|
||||
Standard_EXPORT Handle(Expr_GeneralRelation) Copy() const;
|
||||
|
||||
//! returns a string representing <me> in a readable way.
|
||||
Standard_EXPORT TCollection_AsciiString String() const;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(Expr_Equal,Expr_SingleRelation)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Expr_Equal_HeaderFile
|
@@ -1,71 +0,0 @@
|
||||
-- Created on: 1991-01-14
|
||||
-- Created by: Arnaud BOUZY
|
||||
-- Copyright (c) 1991-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class Exponential from Expr
|
||||
|
||||
inherits UnaryExpression from Expr
|
||||
|
||||
uses GeneralExpression from Expr,
|
||||
AsciiString from TCollection,
|
||||
Array1OfNamedUnknown from Expr,
|
||||
Array1OfReal from TColStd,
|
||||
NamedUnknown from Expr
|
||||
|
||||
raises NumericError from Standard,
|
||||
NotEvaluable from Expr
|
||||
|
||||
is
|
||||
|
||||
Create(exp : GeneralExpression)
|
||||
---Purpose: Creates the exponential of <exp>
|
||||
returns Exponential;
|
||||
|
||||
ShallowSimplified(me)
|
||||
---Purpose: Returns a GeneralExpression after a simplification
|
||||
-- of the arguments of <me>.
|
||||
returns any GeneralExpression
|
||||
raises NumericError;
|
||||
|
||||
Copy(me)
|
||||
---Purpose: Returns a copy of <me> having the same unknowns and functions.
|
||||
returns like me;
|
||||
|
||||
IsIdentical(me; Other : GeneralExpression)
|
||||
---Purpose: Tests if <me> and <Other> define the same expression.
|
||||
-- This method does not include any simplification before
|
||||
-- testing.
|
||||
returns Boolean;
|
||||
|
||||
IsLinear(me)
|
||||
returns Boolean;
|
||||
|
||||
Derivative(me; X : NamedUnknown)
|
||||
---Purpose: Returns the derivative on <X> unknown of <me>.
|
||||
returns any GeneralExpression;
|
||||
|
||||
Evaluate(me; vars : Array1OfNamedUnknown; vals : Array1OfReal)
|
||||
---Purpose: Returns the value of <me> (as a Real) by
|
||||
-- replacement of <vars> by <vals>.
|
||||
-- Raises NotEvaluable if <me> contains NamedUnknown not
|
||||
-- in <vars> or NumericError if result cannot be computed.
|
||||
returns Real
|
||||
raises NotEvaluable,NumericError;
|
||||
|
||||
String(me)
|
||||
---Purpose: returns a string representing <me> in a readable way.
|
||||
returns AsciiString;
|
||||
|
||||
end Exponential;
|
@@ -14,12 +14,19 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Expr_Exponential.ixx>
|
||||
#include <Expr_NumericValue.hxx>
|
||||
#include <Expr_LogOfe.hxx>
|
||||
#include <Expr_Product.hxx>
|
||||
#include <Expr_Operators.hxx>
|
||||
|
||||
#include <Expr.hxx>
|
||||
#include <Expr_Exponential.hxx>
|
||||
#include <Expr_GeneralExpression.hxx>
|
||||
#include <Expr_LogOfe.hxx>
|
||||
#include <Expr_NamedUnknown.hxx>
|
||||
#include <Expr_NotEvaluable.hxx>
|
||||
#include <Expr_NumericValue.hxx>
|
||||
#include <Expr_Operators.hxx>
|
||||
#include <Expr_Product.hxx>
|
||||
#include <Standard_NumericError.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
|
||||
Expr_Exponential::Expr_Exponential(const Handle(Expr_GeneralExpression)& exp)
|
||||
{
|
||||
|
97
src/Expr/Expr_Exponential.hxx
Normal file
97
src/Expr/Expr_Exponential.hxx
Normal file
@@ -0,0 +1,97 @@
|
||||
// Created on: 1991-01-14
|
||||
// Created by: Arnaud BOUZY
|
||||
// Copyright (c) 1991-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Expr_Exponential_HeaderFile
|
||||
#define _Expr_Exponential_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Expr_UnaryExpression.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Expr_Array1OfNamedUnknown.hxx>
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
class Standard_NumericError;
|
||||
class Expr_NotEvaluable;
|
||||
class Expr_GeneralExpression;
|
||||
class Expr_NamedUnknown;
|
||||
class TCollection_AsciiString;
|
||||
|
||||
|
||||
class Expr_Exponential;
|
||||
DEFINE_STANDARD_HANDLE(Expr_Exponential, Expr_UnaryExpression)
|
||||
|
||||
|
||||
class Expr_Exponential : public Expr_UnaryExpression
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Creates the exponential of <exp>
|
||||
Standard_EXPORT Expr_Exponential(const Handle(Expr_GeneralExpression)& exp);
|
||||
|
||||
//! Returns a GeneralExpression after a simplification
|
||||
//! of the arguments of <me>.
|
||||
Standard_EXPORT Handle(Expr_GeneralExpression) ShallowSimplified() const;
|
||||
|
||||
//! Returns a copy of <me> having the same unknowns and functions.
|
||||
Standard_EXPORT Handle(Expr_GeneralExpression) Copy() const;
|
||||
|
||||
//! Tests if <me> and <Other> define the same expression.
|
||||
//! This method does not include any simplification before
|
||||
//! testing.
|
||||
Standard_EXPORT Standard_Boolean IsIdentical (const Handle(Expr_GeneralExpression)& Other) const;
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsLinear() const;
|
||||
|
||||
//! Returns the derivative on <X> unknown of <me>.
|
||||
Standard_EXPORT Handle(Expr_GeneralExpression) Derivative (const Handle(Expr_NamedUnknown)& X) const;
|
||||
|
||||
//! Returns the value of <me> (as a Real) by
|
||||
//! replacement of <vars> by <vals>.
|
||||
//! Raises NotEvaluable if <me> contains NamedUnknown not
|
||||
//! in <vars> or NumericError if result cannot be computed.
|
||||
Standard_EXPORT Standard_Real Evaluate (const Expr_Array1OfNamedUnknown& vars, const TColStd_Array1OfReal& vals) const;
|
||||
|
||||
//! returns a string representing <me> in a readable way.
|
||||
Standard_EXPORT TCollection_AsciiString String() const;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(Expr_Exponential,Expr_UnaryExpression)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Expr_Exponential_HeaderFile
|
@@ -1,71 +0,0 @@
|
||||
-- Created on: 1991-01-14
|
||||
-- Created by: Arnaud BOUZY
|
||||
-- Copyright (c) 1991-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class Exponentiate from Expr
|
||||
|
||||
inherits BinaryExpression from Expr
|
||||
|
||||
uses GeneralExpression from Expr,
|
||||
AsciiString from TCollection,
|
||||
Array1OfNamedUnknown from Expr,
|
||||
Array1OfReal from TColStd,
|
||||
NamedUnknown from Expr
|
||||
|
||||
raises NumericError from Standard,
|
||||
NotEvaluable from Expr
|
||||
|
||||
is
|
||||
|
||||
Create(exp1,exp2 : GeneralExpression)
|
||||
---Purpose: Creates the exponential <exp1> ^ <exp2>
|
||||
returns Exponentiate;
|
||||
|
||||
ShallowSimplified(me)
|
||||
---Purpose: Returns a GeneralExpression after a simplification
|
||||
-- of the arguments of <me>.
|
||||
returns any GeneralExpression
|
||||
raises NumericError;
|
||||
|
||||
Copy(me)
|
||||
---Purpose: Returns a copy of <me> having the same unknowns and functions.
|
||||
returns like me;
|
||||
|
||||
IsIdentical(me; Other : GeneralExpression)
|
||||
---Purpose: Tests if <me> and <Other> define the same expression.
|
||||
-- This method does not include any simplification before
|
||||
-- testing.
|
||||
returns Boolean;
|
||||
|
||||
IsLinear(me)
|
||||
returns Boolean;
|
||||
|
||||
Derivative(me; X : NamedUnknown)
|
||||
---Purpose: Returns the derivative on <X> unknown of <me>.
|
||||
returns any GeneralExpression;
|
||||
|
||||
Evaluate(me; vars : Array1OfNamedUnknown; vals : Array1OfReal)
|
||||
---Purpose: Returns the value of <me> (as a Real) by
|
||||
-- replacement of <vars> by <vals>.
|
||||
-- Raises NotEvaluable if <me> contains NamedUnknown not
|
||||
-- in <vars> or NumericError if result cannot be computed.
|
||||
returns Real
|
||||
raises NotEvaluable,NumericError;
|
||||
|
||||
String(me)
|
||||
---Purpose: returns a string representing <me> in a readable way.
|
||||
returns AsciiString;
|
||||
|
||||
end Exponentiate;
|
@@ -14,15 +14,22 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Expr_Exponentiate.ixx>
|
||||
#include <Expr_NumericValue.hxx>
|
||||
#include <Expr_SequenceOfGeneralExpression.hxx>
|
||||
#include <Expr_Difference.hxx>
|
||||
#include <Expr_Product.hxx>
|
||||
#include <Expr_LogOfe.hxx>
|
||||
#include <Expr_Sum.hxx>
|
||||
#include <Expr_Operators.hxx>
|
||||
|
||||
#include <Expr.hxx>
|
||||
#include <Expr_Difference.hxx>
|
||||
#include <Expr_Exponentiate.hxx>
|
||||
#include <Expr_GeneralExpression.hxx>
|
||||
#include <Expr_LogOfe.hxx>
|
||||
#include <Expr_NamedUnknown.hxx>
|
||||
#include <Expr_NotEvaluable.hxx>
|
||||
#include <Expr_NumericValue.hxx>
|
||||
#include <Expr_Operators.hxx>
|
||||
#include <Expr_Product.hxx>
|
||||
#include <Expr_SequenceOfGeneralExpression.hxx>
|
||||
#include <Expr_Sum.hxx>
|
||||
#include <Standard_NumericError.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
|
||||
Expr_Exponentiate::Expr_Exponentiate (const Handle(Expr_GeneralExpression)& exp1, const Handle(Expr_GeneralExpression)& exp2)
|
||||
{
|
||||
|
97
src/Expr/Expr_Exponentiate.hxx
Normal file
97
src/Expr/Expr_Exponentiate.hxx
Normal file
@@ -0,0 +1,97 @@
|
||||
// Created on: 1991-01-14
|
||||
// Created by: Arnaud BOUZY
|
||||
// Copyright (c) 1991-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Expr_Exponentiate_HeaderFile
|
||||
#define _Expr_Exponentiate_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Expr_BinaryExpression.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Expr_Array1OfNamedUnknown.hxx>
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
class Standard_NumericError;
|
||||
class Expr_NotEvaluable;
|
||||
class Expr_GeneralExpression;
|
||||
class Expr_NamedUnknown;
|
||||
class TCollection_AsciiString;
|
||||
|
||||
|
||||
class Expr_Exponentiate;
|
||||
DEFINE_STANDARD_HANDLE(Expr_Exponentiate, Expr_BinaryExpression)
|
||||
|
||||
|
||||
class Expr_Exponentiate : public Expr_BinaryExpression
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Creates the exponential <exp1> ^ <exp2>
|
||||
Standard_EXPORT Expr_Exponentiate(const Handle(Expr_GeneralExpression)& exp1, const Handle(Expr_GeneralExpression)& exp2);
|
||||
|
||||
//! Returns a GeneralExpression after a simplification
|
||||
//! of the arguments of <me>.
|
||||
Standard_EXPORT Handle(Expr_GeneralExpression) ShallowSimplified() const;
|
||||
|
||||
//! Returns a copy of <me> having the same unknowns and functions.
|
||||
Standard_EXPORT Handle(Expr_GeneralExpression) Copy() const;
|
||||
|
||||
//! Tests if <me> and <Other> define the same expression.
|
||||
//! This method does not include any simplification before
|
||||
//! testing.
|
||||
Standard_EXPORT Standard_Boolean IsIdentical (const Handle(Expr_GeneralExpression)& Other) const;
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsLinear() const;
|
||||
|
||||
//! Returns the derivative on <X> unknown of <me>.
|
||||
Standard_EXPORT Handle(Expr_GeneralExpression) Derivative (const Handle(Expr_NamedUnknown)& X) const;
|
||||
|
||||
//! Returns the value of <me> (as a Real) by
|
||||
//! replacement of <vars> by <vals>.
|
||||
//! Raises NotEvaluable if <me> contains NamedUnknown not
|
||||
//! in <vars> or NumericError if result cannot be computed.
|
||||
Standard_EXPORT Standard_Real Evaluate (const Expr_Array1OfNamedUnknown& vars, const TColStd_Array1OfReal& vals) const;
|
||||
|
||||
//! returns a string representing <me> in a readable way.
|
||||
Standard_EXPORT TCollection_AsciiString String() const;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(Expr_Exponentiate,Expr_BinaryExpression)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Expr_Exponentiate_HeaderFile
|
37
src/Expr/Expr_ExprFailure.hxx
Normal file
37
src/Expr/Expr_ExprFailure.hxx
Normal file
@@ -0,0 +1,37 @@
|
||||
// Created on: 1991-01-14
|
||||
// Created by: Arnaud BOUZY
|
||||
// Copyright (c) 1991-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Expr_ExprFailure_HeaderFile
|
||||
#define _Expr_ExprFailure_HeaderFile
|
||||
|
||||
#include <Standard_Type.hxx>
|
||||
#include <Standard_DefineException.hxx>
|
||||
#include <Standard_SStream.hxx>
|
||||
#include <Standard_Failure.hxx>
|
||||
|
||||
class Expr_ExprFailure;
|
||||
DEFINE_STANDARD_HANDLE(Expr_ExprFailure, Standard_Failure)
|
||||
|
||||
#if !defined No_Exception && !defined No_Expr_ExprFailure
|
||||
#define Expr_ExprFailure_Raise_if(CONDITION, MESSAGE) \
|
||||
if (CONDITION) Expr_ExprFailure::Raise(MESSAGE);
|
||||
#else
|
||||
#define Expr_ExprFailure_Raise_if(CONDITION, MESSAGE)
|
||||
#endif
|
||||
|
||||
DEFINE_STANDARD_EXCEPTION(Expr_ExprFailure, Standard_Failure)
|
||||
|
||||
#endif // _Expr_ExprFailure_HeaderFile
|
@@ -1,125 +0,0 @@
|
||||
-- Created on: 1991-01-14
|
||||
-- Created by: Arnaud BOUZY
|
||||
-- Copyright (c) 1991-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class FunctionDerivative from Expr
|
||||
|
||||
inherits GeneralFunction from Expr
|
||||
|
||||
uses NamedUnknown from Expr,
|
||||
GeneralExpression from Expr,
|
||||
Array1OfNamedUnknown from Expr,
|
||||
Array1OfReal from TColStd,
|
||||
AsciiString from TCollection
|
||||
|
||||
raises OutOfRange from Standard,
|
||||
DimensionMismatch from Standard,
|
||||
NumericError from Standard,
|
||||
NotEvaluable from Expr
|
||||
|
||||
is
|
||||
|
||||
Create(func : GeneralFunction; withX : NamedUnknown; deg : Integer)
|
||||
---Purpose: Creates a FunctionDerivative of degree <deg> relative
|
||||
-- to the <withX> variable.
|
||||
-- Raises OutOfRange if <deg> lower or equal to zero.
|
||||
---Level : Advanced
|
||||
returns FunctionDerivative
|
||||
raises OutOfRange;
|
||||
|
||||
NbOfVariables(me)
|
||||
---Purpose: Returns the number of variables of <me>.
|
||||
returns Integer;
|
||||
|
||||
Variable(me; index : Integer)
|
||||
---Purpose: Returns the variable denoted by <index> in <me>.
|
||||
-- Raises OutOfRange if <index> greater than
|
||||
-- NbOfVariables of <me>.
|
||||
returns NamedUnknown
|
||||
raises OutOfRange;
|
||||
|
||||
Evaluate(me; vars : Array1OfNamedUnknown;
|
||||
values : Array1OfReal)
|
||||
---Purpose: Computes the value of <me> 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 <me> with the same form.
|
||||
returns like me;
|
||||
|
||||
Derivative(me; var : NamedUnknown)
|
||||
---Purpose: Returns Derivative of <me> for variable <var>.
|
||||
returns GeneralFunction;
|
||||
|
||||
Derivative(me; var : NamedUnknown; deg : Integer)
|
||||
---Purpose: Returns Derivative of <me> for variable <var> with
|
||||
-- degree <deg>.
|
||||
returns GeneralFunction;
|
||||
|
||||
IsIdentical(me; func : GeneralFunction)
|
||||
---Purpose: Tests if <me> and <func> are similar functions (same
|
||||
-- name and same used expression).
|
||||
returns Boolean;
|
||||
|
||||
IsLinearOnVariable(me; index : Integer)
|
||||
---Purpose: Tests if <me> is linear on variable on range <index>
|
||||
returns Boolean;
|
||||
|
||||
Function(me)
|
||||
---Purpose: Returns the function of which <me> is the derivative.
|
||||
---Level : Internal
|
||||
returns GeneralFunction
|
||||
is static;
|
||||
|
||||
Degree(me)
|
||||
---Purpose: Returns the degree of derivation of <me>.
|
||||
---Level : Internal
|
||||
returns Integer
|
||||
is static;
|
||||
|
||||
DerivVariable(me)
|
||||
---Purpose: Returns the derivation variable of <me>.
|
||||
---Level : Internal
|
||||
returns NamedUnknown
|
||||
is static;
|
||||
|
||||
GetStringName(me)
|
||||
returns AsciiString;
|
||||
|
||||
Expression(me)
|
||||
returns GeneralExpression
|
||||
---Level : Internal
|
||||
is static;
|
||||
|
||||
UpdateExpression(me: mutable);
|
||||
---Level : Internal
|
||||
|
||||
fields
|
||||
|
||||
myFunction : GeneralFunction;
|
||||
myExp : GeneralExpression;
|
||||
myDerivate : NamedUnknown;
|
||||
myDegree : Integer;
|
||||
|
||||
friends
|
||||
|
||||
class NamedFunction from Expr
|
||||
|
||||
end FunctionDerivative;
|
||||
|
||||
|
@@ -14,11 +14,20 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Expr_FunctionDerivative.ixx>
|
||||
#include <Expr_NumericValue.hxx>
|
||||
|
||||
#include <Expr_FunctionDerivative.hxx>
|
||||
#include <Expr_GeneralExpression.hxx>
|
||||
#include <Expr_GeneralFunction.hxx>
|
||||
#include <Expr_NamedFunction.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <Expr_NamedUnknown.hxx>
|
||||
#include <Expr_NotEvaluable.hxx>
|
||||
#include <Expr_NumericValue.hxx>
|
||||
#include <Standard_DimensionMismatch.hxx>
|
||||
#include <Standard_NotImplemented.hxx>
|
||||
#include <Standard_NumericError.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
|
||||
Expr_FunctionDerivative::Expr_FunctionDerivative (const Handle(Expr_GeneralFunction)& func, const Handle(Expr_NamedUnknown)& withX, const Standard_Integer deg)
|
||||
{
|
||||
|
128
src/Expr/Expr_FunctionDerivative.hxx
Normal file
128
src/Expr/Expr_FunctionDerivative.hxx
Normal file
@@ -0,0 +1,128 @@
|
||||
// Created on: 1991-01-14
|
||||
// Created by: Arnaud BOUZY
|
||||
// Copyright (c) 1991-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Expr_FunctionDerivative_HeaderFile
|
||||
#define _Expr_FunctionDerivative_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Expr_GeneralFunction.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Expr_Array1OfNamedUnknown.hxx>
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
class Expr_GeneralFunction;
|
||||
class Expr_GeneralExpression;
|
||||
class Expr_NamedUnknown;
|
||||
class Standard_OutOfRange;
|
||||
class Standard_DimensionMismatch;
|
||||
class Standard_NumericError;
|
||||
class Expr_NotEvaluable;
|
||||
class Expr_NamedFunction;
|
||||
class TCollection_AsciiString;
|
||||
|
||||
|
||||
class Expr_FunctionDerivative;
|
||||
DEFINE_STANDARD_HANDLE(Expr_FunctionDerivative, Expr_GeneralFunction)
|
||||
|
||||
|
||||
class Expr_FunctionDerivative : public Expr_GeneralFunction
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Creates a FunctionDerivative of degree <deg> relative
|
||||
//! to the <withX> variable.
|
||||
//! Raises OutOfRange if <deg> lower or equal to zero.
|
||||
Standard_EXPORT Expr_FunctionDerivative(const Handle(Expr_GeneralFunction)& func, const Handle(Expr_NamedUnknown)& withX, const Standard_Integer deg);
|
||||
|
||||
//! Returns the number of variables of <me>.
|
||||
Standard_EXPORT Standard_Integer NbOfVariables() const;
|
||||
|
||||
//! Returns the variable denoted by <index> in <me>.
|
||||
//! Raises OutOfRange if <index> greater than
|
||||
//! NbOfVariables of <me>.
|
||||
Standard_EXPORT Handle(Expr_NamedUnknown) Variable (const Standard_Integer index) const;
|
||||
|
||||
//! Computes the value of <me> with the given variables.
|
||||
//! Raises DimensionMismatch if Length(vars) is different from
|
||||
//! Length(values).
|
||||
Standard_EXPORT Standard_Real Evaluate (const Expr_Array1OfNamedUnknown& vars, const TColStd_Array1OfReal& values) const;
|
||||
|
||||
//! Returns a copy of <me> with the same form.
|
||||
Standard_EXPORT Handle(Expr_GeneralFunction) Copy() const;
|
||||
|
||||
//! Returns Derivative of <me> for variable <var>.
|
||||
Standard_EXPORT Handle(Expr_GeneralFunction) Derivative (const Handle(Expr_NamedUnknown)& var) const;
|
||||
|
||||
//! Returns Derivative of <me> for variable <var> with
|
||||
//! degree <deg>.
|
||||
Standard_EXPORT Handle(Expr_GeneralFunction) Derivative (const Handle(Expr_NamedUnknown)& var, const Standard_Integer deg) const;
|
||||
|
||||
//! Tests if <me> and <func> are similar functions (same
|
||||
//! name and same used expression).
|
||||
Standard_EXPORT Standard_Boolean IsIdentical (const Handle(Expr_GeneralFunction)& func) const;
|
||||
|
||||
//! Tests if <me> is linear on variable on range <index>
|
||||
Standard_EXPORT Standard_Boolean IsLinearOnVariable (const Standard_Integer index) const;
|
||||
|
||||
//! Returns the function of which <me> is the derivative.
|
||||
Standard_EXPORT Handle(Expr_GeneralFunction) Function() const;
|
||||
|
||||
//! Returns the degree of derivation of <me>.
|
||||
Standard_EXPORT Standard_Integer Degree() const;
|
||||
|
||||
//! Returns the derivation variable of <me>.
|
||||
Standard_EXPORT Handle(Expr_NamedUnknown) DerivVariable() const;
|
||||
|
||||
Standard_EXPORT TCollection_AsciiString GetStringName() const;
|
||||
|
||||
Standard_EXPORT Handle(Expr_GeneralExpression) Expression() const;
|
||||
|
||||
Standard_EXPORT void UpdateExpression();
|
||||
|
||||
|
||||
friend class Expr_NamedFunction;
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(Expr_FunctionDerivative,Expr_GeneralFunction)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Handle(Expr_GeneralFunction) myFunction;
|
||||
Handle(Expr_GeneralExpression) myExp;
|
||||
Handle(Expr_NamedUnknown) myDerivate;
|
||||
Standard_Integer myDegree;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Expr_FunctionDerivative_HeaderFile
|
@@ -1,158 +0,0 @@
|
||||
-- Created on: 1991-01-10
|
||||
-- Created by: Arnaud BOUZY
|
||||
-- Copyright (c) 1991-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
deferred class GeneralExpression from Expr
|
||||
|
||||
inherits TShared from MMgt
|
||||
|
||||
---Purpose: Defines the general purposes of any expression.
|
||||
|
||||
uses NamedUnknown from Expr,
|
||||
Array1OfNamedUnknown from Expr,
|
||||
Array1OfReal from TColStd,
|
||||
AsciiString from TCollection
|
||||
|
||||
raises OutOfRange from Standard,
|
||||
NumericError from Standard,
|
||||
NotEvaluable from Expr,
|
||||
InvalidOperand from Expr
|
||||
|
||||
is
|
||||
|
||||
NbSubExpressions(me)
|
||||
---Purpose: Returns the number of sub-expressions contained
|
||||
-- in <me> ( >= 0)
|
||||
---Level: Internal
|
||||
returns Integer
|
||||
is deferred;
|
||||
|
||||
SubExpression(me; I : Integer)
|
||||
---Purpose: Returns the <I>-th sub-expression of <me>
|
||||
-- raises OutOfRange if <I> > NbSubExpressions(me)
|
||||
---C++: return const &
|
||||
---Level: Internal
|
||||
returns any GeneralExpression
|
||||
raises OutOfRange
|
||||
is deferred;
|
||||
|
||||
Simplified(me)
|
||||
---Purpose: Returns a GeneralExpression after replacement of
|
||||
-- NamedUnknowns by an associated expression and after
|
||||
-- values computation.
|
||||
---Level: Advanced
|
||||
returns any GeneralExpression
|
||||
raises NumericError
|
||||
is deferred;
|
||||
|
||||
ShallowSimplified(me)
|
||||
---Purpose: Returns a GeneralExpression after a simplification
|
||||
-- of the arguments of <me>.
|
||||
---Level: Internal
|
||||
returns any GeneralExpression
|
||||
raises NumericError
|
||||
is deferred;
|
||||
|
||||
Copy(me)
|
||||
---Purpose: Returns a copy of <me> having the same unknowns and
|
||||
-- functions.
|
||||
---Level: Advanced
|
||||
returns like me
|
||||
is deferred;
|
||||
|
||||
ContainsUnknowns(me)
|
||||
---Purpose: Tests if <me> contains NamedUnknowns.
|
||||
---Level: Advanced
|
||||
returns Boolean
|
||||
is deferred;
|
||||
|
||||
Contains(me; exp : GeneralExpression)
|
||||
---Purpose: Tests if <exp> is contained in <me>.
|
||||
---Level: Advanced
|
||||
returns Boolean
|
||||
is deferred;
|
||||
|
||||
IsLinear(me)
|
||||
---Purpose: Tests if <me> is linear on every NamedUnknown it
|
||||
-- contains.
|
||||
---Level: Internal
|
||||
returns Boolean
|
||||
is deferred;
|
||||
|
||||
IsShareable(me)
|
||||
---Purpose: Tests if <me> can be shared by one or more expressions
|
||||
-- or must be copied. This method returns False as a
|
||||
-- default value. To be redefined ( especially for
|
||||
-- NamedUnknown).
|
||||
---Level: Internal
|
||||
returns Boolean is virtual;
|
||||
|
||||
IsIdentical(me; Other : GeneralExpression)
|
||||
---Purpose: Tests if <me> and <Other> define the same expression.
|
||||
-- Warning: This method does not include any simplification before
|
||||
-- testing. It could also be very slow; to be used
|
||||
-- carefully.
|
||||
---Level: Internal
|
||||
returns Boolean
|
||||
is deferred;
|
||||
|
||||
Derivative(me; X : NamedUnknown)
|
||||
---Purpose: Returns the derivative on <X> unknown of <me>
|
||||
---Level: Advanced
|
||||
returns any GeneralExpression
|
||||
is deferred;
|
||||
|
||||
NDerivative(me; X : NamedUnknown; N : Integer)
|
||||
---Purpose: Returns the <N>-th derivative on <X> unknown of <me>.
|
||||
-- Raise OutOfRange if N <= 0
|
||||
---Level: Advanced
|
||||
returns any GeneralExpression
|
||||
raises OutOfRange is virtual;
|
||||
|
||||
Replace(me : mutable ; var : NamedUnknown ; with : GeneralExpression)
|
||||
---Purpose: Replaces all occurences of <var> with copies of <with>
|
||||
-- in <me>. Copies of <with> are made with the Copy() method.
|
||||
-- Raises InvalidOperand if <with> contains <me>.
|
||||
---Level: Internal
|
||||
raises InvalidOperand
|
||||
is deferred;
|
||||
|
||||
Evaluate(me; vars : Array1OfNamedUnknown; vals : Array1OfReal)
|
||||
---Purpose: Returns the value of <me> (as a Real) by
|
||||
-- replacement of <vars> by <vals>.
|
||||
-- Raises NotEvaluable if <me> contains NamedUnknown not
|
||||
-- in <vars> or NumericError if result cannot be computed.
|
||||
---Level: Advanced
|
||||
returns Real
|
||||
raises NotEvaluable,NumericError
|
||||
is deferred;
|
||||
|
||||
EvaluateNumeric(me)
|
||||
---Purpose: Returns the value of <me> (as a Real) by
|
||||
-- replacement of <vars> by <vals>.
|
||||
-- Raises NotEvaluable if <me> contains NamedUnknown not
|
||||
-- in <vars> or NumericError if result cannot be computed.
|
||||
---Level: Internal
|
||||
returns Real
|
||||
raises NotEvaluable,NumericError;
|
||||
|
||||
String(me)
|
||||
---Purpose: returns a string representing <me> in a readable way.
|
||||
---Level: Public
|
||||
returns AsciiString
|
||||
is deferred;
|
||||
|
||||
end GeneralExpression;
|
||||
|
@@ -14,9 +14,15 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Expr_GeneralExpression.ixx>
|
||||
|
||||
#include <Expr_GeneralExpression.hxx>
|
||||
#include <Expr_InvalidOperand.hxx>
|
||||
#include <Expr_NamedUnknown.hxx>
|
||||
#include <Expr_NotEvaluable.hxx>
|
||||
#include <Standard_NumericError.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
|
||||
Standard_Boolean Expr_GeneralExpression::IsShareable() const
|
||||
{
|
||||
|
140
src/Expr/Expr_GeneralExpression.hxx
Normal file
140
src/Expr/Expr_GeneralExpression.hxx
Normal file
@@ -0,0 +1,140 @@
|
||||
// Created on: 1991-01-10
|
||||
// Created by: Arnaud BOUZY
|
||||
// Copyright (c) 1991-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Expr_GeneralExpression_HeaderFile
|
||||
#define _Expr_GeneralExpression_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <MMgt_TShared.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Expr_Array1OfNamedUnknown.hxx>
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
class Standard_OutOfRange;
|
||||
class Standard_NumericError;
|
||||
class Expr_NotEvaluable;
|
||||
class Expr_InvalidOperand;
|
||||
class Expr_NamedUnknown;
|
||||
class TCollection_AsciiString;
|
||||
|
||||
|
||||
class Expr_GeneralExpression;
|
||||
DEFINE_STANDARD_HANDLE(Expr_GeneralExpression, MMgt_TShared)
|
||||
|
||||
//! Defines the general purposes of any expression.
|
||||
class Expr_GeneralExpression : public MMgt_TShared
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Returns the number of sub-expressions contained
|
||||
//! in <me> ( >= 0)
|
||||
Standard_EXPORT virtual Standard_Integer NbSubExpressions() const = 0;
|
||||
|
||||
//! Returns the <I>-th sub-expression of <me>
|
||||
//! raises OutOfRange if <I> > NbSubExpressions(me)
|
||||
Standard_EXPORT virtual const Handle(Expr_GeneralExpression)& SubExpression (const Standard_Integer I) const = 0;
|
||||
|
||||
//! Returns a GeneralExpression after replacement of
|
||||
//! NamedUnknowns by an associated expression and after
|
||||
//! values computation.
|
||||
Standard_EXPORT virtual Handle(Expr_GeneralExpression) Simplified() const = 0;
|
||||
|
||||
//! Returns a GeneralExpression after a simplification
|
||||
//! of the arguments of <me>.
|
||||
Standard_EXPORT virtual Handle(Expr_GeneralExpression) ShallowSimplified() const = 0;
|
||||
|
||||
//! Returns a copy of <me> having the same unknowns and
|
||||
//! functions.
|
||||
Standard_EXPORT virtual Handle(Expr_GeneralExpression) Copy() const = 0;
|
||||
|
||||
//! Tests if <me> contains NamedUnknowns.
|
||||
Standard_EXPORT virtual Standard_Boolean ContainsUnknowns() const = 0;
|
||||
|
||||
//! Tests if <exp> is contained in <me>.
|
||||
Standard_EXPORT virtual Standard_Boolean Contains (const Handle(Expr_GeneralExpression)& exp) const = 0;
|
||||
|
||||
//! Tests if <me> is linear on every NamedUnknown it
|
||||
//! contains.
|
||||
Standard_EXPORT virtual Standard_Boolean IsLinear() const = 0;
|
||||
|
||||
//! Tests if <me> can be shared by one or more expressions
|
||||
//! or must be copied. This method returns False as a
|
||||
//! default value. To be redefined ( especially for
|
||||
//! NamedUnknown).
|
||||
Standard_EXPORT virtual Standard_Boolean IsShareable() const;
|
||||
|
||||
//! Tests if <me> and <Other> define the same expression.
|
||||
//! Warning: This method does not include any simplification before
|
||||
//! testing. It could also be very slow; to be used
|
||||
//! carefully.
|
||||
Standard_EXPORT virtual Standard_Boolean IsIdentical (const Handle(Expr_GeneralExpression)& Other) const = 0;
|
||||
|
||||
//! Returns the derivative on <X> unknown of <me>
|
||||
Standard_EXPORT virtual Handle(Expr_GeneralExpression) Derivative (const Handle(Expr_NamedUnknown)& X) const = 0;
|
||||
|
||||
//! Returns the <N>-th derivative on <X> unknown of <me>.
|
||||
//! Raise OutOfRange if N <= 0
|
||||
Standard_EXPORT virtual Handle(Expr_GeneralExpression) NDerivative (const Handle(Expr_NamedUnknown)& X, const Standard_Integer N) const;
|
||||
|
||||
//! Replaces all occurences of <var> with copies of <with>
|
||||
//! in <me>. Copies of <with> are made with the Copy() method.
|
||||
//! Raises InvalidOperand if <with> contains <me>.
|
||||
Standard_EXPORT virtual void Replace (const Handle(Expr_NamedUnknown)& var, const Handle(Expr_GeneralExpression)& with) = 0;
|
||||
|
||||
//! Returns the value of <me> (as a Real) by
|
||||
//! replacement of <vars> by <vals>.
|
||||
//! Raises NotEvaluable if <me> contains NamedUnknown not
|
||||
//! in <vars> or NumericError if result cannot be computed.
|
||||
Standard_EXPORT virtual Standard_Real Evaluate (const Expr_Array1OfNamedUnknown& vars, const TColStd_Array1OfReal& vals) const = 0;
|
||||
|
||||
//! Returns the value of <me> (as a Real) by
|
||||
//! replacement of <vars> by <vals>.
|
||||
//! Raises NotEvaluable if <me> contains NamedUnknown not
|
||||
//! in <vars> or NumericError if result cannot be computed.
|
||||
Standard_EXPORT Standard_Real EvaluateNumeric() const;
|
||||
|
||||
//! returns a string representing <me> in a readable way.
|
||||
Standard_EXPORT virtual TCollection_AsciiString String() const = 0;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(Expr_GeneralExpression,MMgt_TShared)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Expr_GeneralExpression_HeaderFile
|
@@ -1,98 +0,0 @@
|
||||
-- Created on: 1991-01-14
|
||||
-- Created by: Arnaud BOUZY
|
||||
-- Copyright (c) 1991-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
deferred class GeneralFunction from Expr
|
||||
|
||||
inherits TShared from MMgt
|
||||
|
||||
---Purpose: Defines the general purposes of any function.
|
||||
|
||||
uses NamedUnknown from Expr,
|
||||
GeneralExpression from Expr,
|
||||
Array1OfNamedUnknown from Expr,
|
||||
Array1OfReal from TColStd,
|
||||
AsciiString from TCollection
|
||||
|
||||
raises OutOfRange from Standard,
|
||||
DimensionMismatch from Standard,
|
||||
NumericError from Standard,
|
||||
NotEvaluable from Expr
|
||||
|
||||
is
|
||||
|
||||
|
||||
NbOfVariables(me)
|
||||
---Purpose: Returns the number of variables of <me>.
|
||||
---Level: Advanced
|
||||
returns Integer
|
||||
is deferred;
|
||||
|
||||
Variable(me ; index : Integer)
|
||||
---Purpose: Returns the variable denoted by <index> in <me>.
|
||||
-- Raises OutOfRange if index > NbOfVariables.
|
||||
---Level: Advanced
|
||||
returns NamedUnknown
|
||||
raises OutOfRange
|
||||
is deferred;
|
||||
|
||||
Copy(me)
|
||||
---Purpose: Returns a copy of <me> with the same form.
|
||||
---Level: Advanced
|
||||
returns like me
|
||||
is deferred;
|
||||
|
||||
Derivative(me; var : NamedUnknown)
|
||||
---Purpose: Returns Derivative of <me> for variable <var>.
|
||||
---Level: Advanced
|
||||
returns GeneralFunction
|
||||
is deferred;
|
||||
|
||||
Derivative(me; var : NamedUnknown; deg : Integer)
|
||||
---Purpose: Returns Derivative of <me> for variable <var> with
|
||||
-- degree <deg>.
|
||||
---Level: Advanced
|
||||
returns GeneralFunction
|
||||
is deferred;
|
||||
|
||||
Evaluate(me; vars : Array1OfNamedUnknown;
|
||||
vals : Array1OfReal)
|
||||
---Purpose: Computes the value of <me> with the given variables.
|
||||
-- Raises NotEvaluable if <vars> does not match all variables
|
||||
-- of <me>.
|
||||
---Level: Advanced
|
||||
returns Real
|
||||
raises NotEvaluable,NumericError,DimensionMismatch
|
||||
is deferred;
|
||||
|
||||
IsIdentical(me; func : GeneralFunction)
|
||||
---Purpose: Tests if <me> and <func> are similar functions (same
|
||||
-- name and same used expression).
|
||||
---Level: Internal
|
||||
returns Boolean
|
||||
is deferred;
|
||||
|
||||
IsLinearOnVariable(me; index : Integer)
|
||||
---Purpose: Tests if <me> is linear on variable on range <index>
|
||||
---Level: Internal
|
||||
returns Boolean
|
||||
is deferred;
|
||||
|
||||
GetStringName(me)
|
||||
---Level: Internal
|
||||
returns AsciiString
|
||||
is deferred;
|
||||
|
||||
end GeneralFunction;
|
@@ -14,5 +14,12 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Expr_GeneralFunction.ixx>
|
||||
|
||||
#include <Expr_GeneralFunction.hxx>
|
||||
#include <Expr_NamedUnknown.hxx>
|
||||
#include <Expr_NotEvaluable.hxx>
|
||||
#include <Standard_DimensionMismatch.hxx>
|
||||
#include <Standard_NumericError.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
|
101
src/Expr/Expr_GeneralFunction.hxx
Normal file
101
src/Expr/Expr_GeneralFunction.hxx
Normal file
@@ -0,0 +1,101 @@
|
||||
// Created on: 1991-01-14
|
||||
// Created by: Arnaud BOUZY
|
||||
// Copyright (c) 1991-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Expr_GeneralFunction_HeaderFile
|
||||
#define _Expr_GeneralFunction_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <MMgt_TShared.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Expr_Array1OfNamedUnknown.hxx>
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
class Standard_OutOfRange;
|
||||
class Standard_DimensionMismatch;
|
||||
class Standard_NumericError;
|
||||
class Expr_NotEvaluable;
|
||||
class Expr_NamedUnknown;
|
||||
class TCollection_AsciiString;
|
||||
|
||||
|
||||
class Expr_GeneralFunction;
|
||||
DEFINE_STANDARD_HANDLE(Expr_GeneralFunction, MMgt_TShared)
|
||||
|
||||
//! Defines the general purposes of any function.
|
||||
class Expr_GeneralFunction : public MMgt_TShared
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Returns the number of variables of <me>.
|
||||
Standard_EXPORT virtual Standard_Integer NbOfVariables() const = 0;
|
||||
|
||||
//! Returns the variable denoted by <index> in <me>.
|
||||
//! Raises OutOfRange if index > NbOfVariables.
|
||||
Standard_EXPORT virtual Handle(Expr_NamedUnknown) Variable (const Standard_Integer index) const = 0;
|
||||
|
||||
//! Returns a copy of <me> with the same form.
|
||||
Standard_EXPORT virtual Handle(Expr_GeneralFunction) Copy() const = 0;
|
||||
|
||||
//! Returns Derivative of <me> for variable <var>.
|
||||
Standard_EXPORT virtual Handle(Expr_GeneralFunction) Derivative (const Handle(Expr_NamedUnknown)& var) const = 0;
|
||||
|
||||
//! Returns Derivative of <me> for variable <var> with
|
||||
//! degree <deg>.
|
||||
Standard_EXPORT virtual Handle(Expr_GeneralFunction) Derivative (const Handle(Expr_NamedUnknown)& var, const Standard_Integer deg) const = 0;
|
||||
|
||||
//! Computes the value of <me> with the given variables.
|
||||
//! Raises NotEvaluable if <vars> does not match all variables
|
||||
//! of <me>.
|
||||
Standard_EXPORT virtual Standard_Real Evaluate (const Expr_Array1OfNamedUnknown& vars, const TColStd_Array1OfReal& vals) const = 0;
|
||||
|
||||
//! Tests if <me> and <func> are similar functions (same
|
||||
//! name and same used expression).
|
||||
Standard_EXPORT virtual Standard_Boolean IsIdentical (const Handle(Expr_GeneralFunction)& func) const = 0;
|
||||
|
||||
//! Tests if <me> is linear on variable on range <index>
|
||||
Standard_EXPORT virtual Standard_Boolean IsLinearOnVariable (const Standard_Integer index) const = 0;
|
||||
|
||||
Standard_EXPORT virtual TCollection_AsciiString GetStringName() const = 0;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(Expr_GeneralFunction,MMgt_TShared)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Expr_GeneralFunction_HeaderFile
|
@@ -1,107 +0,0 @@
|
||||
-- Created on: 1991-01-14
|
||||
-- Created by: Arnaud BOUZY
|
||||
-- Copyright (c) 1991-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
deferred class GeneralRelation from Expr
|
||||
|
||||
inherits TShared from MMgt
|
||||
|
||||
---Purpose: Defines the general purposes of any relation between
|
||||
-- expressions.
|
||||
|
||||
uses GeneralExpression from Expr,
|
||||
NamedUnknown from Expr,
|
||||
AsciiString from TCollection
|
||||
|
||||
|
||||
raises OutOfRange from Standard,
|
||||
NumericError from Standard
|
||||
|
||||
is
|
||||
|
||||
IsSatisfied(me)
|
||||
---Purpose: Returns the current status of the relation
|
||||
---Level: Advanced
|
||||
returns Boolean
|
||||
is deferred;
|
||||
|
||||
IsLinear(me)
|
||||
---Purpose: Tests if <me> is linear between its NamedUnknowns.
|
||||
---Level: Advanced
|
||||
returns Boolean
|
||||
is deferred;
|
||||
|
||||
Simplified(me)
|
||||
---Purpose: Returns a GeneralRelation after replacement of
|
||||
-- NamedUnknowns by an associated expression, and after
|
||||
-- values computation.
|
||||
---Level: Advanced
|
||||
returns GeneralRelation
|
||||
raises NumericError
|
||||
is deferred;
|
||||
|
||||
Simplify(me : mutable)
|
||||
---Purpose: Replaces NamedUnknowns by associated expressions,
|
||||
-- and computes values in <me>.
|
||||
---Level: Advanced
|
||||
raises NumericError
|
||||
is deferred;
|
||||
|
||||
Copy(me)
|
||||
---Purpose: Returns a copy of <me> having the same unknowns and
|
||||
-- functions.
|
||||
---Level: Advanced
|
||||
returns like me
|
||||
is deferred;
|
||||
|
||||
NbOfSubRelations(me)
|
||||
---Purpose: Returns the number of relations contained in <me>.
|
||||
---Level: Internal
|
||||
returns Integer
|
||||
is deferred;
|
||||
|
||||
NbOfSingleRelations(me)
|
||||
---Purpose: Returns the number of SingleRelations contained in
|
||||
-- <me>.
|
||||
---Level: Internal
|
||||
returns Integer
|
||||
is deferred;
|
||||
|
||||
SubRelation(me; index : Integer)
|
||||
---Purpose: Returns the relation denoted by <index> in <me>.
|
||||
-- An exception is raised if <index> is out of range.
|
||||
---Level: Internal
|
||||
returns any GeneralRelation
|
||||
raises OutOfRange
|
||||
is deferred;
|
||||
|
||||
Contains(me; exp : GeneralExpression)
|
||||
---Purpose: Tests if <exp> contains <var>.
|
||||
---Level: Internal
|
||||
returns Boolean
|
||||
is deferred;
|
||||
|
||||
Replace(me : mutable ; var : NamedUnknown ; with : GeneralExpression)
|
||||
---Purpose: Replaces all occurences of <var> with <with> in <me>.
|
||||
---Level: Internal
|
||||
is deferred;
|
||||
|
||||
String(me)
|
||||
---Purpose: returns a string representing <me> in a readable way.
|
||||
---Level: Public
|
||||
returns AsciiString
|
||||
is deferred;
|
||||
|
||||
end GeneralRelation;
|
@@ -14,5 +14,11 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Expr_GeneralRelation.ixx>
|
||||
|
||||
#include <Expr_GeneralExpression.hxx>
|
||||
#include <Expr_GeneralRelation.hxx>
|
||||
#include <Expr_NamedUnknown.hxx>
|
||||
#include <Standard_NumericError.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
|
106
src/Expr/Expr_GeneralRelation.hxx
Normal file
106
src/Expr/Expr_GeneralRelation.hxx
Normal file
@@ -0,0 +1,106 @@
|
||||
// Created on: 1991-01-14
|
||||
// Created by: Arnaud BOUZY
|
||||
// Copyright (c) 1991-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Expr_GeneralRelation_HeaderFile
|
||||
#define _Expr_GeneralRelation_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <MMgt_TShared.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
class Standard_OutOfRange;
|
||||
class Standard_NumericError;
|
||||
class Expr_GeneralExpression;
|
||||
class Expr_NamedUnknown;
|
||||
class TCollection_AsciiString;
|
||||
|
||||
|
||||
class Expr_GeneralRelation;
|
||||
DEFINE_STANDARD_HANDLE(Expr_GeneralRelation, MMgt_TShared)
|
||||
|
||||
//! Defines the general purposes of any relation between
|
||||
//! expressions.
|
||||
class Expr_GeneralRelation : public MMgt_TShared
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Returns the current status of the relation
|
||||
Standard_EXPORT virtual Standard_Boolean IsSatisfied() const = 0;
|
||||
|
||||
//! Tests if <me> is linear between its NamedUnknowns.
|
||||
Standard_EXPORT virtual Standard_Boolean IsLinear() const = 0;
|
||||
|
||||
//! Returns a GeneralRelation after replacement of
|
||||
//! NamedUnknowns by an associated expression, and after
|
||||
//! values computation.
|
||||
Standard_EXPORT virtual Handle(Expr_GeneralRelation) Simplified() const = 0;
|
||||
|
||||
//! Replaces NamedUnknowns by associated expressions,
|
||||
//! and computes values in <me>.
|
||||
Standard_EXPORT virtual void Simplify() = 0;
|
||||
|
||||
//! Returns a copy of <me> having the same unknowns and
|
||||
//! functions.
|
||||
Standard_EXPORT virtual Handle(Expr_GeneralRelation) Copy() const = 0;
|
||||
|
||||
//! Returns the number of relations contained in <me>.
|
||||
Standard_EXPORT virtual Standard_Integer NbOfSubRelations() const = 0;
|
||||
|
||||
//! Returns the number of SingleRelations contained in
|
||||
//! <me>.
|
||||
Standard_EXPORT virtual Standard_Integer NbOfSingleRelations() const = 0;
|
||||
|
||||
//! Returns the relation denoted by <index> in <me>.
|
||||
//! An exception is raised if <index> is out of range.
|
||||
Standard_EXPORT virtual Handle(Expr_GeneralRelation) SubRelation (const Standard_Integer index) const = 0;
|
||||
|
||||
//! Tests if <exp> contains <var>.
|
||||
Standard_EXPORT virtual Standard_Boolean Contains (const Handle(Expr_GeneralExpression)& exp) const = 0;
|
||||
|
||||
//! Replaces all occurences of <var> with <with> in <me>.
|
||||
Standard_EXPORT virtual void Replace (const Handle(Expr_NamedUnknown)& var, const Handle(Expr_GeneralExpression)& with) = 0;
|
||||
|
||||
//! returns a string representing <me> in a readable way.
|
||||
Standard_EXPORT virtual TCollection_AsciiString String() const = 0;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(Expr_GeneralRelation,MMgt_TShared)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Expr_GeneralRelation_HeaderFile
|
@@ -1,56 +0,0 @@
|
||||
-- Created on: 1991-01-14
|
||||
-- Created by: Arnaud BOUZY
|
||||
-- Copyright (c) 1991-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class GreaterThan from Expr
|
||||
|
||||
inherits SingleRelation from Expr
|
||||
|
||||
uses GeneralExpression from Expr,
|
||||
GeneralRelation from Expr,
|
||||
AsciiString from TCollection
|
||||
|
||||
raises NumericError from Standard
|
||||
|
||||
is
|
||||
|
||||
Create(exp1 : GeneralExpression ; exp2 : GeneralExpression)
|
||||
---Purpose: Creates the relation <exp1> > <exp2>.
|
||||
returns GreaterThan;
|
||||
|
||||
IsSatisfied(me)
|
||||
returns Boolean;
|
||||
|
||||
Simplified(me)
|
||||
---Purpose: Returns a GeneralRelation after replacement of
|
||||
-- NamedUnknowns by an associated expression, and after
|
||||
-- values computation.
|
||||
returns GeneralRelation
|
||||
raises NumericError;
|
||||
|
||||
Simplify(me : mutable)
|
||||
---Purpose: Replaces NamedUnknowns by associated expressions,
|
||||
-- and computes values in <me>.
|
||||
raises NumericError;
|
||||
|
||||
Copy(me)
|
||||
---Purpose: Returns a copy of <me> having the same unknowns and functions.
|
||||
returns like me;
|
||||
|
||||
String(me)
|
||||
---Purpose: returns a string representing <me> in a readable way.
|
||||
returns AsciiString;
|
||||
|
||||
end GreaterThan;
|
@@ -14,9 +14,15 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Expr_GreaterThan.ixx>
|
||||
#include <Expr_NumericValue.hxx>
|
||||
|
||||
#include <Expr.hxx>
|
||||
#include <Expr_GeneralExpression.hxx>
|
||||
#include <Expr_GeneralRelation.hxx>
|
||||
#include <Expr_GreaterThan.hxx>
|
||||
#include <Expr_NumericValue.hxx>
|
||||
#include <Standard_NumericError.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
|
||||
Expr_GreaterThan::Expr_GreaterThan (const Handle(Expr_GeneralExpression)& exp1, const Handle(Expr_GeneralExpression)& exp2)
|
||||
{
|
||||
|
84
src/Expr/Expr_GreaterThan.hxx
Normal file
84
src/Expr/Expr_GreaterThan.hxx
Normal file
@@ -0,0 +1,84 @@
|
||||
// Created on: 1991-01-14
|
||||
// Created by: Arnaud BOUZY
|
||||
// Copyright (c) 1991-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Expr_GreaterThan_HeaderFile
|
||||
#define _Expr_GreaterThan_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Expr_SingleRelation.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
class Standard_NumericError;
|
||||
class Expr_GeneralExpression;
|
||||
class Expr_GeneralRelation;
|
||||
class TCollection_AsciiString;
|
||||
|
||||
|
||||
class Expr_GreaterThan;
|
||||
DEFINE_STANDARD_HANDLE(Expr_GreaterThan, Expr_SingleRelation)
|
||||
|
||||
|
||||
class Expr_GreaterThan : public Expr_SingleRelation
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Creates the relation <exp1> > <exp2>.
|
||||
Standard_EXPORT Expr_GreaterThan(const Handle(Expr_GeneralExpression)& exp1, const Handle(Expr_GeneralExpression)& exp2);
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsSatisfied() const;
|
||||
|
||||
//! Returns a GeneralRelation after replacement of
|
||||
//! NamedUnknowns by an associated expression, and after
|
||||
//! values computation.
|
||||
Standard_EXPORT Handle(Expr_GeneralRelation) Simplified() const;
|
||||
|
||||
//! Replaces NamedUnknowns by associated expressions,
|
||||
//! and computes values in <me>.
|
||||
Standard_EXPORT void Simplify();
|
||||
|
||||
//! Returns a copy of <me> having the same unknowns and functions.
|
||||
Standard_EXPORT Handle(Expr_GeneralRelation) Copy() const;
|
||||
|
||||
//! returns a string representing <me> in a readable way.
|
||||
Standard_EXPORT TCollection_AsciiString String() const;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(Expr_GreaterThan,Expr_SingleRelation)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Expr_GreaterThan_HeaderFile
|
@@ -1,56 +0,0 @@
|
||||
-- Created on: 1991-01-30
|
||||
-- Created by: Arnaud BOUZY
|
||||
-- Copyright (c) 1991-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class GreaterThanOrEqual from Expr
|
||||
|
||||
inherits SingleRelation from Expr
|
||||
|
||||
uses GeneralExpression from Expr,
|
||||
GeneralRelation from Expr,
|
||||
AsciiString from TCollection
|
||||
|
||||
raises NumericError from Standard
|
||||
|
||||
is
|
||||
|
||||
Create(exp1 : GeneralExpression ; exp2 : GeneralExpression)
|
||||
---Purpose: Creates the relation <exp1> >= <exp2>.
|
||||
returns GreaterThanOrEqual;
|
||||
|
||||
IsSatisfied(me)
|
||||
returns Boolean;
|
||||
|
||||
Simplified(me)
|
||||
---Purpose: Returns a GeneralRelation after replacement of
|
||||
-- NamedUnknowns by an associated expression, and after
|
||||
-- values computation.
|
||||
returns GeneralRelation
|
||||
raises NumericError;
|
||||
|
||||
Simplify(me : mutable)
|
||||
---Purpose: Replaces NamedUnknowns by associated expressions,
|
||||
-- and computes values in <me>.
|
||||
raises NumericError;
|
||||
|
||||
Copy(me)
|
||||
---Purpose: Returns a copy of <me> having the same unknowns and functions.
|
||||
returns like me;
|
||||
|
||||
String(me)
|
||||
---Purpose: returns a string representing <me> in a readable way.
|
||||
returns AsciiString;
|
||||
|
||||
end GreaterThanOrEqual;
|
@@ -14,9 +14,15 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Expr_GreaterThanOrEqual.ixx>
|
||||
#include <Expr_NumericValue.hxx>
|
||||
|
||||
#include <Expr.hxx>
|
||||
#include <Expr_GeneralExpression.hxx>
|
||||
#include <Expr_GeneralRelation.hxx>
|
||||
#include <Expr_GreaterThanOrEqual.hxx>
|
||||
#include <Expr_NumericValue.hxx>
|
||||
#include <Standard_NumericError.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
|
||||
Expr_GreaterThanOrEqual::Expr_GreaterThanOrEqual (const Handle(Expr_GeneralExpression)& exp1, const Handle(Expr_GeneralExpression)& exp2)
|
||||
{
|
||||
|
84
src/Expr/Expr_GreaterThanOrEqual.hxx
Normal file
84
src/Expr/Expr_GreaterThanOrEqual.hxx
Normal file
@@ -0,0 +1,84 @@
|
||||
// Created on: 1991-01-30
|
||||
// Created by: Arnaud BOUZY
|
||||
// Copyright (c) 1991-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Expr_GreaterThanOrEqual_HeaderFile
|
||||
#define _Expr_GreaterThanOrEqual_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Expr_SingleRelation.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
class Standard_NumericError;
|
||||
class Expr_GeneralExpression;
|
||||
class Expr_GeneralRelation;
|
||||
class TCollection_AsciiString;
|
||||
|
||||
|
||||
class Expr_GreaterThanOrEqual;
|
||||
DEFINE_STANDARD_HANDLE(Expr_GreaterThanOrEqual, Expr_SingleRelation)
|
||||
|
||||
|
||||
class Expr_GreaterThanOrEqual : public Expr_SingleRelation
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Creates the relation <exp1> >= <exp2>.
|
||||
Standard_EXPORT Expr_GreaterThanOrEqual(const Handle(Expr_GeneralExpression)& exp1, const Handle(Expr_GeneralExpression)& exp2);
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsSatisfied() const;
|
||||
|
||||
//! Returns a GeneralRelation after replacement of
|
||||
//! NamedUnknowns by an associated expression, and after
|
||||
//! values computation.
|
||||
Standard_EXPORT Handle(Expr_GeneralRelation) Simplified() const;
|
||||
|
||||
//! Replaces NamedUnknowns by associated expressions,
|
||||
//! and computes values in <me>.
|
||||
Standard_EXPORT void Simplify();
|
||||
|
||||
//! Returns a copy of <me> having the same unknowns and functions.
|
||||
Standard_EXPORT Handle(Expr_GeneralRelation) Copy() const;
|
||||
|
||||
//! returns a string representing <me> in a readable way.
|
||||
Standard_EXPORT TCollection_AsciiString String() const;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(Expr_GreaterThanOrEqual,Expr_SingleRelation)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Expr_GreaterThanOrEqual_HeaderFile
|
37
src/Expr/Expr_InvalidAssignment.hxx
Normal file
37
src/Expr/Expr_InvalidAssignment.hxx
Normal file
@@ -0,0 +1,37 @@
|
||||
// Created on: 1991-01-14
|
||||
// Created by: Arnaud BOUZY
|
||||
// Copyright (c) 1991-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Expr_InvalidAssignment_HeaderFile
|
||||
#define _Expr_InvalidAssignment_HeaderFile
|
||||
|
||||
#include <Standard_Type.hxx>
|
||||
#include <Standard_DefineException.hxx>
|
||||
#include <Standard_SStream.hxx>
|
||||
#include <Expr_ExprFailure.hxx>
|
||||
|
||||
class Expr_InvalidAssignment;
|
||||
DEFINE_STANDARD_HANDLE(Expr_InvalidAssignment, Expr_ExprFailure)
|
||||
|
||||
#if !defined No_Exception && !defined No_Expr_InvalidAssignment
|
||||
#define Expr_InvalidAssignment_Raise_if(CONDITION, MESSAGE) \
|
||||
if (CONDITION) Expr_InvalidAssignment::Raise(MESSAGE);
|
||||
#else
|
||||
#define Expr_InvalidAssignment_Raise_if(CONDITION, MESSAGE)
|
||||
#endif
|
||||
|
||||
DEFINE_STANDARD_EXCEPTION(Expr_InvalidAssignment, Expr_ExprFailure)
|
||||
|
||||
#endif // _Expr_InvalidAssignment_HeaderFile
|
37
src/Expr/Expr_InvalidFunction.hxx
Normal file
37
src/Expr/Expr_InvalidFunction.hxx
Normal file
@@ -0,0 +1,37 @@
|
||||
// Created on: 1991-01-14
|
||||
// Created by: Arnaud BOUZY
|
||||
// Copyright (c) 1991-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Expr_InvalidFunction_HeaderFile
|
||||
#define _Expr_InvalidFunction_HeaderFile
|
||||
|
||||
#include <Standard_Type.hxx>
|
||||
#include <Standard_DefineException.hxx>
|
||||
#include <Standard_SStream.hxx>
|
||||
#include <Expr_ExprFailure.hxx>
|
||||
|
||||
class Expr_InvalidFunction;
|
||||
DEFINE_STANDARD_HANDLE(Expr_InvalidFunction, Expr_ExprFailure)
|
||||
|
||||
#if !defined No_Exception && !defined No_Expr_InvalidFunction
|
||||
#define Expr_InvalidFunction_Raise_if(CONDITION, MESSAGE) \
|
||||
if (CONDITION) Expr_InvalidFunction::Raise(MESSAGE);
|
||||
#else
|
||||
#define Expr_InvalidFunction_Raise_if(CONDITION, MESSAGE)
|
||||
#endif
|
||||
|
||||
DEFINE_STANDARD_EXCEPTION(Expr_InvalidFunction, Expr_ExprFailure)
|
||||
|
||||
#endif // _Expr_InvalidFunction_HeaderFile
|
37
src/Expr/Expr_InvalidOperand.hxx
Normal file
37
src/Expr/Expr_InvalidOperand.hxx
Normal file
@@ -0,0 +1,37 @@
|
||||
// Created on: 1991-01-14
|
||||
// Created by: Arnaud BOUZY
|
||||
// Copyright (c) 1991-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Expr_InvalidOperand_HeaderFile
|
||||
#define _Expr_InvalidOperand_HeaderFile
|
||||
|
||||
#include <Standard_Type.hxx>
|
||||
#include <Standard_DefineException.hxx>
|
||||
#include <Standard_SStream.hxx>
|
||||
#include <Expr_ExprFailure.hxx>
|
||||
|
||||
class Expr_InvalidOperand;
|
||||
DEFINE_STANDARD_HANDLE(Expr_InvalidOperand, Expr_ExprFailure)
|
||||
|
||||
#if !defined No_Exception && !defined No_Expr_InvalidOperand
|
||||
#define Expr_InvalidOperand_Raise_if(CONDITION, MESSAGE) \
|
||||
if (CONDITION) Expr_InvalidOperand::Raise(MESSAGE);
|
||||
#else
|
||||
#define Expr_InvalidOperand_Raise_if(CONDITION, MESSAGE)
|
||||
#endif
|
||||
|
||||
DEFINE_STANDARD_EXCEPTION(Expr_InvalidOperand, Expr_ExprFailure)
|
||||
|
||||
#endif // _Expr_InvalidOperand_HeaderFile
|
@@ -1,56 +0,0 @@
|
||||
-- Created on: 1991-01-30
|
||||
-- Created by: Arnaud BOUZY
|
||||
-- Copyright (c) 1991-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class LessThan from Expr
|
||||
|
||||
inherits SingleRelation from Expr
|
||||
|
||||
uses GeneralExpression from Expr,
|
||||
GeneralRelation from Expr,
|
||||
AsciiString from TCollection
|
||||
|
||||
raises NumericError from Standard
|
||||
|
||||
is
|
||||
|
||||
Create(exp1 : GeneralExpression ; exp2 : GeneralExpression)
|
||||
---Purpose: Creates the relation <exp1> < <exp2>.
|
||||
returns LessThan;
|
||||
|
||||
IsSatisfied(me)
|
||||
returns Boolean;
|
||||
|
||||
Simplified(me)
|
||||
---Purpose: Returns a GeneralRelation after replacement of
|
||||
-- NamedUnknowns by an associated expression, and after
|
||||
-- values computation.
|
||||
returns GeneralRelation
|
||||
raises NumericError;
|
||||
|
||||
Simplify(me : mutable)
|
||||
---Purpose: Replaces NamedUnknowns by associated expressions,
|
||||
-- and computes values in <me>.
|
||||
raises NumericError;
|
||||
|
||||
Copy(me)
|
||||
---Purpose: Returns a copy of <me> having the same unknowns and functions.
|
||||
returns like me;
|
||||
|
||||
String(me)
|
||||
---Purpose: returns a string representing <me> in a readable way.
|
||||
returns AsciiString;
|
||||
|
||||
end LessThan;
|
@@ -14,9 +14,15 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Expr_LessThan.ixx>
|
||||
#include <Expr_NumericValue.hxx>
|
||||
|
||||
#include <Expr.hxx>
|
||||
#include <Expr_GeneralExpression.hxx>
|
||||
#include <Expr_GeneralRelation.hxx>
|
||||
#include <Expr_LessThan.hxx>
|
||||
#include <Expr_NumericValue.hxx>
|
||||
#include <Standard_NumericError.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
|
||||
Expr_LessThan::Expr_LessThan (const Handle(Expr_GeneralExpression)& exp1, const Handle(Expr_GeneralExpression)& exp2)
|
||||
{
|
||||
|
84
src/Expr/Expr_LessThan.hxx
Normal file
84
src/Expr/Expr_LessThan.hxx
Normal file
@@ -0,0 +1,84 @@
|
||||
// Created on: 1991-01-30
|
||||
// Created by: Arnaud BOUZY
|
||||
// Copyright (c) 1991-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Expr_LessThan_HeaderFile
|
||||
#define _Expr_LessThan_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Expr_SingleRelation.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
class Standard_NumericError;
|
||||
class Expr_GeneralExpression;
|
||||
class Expr_GeneralRelation;
|
||||
class TCollection_AsciiString;
|
||||
|
||||
|
||||
class Expr_LessThan;
|
||||
DEFINE_STANDARD_HANDLE(Expr_LessThan, Expr_SingleRelation)
|
||||
|
||||
|
||||
class Expr_LessThan : public Expr_SingleRelation
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Creates the relation <exp1> < <exp2>.
|
||||
Standard_EXPORT Expr_LessThan(const Handle(Expr_GeneralExpression)& exp1, const Handle(Expr_GeneralExpression)& exp2);
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsSatisfied() const;
|
||||
|
||||
//! Returns a GeneralRelation after replacement of
|
||||
//! NamedUnknowns by an associated expression, and after
|
||||
//! values computation.
|
||||
Standard_EXPORT Handle(Expr_GeneralRelation) Simplified() const;
|
||||
|
||||
//! Replaces NamedUnknowns by associated expressions,
|
||||
//! and computes values in <me>.
|
||||
Standard_EXPORT void Simplify();
|
||||
|
||||
//! Returns a copy of <me> having the same unknowns and functions.
|
||||
Standard_EXPORT Handle(Expr_GeneralRelation) Copy() const;
|
||||
|
||||
//! returns a string representing <me> in a readable way.
|
||||
Standard_EXPORT TCollection_AsciiString String() const;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(Expr_LessThan,Expr_SingleRelation)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Expr_LessThan_HeaderFile
|
@@ -1,56 +0,0 @@
|
||||
-- Created on: 1991-01-14
|
||||
-- Created by: Arnaud BOUZY
|
||||
-- Copyright (c) 1991-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class LessThanOrEqual from Expr
|
||||
|
||||
inherits SingleRelation from Expr
|
||||
|
||||
uses GeneralExpression from Expr,
|
||||
GeneralRelation from Expr,
|
||||
AsciiString from TCollection
|
||||
|
||||
raises NumericError from Standard
|
||||
|
||||
is
|
||||
|
||||
Create(exp1 : GeneralExpression ; exp2 : GeneralExpression)
|
||||
---Purpose: Creates the relation <exp1> <= <exp2>.
|
||||
returns LessThanOrEqual;
|
||||
|
||||
IsSatisfied(me)
|
||||
returns Boolean;
|
||||
|
||||
Simplified(me)
|
||||
---Purpose: Returns a GeneralRelation after replacement of
|
||||
-- NamedUnknowns by an associated expression, and after
|
||||
-- values computation.
|
||||
returns GeneralRelation
|
||||
raises NumericError;
|
||||
|
||||
Simplify(me : mutable)
|
||||
---Purpose: Replaces NamedUnknowns by associated expressions,
|
||||
-- and computes values in <me>.
|
||||
raises NumericError;
|
||||
|
||||
Copy(me)
|
||||
---Purpose: Returns a copy of <me> having the same unknowns and functions.
|
||||
returns like me;
|
||||
|
||||
String(me)
|
||||
---Purpose: returns a string representing <me> in a readable way.
|
||||
returns AsciiString;
|
||||
|
||||
end LessThanOrEqual;
|
@@ -14,9 +14,15 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Expr_LessThanOrEqual.ixx>
|
||||
#include <Expr_NumericValue.hxx>
|
||||
|
||||
#include <Expr.hxx>
|
||||
#include <Expr_GeneralExpression.hxx>
|
||||
#include <Expr_GeneralRelation.hxx>
|
||||
#include <Expr_LessThanOrEqual.hxx>
|
||||
#include <Expr_NumericValue.hxx>
|
||||
#include <Standard_NumericError.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
|
||||
Expr_LessThanOrEqual::Expr_LessThanOrEqual (const Handle(Expr_GeneralExpression)& exp1, const Handle(Expr_GeneralExpression)& exp2)
|
||||
{
|
||||
|
84
src/Expr/Expr_LessThanOrEqual.hxx
Normal file
84
src/Expr/Expr_LessThanOrEqual.hxx
Normal file
@@ -0,0 +1,84 @@
|
||||
// Created on: 1991-01-14
|
||||
// Created by: Arnaud BOUZY
|
||||
// Copyright (c) 1991-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Expr_LessThanOrEqual_HeaderFile
|
||||
#define _Expr_LessThanOrEqual_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Expr_SingleRelation.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
class Standard_NumericError;
|
||||
class Expr_GeneralExpression;
|
||||
class Expr_GeneralRelation;
|
||||
class TCollection_AsciiString;
|
||||
|
||||
|
||||
class Expr_LessThanOrEqual;
|
||||
DEFINE_STANDARD_HANDLE(Expr_LessThanOrEqual, Expr_SingleRelation)
|
||||
|
||||
|
||||
class Expr_LessThanOrEqual : public Expr_SingleRelation
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Creates the relation <exp1> <= <exp2>.
|
||||
Standard_EXPORT Expr_LessThanOrEqual(const Handle(Expr_GeneralExpression)& exp1, const Handle(Expr_GeneralExpression)& exp2);
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsSatisfied() const;
|
||||
|
||||
//! Returns a GeneralRelation after replacement of
|
||||
//! NamedUnknowns by an associated expression, and after
|
||||
//! values computation.
|
||||
Standard_EXPORT Handle(Expr_GeneralRelation) Simplified() const;
|
||||
|
||||
//! Replaces NamedUnknowns by associated expressions,
|
||||
//! and computes values in <me>.
|
||||
Standard_EXPORT void Simplify();
|
||||
|
||||
//! Returns a copy of <me> having the same unknowns and functions.
|
||||
Standard_EXPORT Handle(Expr_GeneralRelation) Copy() const;
|
||||
|
||||
//! returns a string representing <me> in a readable way.
|
||||
Standard_EXPORT TCollection_AsciiString String() const;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(Expr_LessThanOrEqual,Expr_SingleRelation)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Expr_LessThanOrEqual_HeaderFile
|
@@ -1,71 +0,0 @@
|
||||
-- Created on: 1991-01-14
|
||||
-- Created by: Arnaud BOUZY
|
||||
-- Copyright (c) 1991-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class LogOf10 from Expr
|
||||
|
||||
inherits UnaryExpression from Expr
|
||||
|
||||
uses GeneralExpression from Expr,
|
||||
AsciiString from TCollection,
|
||||
Array1OfNamedUnknown from Expr,
|
||||
Array1OfReal from TColStd,
|
||||
NamedUnknown from Expr
|
||||
|
||||
raises NumericError from Standard,
|
||||
NotEvaluable from Expr
|
||||
|
||||
is
|
||||
|
||||
Create(exp : GeneralExpression)
|
||||
---Purpose: Creates the base 10 logarithm of <exp>
|
||||
returns LogOf10;
|
||||
|
||||
ShallowSimplified(me)
|
||||
---Purpose: Returns a GeneralExpression after a simplification
|
||||
-- of the arguments of <me>.
|
||||
returns any GeneralExpression
|
||||
raises NumericError;
|
||||
|
||||
Copy(me)
|
||||
---Purpose: Returns a copy of <me> having the same unknowns and functions.
|
||||
returns like me;
|
||||
|
||||
IsIdentical(me; Other : GeneralExpression)
|
||||
---Purpose: Tests if <me> and <Other> define the same expression.
|
||||
-- This method does not include any simplification before
|
||||
-- testing.
|
||||
returns Boolean;
|
||||
|
||||
IsLinear(me)
|
||||
returns Boolean;
|
||||
|
||||
Derivative(me; X : NamedUnknown)
|
||||
---Purpose: Returns the derivative on <X> unknown of <me>.
|
||||
returns any GeneralExpression;
|
||||
|
||||
Evaluate(me; vars : Array1OfNamedUnknown; vals : Array1OfReal)
|
||||
---Purpose: Returns the value of <me> (as a Real) by
|
||||
-- replacement of <vars> by <vals>.
|
||||
-- Raises NotEvaluable if <me> contains NamedUnknown not
|
||||
-- in <vars> or NumericError if result cannot be computed.
|
||||
returns Real
|
||||
raises NotEvaluable,NumericError;
|
||||
|
||||
String(me)
|
||||
---Purpose: returns a string representing <me> in a readable way.
|
||||
returns AsciiString;
|
||||
|
||||
end LogOf10;
|
@@ -14,12 +14,19 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Expr_LogOf10.ixx>
|
||||
#include <Expr_NumericValue.hxx>
|
||||
#include <Expr_Division.hxx>
|
||||
#include <Expr_Product.hxx>
|
||||
#include <Expr_Operators.hxx>
|
||||
|
||||
#include <Expr.hxx>
|
||||
#include <Expr_Division.hxx>
|
||||
#include <Expr_GeneralExpression.hxx>
|
||||
#include <Expr_LogOf10.hxx>
|
||||
#include <Expr_NamedUnknown.hxx>
|
||||
#include <Expr_NotEvaluable.hxx>
|
||||
#include <Expr_NumericValue.hxx>
|
||||
#include <Expr_Operators.hxx>
|
||||
#include <Expr_Product.hxx>
|
||||
#include <Standard_NumericError.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
|
||||
Expr_LogOf10::Expr_LogOf10(const Handle(Expr_GeneralExpression)& exp)
|
||||
{
|
||||
|
97
src/Expr/Expr_LogOf10.hxx
Normal file
97
src/Expr/Expr_LogOf10.hxx
Normal file
@@ -0,0 +1,97 @@
|
||||
// Created on: 1991-01-14
|
||||
// Created by: Arnaud BOUZY
|
||||
// Copyright (c) 1991-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Expr_LogOf10_HeaderFile
|
||||
#define _Expr_LogOf10_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Expr_UnaryExpression.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Expr_Array1OfNamedUnknown.hxx>
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
class Standard_NumericError;
|
||||
class Expr_NotEvaluable;
|
||||
class Expr_GeneralExpression;
|
||||
class Expr_NamedUnknown;
|
||||
class TCollection_AsciiString;
|
||||
|
||||
|
||||
class Expr_LogOf10;
|
||||
DEFINE_STANDARD_HANDLE(Expr_LogOf10, Expr_UnaryExpression)
|
||||
|
||||
|
||||
class Expr_LogOf10 : public Expr_UnaryExpression
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Creates the base 10 logarithm of <exp>
|
||||
Standard_EXPORT Expr_LogOf10(const Handle(Expr_GeneralExpression)& exp);
|
||||
|
||||
//! Returns a GeneralExpression after a simplification
|
||||
//! of the arguments of <me>.
|
||||
Standard_EXPORT Handle(Expr_GeneralExpression) ShallowSimplified() const;
|
||||
|
||||
//! Returns a copy of <me> having the same unknowns and functions.
|
||||
Standard_EXPORT Handle(Expr_GeneralExpression) Copy() const;
|
||||
|
||||
//! Tests if <me> and <Other> define the same expression.
|
||||
//! This method does not include any simplification before
|
||||
//! testing.
|
||||
Standard_EXPORT Standard_Boolean IsIdentical (const Handle(Expr_GeneralExpression)& Other) const;
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsLinear() const;
|
||||
|
||||
//! Returns the derivative on <X> unknown of <me>.
|
||||
Standard_EXPORT Handle(Expr_GeneralExpression) Derivative (const Handle(Expr_NamedUnknown)& X) const;
|
||||
|
||||
//! Returns the value of <me> (as a Real) by
|
||||
//! replacement of <vars> by <vals>.
|
||||
//! Raises NotEvaluable if <me> contains NamedUnknown not
|
||||
//! in <vars> or NumericError if result cannot be computed.
|
||||
Standard_EXPORT Standard_Real Evaluate (const Expr_Array1OfNamedUnknown& vars, const TColStd_Array1OfReal& vals) const;
|
||||
|
||||
//! returns a string representing <me> in a readable way.
|
||||
Standard_EXPORT TCollection_AsciiString String() const;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(Expr_LogOf10,Expr_UnaryExpression)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Expr_LogOf10_HeaderFile
|
@@ -1,71 +0,0 @@
|
||||
-- Created on: 1991-01-14
|
||||
-- Created by: Arnaud BOUZY
|
||||
-- Copyright (c) 1991-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class LogOfe from Expr
|
||||
|
||||
inherits UnaryExpression from Expr
|
||||
|
||||
uses GeneralExpression from Expr,
|
||||
AsciiString from TCollection,
|
||||
Array1OfNamedUnknown from Expr,
|
||||
Array1OfReal from TColStd,
|
||||
NamedUnknown from Expr
|
||||
|
||||
raises NumericError from Standard,
|
||||
NotEvaluable from Expr
|
||||
|
||||
is
|
||||
|
||||
Create(exp : GeneralExpression)
|
||||
---Purpose: Creates the natural logarithm of <exp>
|
||||
returns LogOfe;
|
||||
|
||||
ShallowSimplified(me)
|
||||
---Purpose: Returns a GeneralExpression after a simplification
|
||||
-- of the arguments of <me>.
|
||||
returns any GeneralExpression
|
||||
raises NumericError;
|
||||
|
||||
Copy(me)
|
||||
---Purpose: Returns a copy of <me> having the same unknowns and functions.
|
||||
returns like me;
|
||||
|
||||
IsIdentical(me; Other : GeneralExpression)
|
||||
---Purpose: Tests if <me> and <Other> define the same expression.
|
||||
-- This method does not include any simplification before
|
||||
-- testing.
|
||||
returns Boolean;
|
||||
|
||||
IsLinear(me)
|
||||
returns Boolean;
|
||||
|
||||
Derivative(me; X : NamedUnknown)
|
||||
---Purpose: Returns the derivative on <X> unknown of <me>.
|
||||
returns any GeneralExpression;
|
||||
|
||||
Evaluate(me; vars : Array1OfNamedUnknown; vals : Array1OfReal)
|
||||
---Purpose: Returns the value of <me> (as a Real) by
|
||||
-- replacement of <vars> by <vals>.
|
||||
-- Raises NotEvaluable if <me> contains NamedUnknown not
|
||||
-- in <vars> or NumericError if result cannot be computed.
|
||||
returns Real
|
||||
raises NotEvaluable,NumericError;
|
||||
|
||||
String(me)
|
||||
---Purpose: returns a string representing <me> in a readable way.
|
||||
returns AsciiString;
|
||||
|
||||
end LogOfe;
|
@@ -14,12 +14,19 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Expr_LogOfe.ixx>
|
||||
#include <Expr_NumericValue.hxx>
|
||||
|
||||
#include <Expr.hxx>
|
||||
#include <Expr_Division.hxx>
|
||||
#include <Expr_Exponential.hxx>
|
||||
#include <Expr_GeneralExpression.hxx>
|
||||
#include <Expr_LogOfe.hxx>
|
||||
#include <Expr_NamedUnknown.hxx>
|
||||
#include <Expr_NotEvaluable.hxx>
|
||||
#include <Expr_NumericValue.hxx>
|
||||
#include <Expr_Operators.hxx>
|
||||
#include <Expr.hxx>
|
||||
#include <Standard_NumericError.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
|
||||
Expr_LogOfe::Expr_LogOfe(const Handle(Expr_GeneralExpression)& exp)
|
||||
{
|
||||
|
97
src/Expr/Expr_LogOfe.hxx
Normal file
97
src/Expr/Expr_LogOfe.hxx
Normal file
@@ -0,0 +1,97 @@
|
||||
// Created on: 1991-01-14
|
||||
// Created by: Arnaud BOUZY
|
||||
// Copyright (c) 1991-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Expr_LogOfe_HeaderFile
|
||||
#define _Expr_LogOfe_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Expr_UnaryExpression.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Expr_Array1OfNamedUnknown.hxx>
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
class Standard_NumericError;
|
||||
class Expr_NotEvaluable;
|
||||
class Expr_GeneralExpression;
|
||||
class Expr_NamedUnknown;
|
||||
class TCollection_AsciiString;
|
||||
|
||||
|
||||
class Expr_LogOfe;
|
||||
DEFINE_STANDARD_HANDLE(Expr_LogOfe, Expr_UnaryExpression)
|
||||
|
||||
|
||||
class Expr_LogOfe : public Expr_UnaryExpression
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Creates the natural logarithm of <exp>
|
||||
Standard_EXPORT Expr_LogOfe(const Handle(Expr_GeneralExpression)& exp);
|
||||
|
||||
//! Returns a GeneralExpression after a simplification
|
||||
//! of the arguments of <me>.
|
||||
Standard_EXPORT Handle(Expr_GeneralExpression) ShallowSimplified() const;
|
||||
|
||||
//! Returns a copy of <me> having the same unknowns and functions.
|
||||
Standard_EXPORT Handle(Expr_GeneralExpression) Copy() const;
|
||||
|
||||
//! Tests if <me> and <Other> define the same expression.
|
||||
//! This method does not include any simplification before
|
||||
//! testing.
|
||||
Standard_EXPORT Standard_Boolean IsIdentical (const Handle(Expr_GeneralExpression)& Other) const;
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsLinear() const;
|
||||
|
||||
//! Returns the derivative on <X> unknown of <me>.
|
||||
Standard_EXPORT Handle(Expr_GeneralExpression) Derivative (const Handle(Expr_NamedUnknown)& X) const;
|
||||
|
||||
//! Returns the value of <me> (as a Real) by
|
||||
//! replacement of <vars> by <vals>.
|
||||
//! Raises NotEvaluable if <me> contains NamedUnknown not
|
||||
//! in <vars> or NumericError if result cannot be computed.
|
||||
Standard_EXPORT Standard_Real Evaluate (const Expr_Array1OfNamedUnknown& vars, const TColStd_Array1OfReal& vals) const;
|
||||
|
||||
//! returns a string representing <me> in a readable way.
|
||||
Standard_EXPORT TCollection_AsciiString String() const;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(Expr_LogOfe,Expr_UnaryExpression)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Expr_LogOfe_HeaderFile
|
@@ -1,109 +0,0 @@
|
||||
-- Created on: 1991-01-10
|
||||
-- Created by: Arnaud BOUZY
|
||||
-- Copyright (c) 1991-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class NamedConstant from Expr
|
||||
|
||||
inherits NamedExpression from Expr
|
||||
|
||||
---Purpose: Describes any numeric constant known by a special name
|
||||
-- (as PI, e,...).
|
||||
|
||||
uses NamedUnknown from Expr,
|
||||
GeneralExpression from Expr,
|
||||
Array1OfNamedUnknown from Expr,
|
||||
Array1OfReal from TColStd,
|
||||
AsciiString from TCollection
|
||||
|
||||
raises OutOfRange from Standard
|
||||
|
||||
is
|
||||
|
||||
Create(name : AsciiString; value : Real)
|
||||
---Purpose: Creates a constant value of name <name> and value <value>.
|
||||
returns NamedConstant;
|
||||
|
||||
GetValue(me)
|
||||
---C++: inline
|
||||
returns Real
|
||||
is static;
|
||||
|
||||
NbSubExpressions(me)
|
||||
---Purpose: returns the number of sub-expressions contained
|
||||
-- in <me> (always returns zero)
|
||||
returns Integer
|
||||
is static;
|
||||
|
||||
SubExpression(me; I : Integer)
|
||||
---Purpose: returns the <I>-th sub-expression of <me>
|
||||
-- raises OutOfRange
|
||||
---C++: return const &
|
||||
returns any GeneralExpression
|
||||
raises OutOfRange
|
||||
is static;
|
||||
|
||||
Simplified(me)
|
||||
---Purpose: returns a GeneralExpression after replacement of
|
||||
-- NamedUnknowns by an associated expression and after
|
||||
-- values computation.
|
||||
returns any GeneralExpression ;
|
||||
|
||||
ShallowSimplified(me)
|
||||
---Purpose: Returns a GeneralExpression after a simplification
|
||||
-- of the arguments of <me>.
|
||||
returns any GeneralExpression;
|
||||
|
||||
Copy(me)
|
||||
---Purpose: Returns a copy of <me> having the same unknowns and functions.
|
||||
returns like me;
|
||||
|
||||
ContainsUnknowns(me)
|
||||
---Purpose: Tests if <me> contains NamedUnknown.
|
||||
-- (returns always False)
|
||||
returns Boolean;
|
||||
|
||||
Contains(me; exp : GeneralExpression)
|
||||
---Purpose: Tests if <exp> is contained in <me>.
|
||||
returns Boolean
|
||||
is static;
|
||||
|
||||
IsLinear(me)
|
||||
returns Boolean
|
||||
is static;
|
||||
|
||||
Derivative(me; X : NamedUnknown)
|
||||
---Purpose: Returns the derivative on <X> unknown of <me>
|
||||
returns any GeneralExpression;
|
||||
|
||||
NDerivative(me; X : NamedUnknown; N : Integer)
|
||||
---Purpose: Returns the <N>-th derivative on <X> unknown of <me>.
|
||||
-- Raises OutOfRange if <N> <= 0
|
||||
returns any GeneralExpression
|
||||
raises OutOfRange
|
||||
is redefined;
|
||||
|
||||
Replace(me : mutable ; var : NamedUnknown ; with : GeneralExpression);
|
||||
---Purpose: Replaces all occurences of <var> with <with> in <me>
|
||||
|
||||
Evaluate(me; vars : Array1OfNamedUnknown; vals : Array1OfReal)
|
||||
---Purpose: Returns the value of <me> (as a Real) by
|
||||
-- replacement of <vars> by <vals>.
|
||||
returns Real;
|
||||
|
||||
fields
|
||||
|
||||
myValue : Real;
|
||||
|
||||
end NamedConstant;
|
@@ -14,9 +14,14 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Expr_NamedConstant.ixx>
|
||||
|
||||
#include <Expr_GeneralExpression.hxx>
|
||||
#include <Expr_NamedConstant.hxx>
|
||||
#include <Expr_NamedUnknown.hxx>
|
||||
#include <Expr_NumericValue.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
|
||||
Expr_NamedConstant::Expr_NamedConstant(const TCollection_AsciiString& name, const Standard_Real value)
|
||||
{
|
||||
|
119
src/Expr/Expr_NamedConstant.hxx
Normal file
119
src/Expr/Expr_NamedConstant.hxx
Normal file
@@ -0,0 +1,119 @@
|
||||
// Created on: 1991-01-10
|
||||
// Created by: Arnaud BOUZY
|
||||
// Copyright (c) 1991-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Expr_NamedConstant_HeaderFile
|
||||
#define _Expr_NamedConstant_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Expr_NamedExpression.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Expr_Array1OfNamedUnknown.hxx>
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
class Standard_OutOfRange;
|
||||
class TCollection_AsciiString;
|
||||
class Expr_GeneralExpression;
|
||||
class Expr_NamedUnknown;
|
||||
|
||||
|
||||
class Expr_NamedConstant;
|
||||
DEFINE_STANDARD_HANDLE(Expr_NamedConstant, Expr_NamedExpression)
|
||||
|
||||
//! Describes any numeric constant known by a special name
|
||||
//! (as PI, e,...).
|
||||
class Expr_NamedConstant : public Expr_NamedExpression
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Creates a constant value of name <name> and value <value>.
|
||||
Standard_EXPORT Expr_NamedConstant(const TCollection_AsciiString& name, const Standard_Real value);
|
||||
|
||||
Standard_Real GetValue() const;
|
||||
|
||||
//! returns the number of sub-expressions contained
|
||||
//! in <me> (always returns zero)
|
||||
Standard_EXPORT Standard_Integer NbSubExpressions() const;
|
||||
|
||||
//! returns the <I>-th sub-expression of <me>
|
||||
//! raises OutOfRange
|
||||
Standard_EXPORT const Handle(Expr_GeneralExpression)& SubExpression (const Standard_Integer I) const;
|
||||
|
||||
//! returns a GeneralExpression after replacement of
|
||||
//! NamedUnknowns by an associated expression and after
|
||||
//! values computation.
|
||||
Standard_EXPORT Handle(Expr_GeneralExpression) Simplified() const;
|
||||
|
||||
//! Returns a GeneralExpression after a simplification
|
||||
//! of the arguments of <me>.
|
||||
Standard_EXPORT Handle(Expr_GeneralExpression) ShallowSimplified() const;
|
||||
|
||||
//! Returns a copy of <me> having the same unknowns and functions.
|
||||
Standard_EXPORT Handle(Expr_GeneralExpression) Copy() const;
|
||||
|
||||
//! Tests if <me> contains NamedUnknown.
|
||||
//! (returns always False)
|
||||
Standard_EXPORT Standard_Boolean ContainsUnknowns() const;
|
||||
|
||||
//! Tests if <exp> is contained in <me>.
|
||||
Standard_EXPORT Standard_Boolean Contains (const Handle(Expr_GeneralExpression)& exp) const;
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsLinear() const;
|
||||
|
||||
//! Returns the derivative on <X> unknown of <me>
|
||||
Standard_EXPORT Handle(Expr_GeneralExpression) Derivative (const Handle(Expr_NamedUnknown)& X) const;
|
||||
|
||||
//! Returns the <N>-th derivative on <X> unknown of <me>.
|
||||
//! Raises OutOfRange if <N> <= 0
|
||||
Standard_EXPORT virtual Handle(Expr_GeneralExpression) NDerivative (const Handle(Expr_NamedUnknown)& X, const Standard_Integer N) const Standard_OVERRIDE;
|
||||
|
||||
//! Replaces all occurences of <var> with <with> in <me>
|
||||
Standard_EXPORT void Replace (const Handle(Expr_NamedUnknown)& var, const Handle(Expr_GeneralExpression)& with);
|
||||
|
||||
//! Returns the value of <me> (as a Real) by
|
||||
//! replacement of <vars> by <vals>.
|
||||
Standard_EXPORT Standard_Real Evaluate (const Expr_Array1OfNamedUnknown& vars, const TColStd_Array1OfReal& vals) const;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(Expr_NamedConstant,Expr_NamedExpression)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Standard_Real myValue;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#include <Expr_NamedConstant.lxx>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Expr_NamedConstant_HeaderFile
|
@@ -1,62 +0,0 @@
|
||||
-- Created on: 1991-01-10
|
||||
-- Created by: Arnaud BOUZY
|
||||
-- Copyright (c) 1991-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
deferred class NamedExpression from Expr
|
||||
|
||||
inherits GeneralExpression from Expr
|
||||
|
||||
---Purpose: Describe an expression used by its name (as constants
|
||||
-- or variables). A single reference is made to a
|
||||
-- NamedExpression in every Expression (i.e. a
|
||||
-- NamedExpression is shared).
|
||||
|
||||
uses AsciiString from TCollection
|
||||
|
||||
|
||||
is
|
||||
|
||||
GetName(me)
|
||||
returns AsciiString
|
||||
---C++: return const &
|
||||
---Level: Advanced
|
||||
is static;
|
||||
|
||||
SetName(me : mutable; name : AsciiString)
|
||||
---Level: Internal
|
||||
is static;
|
||||
|
||||
IsShareable(me)
|
||||
---Purpose: Tests if <me> can be shared by one or more expressions
|
||||
-- or must be copied. This method redefines to a True
|
||||
-- value the GeneralExpression method.
|
||||
returns Boolean
|
||||
is redefined;
|
||||
|
||||
IsIdentical(me; Other : GeneralExpression)
|
||||
---Purpose: Tests if <me> and <Other> define the same expression.
|
||||
-- This method does not include any simplification before
|
||||
-- testing.
|
||||
returns Boolean;
|
||||
|
||||
String(me)
|
||||
---Purpose: returns a string representing <me> in a readable way.
|
||||
returns AsciiString from TCollection;
|
||||
|
||||
fields
|
||||
|
||||
myName : AsciiString;
|
||||
|
||||
end NamedExpression;
|
@@ -14,13 +14,16 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Expr_NamedExpression.ixx>
|
||||
|
||||
#include <Expr_GeneralExpression.hxx>
|
||||
#include <Expr_NamedExpression.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : GetName
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
const TCollection_AsciiString& Expr_NamedExpression::GetName() const
|
||||
{
|
||||
return myName;
|
||||
|
84
src/Expr/Expr_NamedExpression.hxx
Normal file
84
src/Expr/Expr_NamedExpression.hxx
Normal file
@@ -0,0 +1,84 @@
|
||||
// Created on: 1991-01-10
|
||||
// Created by: Arnaud BOUZY
|
||||
// Copyright (c) 1991-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Expr_NamedExpression_HeaderFile
|
||||
#define _Expr_NamedExpression_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
#include <Expr_GeneralExpression.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
class TCollection_AsciiString;
|
||||
class Expr_GeneralExpression;
|
||||
|
||||
|
||||
class Expr_NamedExpression;
|
||||
DEFINE_STANDARD_HANDLE(Expr_NamedExpression, Expr_GeneralExpression)
|
||||
|
||||
//! Describe an expression used by its name (as constants
|
||||
//! or variables). A single reference is made to a
|
||||
//! NamedExpression in every Expression (i.e. a
|
||||
//! NamedExpression is shared).
|
||||
class Expr_NamedExpression : public Expr_GeneralExpression
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
Standard_EXPORT const TCollection_AsciiString& GetName() const;
|
||||
|
||||
Standard_EXPORT void SetName (const TCollection_AsciiString& name);
|
||||
|
||||
//! Tests if <me> can be shared by one or more expressions
|
||||
//! or must be copied. This method redefines to a True
|
||||
//! value the GeneralExpression method.
|
||||
Standard_EXPORT virtual Standard_Boolean IsShareable() const Standard_OVERRIDE;
|
||||
|
||||
//! Tests if <me> and <Other> define the same expression.
|
||||
//! This method does not include any simplification before
|
||||
//! testing.
|
||||
Standard_EXPORT Standard_Boolean IsIdentical (const Handle(Expr_GeneralExpression)& Other) const;
|
||||
|
||||
//! returns a string representing <me> in a readable way.
|
||||
Standard_EXPORT TCollection_AsciiString String() const;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(Expr_NamedExpression,Expr_GeneralExpression)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
TCollection_AsciiString myName;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Expr_NamedExpression_HeaderFile
|
@@ -1,121 +0,0 @@
|
||||
-- Created on: 1991-01-14
|
||||
-- Created by: Arnaud BOUZY
|
||||
-- Copyright (c) 1991-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
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 <vars> with name
|
||||
-- <name> defined by the expression <exp>.
|
||||
---Level : Advanced
|
||||
|
||||
returns NamedFunction;
|
||||
|
||||
SetName(me : mutable; newname : AsciiString)
|
||||
---Purpose: Sets the name <newname> to <me>.
|
||||
---Level : Internal
|
||||
is static;
|
||||
|
||||
GetName(me)
|
||||
---Purpose: Returns the name assigned to <me>
|
||||
---Level : Internal
|
||||
returns AsciiString
|
||||
is static;
|
||||
|
||||
NbOfVariables(me)
|
||||
---Purpose: Returns the number of variables of <me>.
|
||||
returns Integer
|
||||
is static;
|
||||
|
||||
Variable(me ; index : Integer)
|
||||
---Purpose: Returns the variable denoted by <index> in <me>.
|
||||
-- Raises OutOfRange if <index> is greater than
|
||||
-- NbOfVariables of <me>, or less than or equal to zero.
|
||||
returns NamedUnknown
|
||||
raises OutOfRange
|
||||
is static;
|
||||
|
||||
Evaluate(me; vars : Array1OfNamedUnknown;
|
||||
values : Array1OfReal)
|
||||
---Purpose: Computes the value of <me> 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 <me> with the same form.
|
||||
returns like me;
|
||||
|
||||
Derivative(me; var : NamedUnknown)
|
||||
---Purpose: Returns Derivative of <me> for variable <var>.
|
||||
returns GeneralFunction;
|
||||
|
||||
Derivative(me; var : NamedUnknown; deg : Integer)
|
||||
---Purpose: Returns Derivative of <me> for variable <var> with
|
||||
-- degree <deg>.
|
||||
returns GeneralFunction;
|
||||
|
||||
IsIdentical(me; func : GeneralFunction)
|
||||
---Purpose: Tests if <me> and <func> are similar functions (same
|
||||
-- name and same used expression).
|
||||
returns Boolean;
|
||||
|
||||
IsLinearOnVariable(me; index : Integer)
|
||||
---Purpose: Tests if <me> is linear on variable on range <index>
|
||||
returns Boolean;
|
||||
|
||||
GetStringName(me)
|
||||
returns AsciiString from TCollection;
|
||||
|
||||
Expression(me)
|
||||
---Purpose: Returns equivalent expression of <me>.
|
||||
---Level : Internal
|
||||
returns GeneralExpression
|
||||
is static;
|
||||
|
||||
SetExpression(me : mutable; exp : GeneralExpression);
|
||||
---Purpose: Modifies expression of <me>.
|
||||
-- Warning: Beware of derivatives. See FunctionDerivative
|
||||
---Level : Internal
|
||||
|
||||
fields
|
||||
|
||||
myName : AsciiString;
|
||||
myExp : GeneralExpression;
|
||||
myVariables : Array1OfNamedUnknown;
|
||||
|
||||
end NamedFunction;
|
||||
|
||||
|
@@ -14,12 +14,21 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Expr_NamedFunction.ixx>
|
||||
#include <Expr_NamedConstant.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <Expr_FunctionDerivative.hxx>
|
||||
#include <Expr_NumericValue.hxx>
|
||||
|
||||
#include <Expr.hxx>
|
||||
#include <Expr_FunctionDerivative.hxx>
|
||||
#include <Expr_GeneralExpression.hxx>
|
||||
#include <Expr_GeneralFunction.hxx>
|
||||
#include <Expr_NamedConstant.hxx>
|
||||
#include <Expr_NamedFunction.hxx>
|
||||
#include <Expr_NamedUnknown.hxx>
|
||||
#include <Expr_NotEvaluable.hxx>
|
||||
#include <Expr_NumericValue.hxx>
|
||||
#include <Standard_DimensionMismatch.hxx>
|
||||
#include <Standard_NumericError.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
|
||||
Expr_NamedFunction::Expr_NamedFunction (const TCollection_AsciiString& name, const Handle(Expr_GeneralExpression)& exp, const Expr_Array1OfNamedUnknown& vars) :
|
||||
myVariables(vars.Lower(),vars.Upper())
|
||||
|
125
src/Expr/Expr_NamedFunction.hxx
Normal file
125
src/Expr/Expr_NamedFunction.hxx
Normal file
@@ -0,0 +1,125 @@
|
||||
// Created on: 1991-01-14
|
||||
// Created by: Arnaud BOUZY
|
||||
// Copyright (c) 1991-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Expr_NamedFunction_HeaderFile
|
||||
#define _Expr_NamedFunction_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
#include <Expr_Array1OfNamedUnknown.hxx>
|
||||
#include <Expr_GeneralFunction.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
class Expr_GeneralExpression;
|
||||
class Standard_OutOfRange;
|
||||
class Standard_DimensionMismatch;
|
||||
class Standard_NumericError;
|
||||
class Expr_NotEvaluable;
|
||||
class TCollection_AsciiString;
|
||||
class Expr_NamedUnknown;
|
||||
class Expr_GeneralFunction;
|
||||
|
||||
|
||||
class Expr_NamedFunction;
|
||||
DEFINE_STANDARD_HANDLE(Expr_NamedFunction, Expr_GeneralFunction)
|
||||
|
||||
|
||||
class Expr_NamedFunction : public Expr_GeneralFunction
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Creates a function of given variables <vars> with name
|
||||
//! <name> defined by the expression <exp>.
|
||||
Standard_EXPORT Expr_NamedFunction(const TCollection_AsciiString& name, const Handle(Expr_GeneralExpression)& exp, const Expr_Array1OfNamedUnknown& vars);
|
||||
|
||||
//! Sets the name <newname> to <me>.
|
||||
Standard_EXPORT void SetName (const TCollection_AsciiString& newname);
|
||||
|
||||
//! Returns the name assigned to <me>
|
||||
Standard_EXPORT TCollection_AsciiString GetName() const;
|
||||
|
||||
//! Returns the number of variables of <me>.
|
||||
Standard_EXPORT Standard_Integer NbOfVariables() const;
|
||||
|
||||
//! Returns the variable denoted by <index> in <me>.
|
||||
//! Raises OutOfRange if <index> is greater than
|
||||
//! NbOfVariables of <me>, or less than or equal to zero.
|
||||
Standard_EXPORT Handle(Expr_NamedUnknown) Variable (const Standard_Integer index) const;
|
||||
|
||||
//! Computes the value of <me> with the given variables.
|
||||
//! Raises DimensionMismatch if Length(vars) is different from
|
||||
//! Length(values).
|
||||
Standard_EXPORT Standard_Real Evaluate (const Expr_Array1OfNamedUnknown& vars, const TColStd_Array1OfReal& values) const;
|
||||
|
||||
//! Returns a copy of <me> with the same form.
|
||||
Standard_EXPORT Handle(Expr_GeneralFunction) Copy() const;
|
||||
|
||||
//! Returns Derivative of <me> for variable <var>.
|
||||
Standard_EXPORT Handle(Expr_GeneralFunction) Derivative (const Handle(Expr_NamedUnknown)& var) const;
|
||||
|
||||
//! Returns Derivative of <me> for variable <var> with
|
||||
//! degree <deg>.
|
||||
Standard_EXPORT Handle(Expr_GeneralFunction) Derivative (const Handle(Expr_NamedUnknown)& var, const Standard_Integer deg) const;
|
||||
|
||||
//! Tests if <me> and <func> are similar functions (same
|
||||
//! name and same used expression).
|
||||
Standard_EXPORT Standard_Boolean IsIdentical (const Handle(Expr_GeneralFunction)& func) const;
|
||||
|
||||
//! Tests if <me> is linear on variable on range <index>
|
||||
Standard_EXPORT Standard_Boolean IsLinearOnVariable (const Standard_Integer index) const;
|
||||
|
||||
Standard_EXPORT TCollection_AsciiString GetStringName() const;
|
||||
|
||||
//! Returns equivalent expression of <me>.
|
||||
Standard_EXPORT Handle(Expr_GeneralExpression) Expression() const;
|
||||
|
||||
//! Modifies expression of <me>.
|
||||
//! Warning: Beware of derivatives. See FunctionDerivative
|
||||
Standard_EXPORT void SetExpression (const Handle(Expr_GeneralExpression)& exp);
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(Expr_NamedFunction,Expr_GeneralFunction)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
TCollection_AsciiString myName;
|
||||
Handle(Expr_GeneralExpression) myExp;
|
||||
Expr_Array1OfNamedUnknown myVariables;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Expr_NamedFunction_HeaderFile
|
@@ -1,133 +0,0 @@
|
||||
-- Created on: 1991-01-10
|
||||
-- Created by: Arnaud BOUZY
|
||||
-- Copyright (c) 1991-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class NamedUnknown from Expr
|
||||
|
||||
inherits NamedExpression from Expr
|
||||
|
||||
---Purpose: This class describes any variable of an expression.
|
||||
-- Assignment is treated directly in this class.
|
||||
|
||||
uses GeneralExpression from Expr,
|
||||
Array1OfNamedUnknown from Expr,
|
||||
Array1OfReal from TColStd,
|
||||
AsciiString from TCollection
|
||||
|
||||
raises NotAssigned from Expr,
|
||||
OutOfRange from Standard,
|
||||
NumericError from Standard,
|
||||
InvalidAssignment from Expr,
|
||||
InvalidOperand from Expr,
|
||||
NotEvaluable from Expr
|
||||
|
||||
is
|
||||
|
||||
Create(name : AsciiString)
|
||||
returns NamedUnknown;
|
||||
|
||||
IsAssigned(me)
|
||||
---Purpose: Tests if an expression is assigned to <me>.
|
||||
---C++: inline
|
||||
returns Boolean
|
||||
is static;
|
||||
|
||||
AssignedExpression(me)
|
||||
---Purpose: If exists, returns the assigned expression.
|
||||
-- An exception is raised if the expression does not exist.
|
||||
---C++: return const &
|
||||
returns any GeneralExpression
|
||||
raises NotAssigned
|
||||
is static;
|
||||
|
||||
Assign(me : mutable; exp: GeneralExpression)
|
||||
---Purpose: Assigns <me> to <exp> expression.
|
||||
-- Raises exception if <exp> refers to <me>.
|
||||
raises InvalidAssignment
|
||||
is static;
|
||||
|
||||
Deassign(me : mutable)
|
||||
---Purpose: Supresses the assigned expression
|
||||
---C++: inline
|
||||
is static;
|
||||
|
||||
NbSubExpressions(me)
|
||||
---Purpose: Returns the number of sub-expressions contained
|
||||
-- in <me> ( >= 0)
|
||||
returns Integer
|
||||
is static;
|
||||
|
||||
SubExpression(me; I : Integer)
|
||||
---Purpose: Returns the <I>-th sub-expression of <me>
|
||||
-- raises OutOfRange if <I> > NbSubExpressions(me)
|
||||
---C++: return const &
|
||||
returns any GeneralExpression
|
||||
raises OutOfRange
|
||||
is static;
|
||||
|
||||
Simplified(me)
|
||||
---Purpose: Returns a GeneralExpression after replacement of
|
||||
-- NamedUnknowns by an associated expression and after
|
||||
-- values computation.
|
||||
returns any GeneralExpression
|
||||
raises NumericError
|
||||
is static;
|
||||
|
||||
ShallowSimplified(me)
|
||||
---Purpose: Returns a GeneralExpression after a simplification
|
||||
-- of the arguments of <me>.
|
||||
returns any GeneralExpression
|
||||
raises NumericError
|
||||
is static;
|
||||
|
||||
Copy(me)
|
||||
---Purpose: Returns a copy of <me> having the same unknowns and functions.
|
||||
returns like me;
|
||||
|
||||
ContainsUnknowns(me)
|
||||
---Purpose: Tests if <me> contains NamedUnknown.
|
||||
returns Boolean
|
||||
is static;
|
||||
|
||||
Contains(me; exp : GeneralExpression)
|
||||
---Purpose: Tests if <exp> is contained in <me>.
|
||||
returns Boolean
|
||||
is static;
|
||||
|
||||
IsLinear(me)
|
||||
returns Boolean;
|
||||
|
||||
Derivative(me; X : NamedUnknown)
|
||||
---Purpose: Returns the derivative on <X> unknown of <me>
|
||||
returns any GeneralExpression;
|
||||
|
||||
Replace(me : mutable ; var : NamedUnknown ; with : GeneralExpression)
|
||||
---Purpose: Replaces all occurences of <var> with <with> in <me>
|
||||
-- Raises InvalidOperand if <with> contains <me>.
|
||||
raises InvalidOperand;
|
||||
|
||||
Evaluate(me; vars : Array1OfNamedUnknown; vals : Array1OfReal)
|
||||
---Purpose: Returns the value of <me> (as a Real) by
|
||||
-- replacement of <vars> by <vals>.
|
||||
-- Raises NotEvaluable if <me> contains NamedUnknown not
|
||||
-- in <vars> or NumericError if result cannot be computed.
|
||||
returns Real
|
||||
raises NotEvaluable,NumericError;
|
||||
|
||||
fields
|
||||
|
||||
myExpression : GeneralExpression;
|
||||
|
||||
end NamedUnknown;
|
@@ -14,14 +14,19 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Expr_NamedUnknown.ixx>
|
||||
#include <Expr_NumericValue.hxx>
|
||||
|
||||
#include <Expr.hxx>
|
||||
#include <Expr_GeneralExpression.hxx>
|
||||
#include <Expr_InvalidAssignment.hxx>
|
||||
#include <Expr_InvalidOperand.hxx>
|
||||
#include <Expr_NamedUnknown.hxx>
|
||||
#include <Expr_NotAssigned.hxx>
|
||||
#include <Expr_NotEvaluable.hxx>
|
||||
#include <Expr_InvalidOperand.hxx>
|
||||
#include <Expr_InvalidAssignment.hxx>
|
||||
#include <Expr_NumericValue.hxx>
|
||||
#include <Standard_NumericError.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
|
||||
Expr_NamedUnknown::Expr_NamedUnknown(const TCollection_AsciiString& name)
|
||||
{
|
||||
|
132
src/Expr/Expr_NamedUnknown.hxx
Normal file
132
src/Expr/Expr_NamedUnknown.hxx
Normal file
@@ -0,0 +1,132 @@
|
||||
// Created on: 1991-01-10
|
||||
// Created by: Arnaud BOUZY
|
||||
// Copyright (c) 1991-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Expr_NamedUnknown_HeaderFile
|
||||
#define _Expr_NamedUnknown_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Expr_NamedExpression.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Expr_Array1OfNamedUnknown.hxx>
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
class Expr_GeneralExpression;
|
||||
class Expr_NotAssigned;
|
||||
class Standard_OutOfRange;
|
||||
class Standard_NumericError;
|
||||
class Expr_InvalidAssignment;
|
||||
class Expr_InvalidOperand;
|
||||
class Expr_NotEvaluable;
|
||||
class TCollection_AsciiString;
|
||||
|
||||
|
||||
class Expr_NamedUnknown;
|
||||
DEFINE_STANDARD_HANDLE(Expr_NamedUnknown, Expr_NamedExpression)
|
||||
|
||||
//! This class describes any variable of an expression.
|
||||
//! Assignment is treated directly in this class.
|
||||
class Expr_NamedUnknown : public Expr_NamedExpression
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
Standard_EXPORT Expr_NamedUnknown(const TCollection_AsciiString& name);
|
||||
|
||||
//! Tests if an expression is assigned to <me>.
|
||||
Standard_Boolean IsAssigned() const;
|
||||
|
||||
//! If exists, returns the assigned expression.
|
||||
//! An exception is raised if the expression does not exist.
|
||||
Standard_EXPORT const Handle(Expr_GeneralExpression)& AssignedExpression() const;
|
||||
|
||||
//! Assigns <me> to <exp> expression.
|
||||
//! Raises exception if <exp> refers to <me>.
|
||||
Standard_EXPORT void Assign (const Handle(Expr_GeneralExpression)& exp);
|
||||
|
||||
//! Supresses the assigned expression
|
||||
void Deassign();
|
||||
|
||||
//! Returns the number of sub-expressions contained
|
||||
//! in <me> ( >= 0)
|
||||
Standard_EXPORT Standard_Integer NbSubExpressions() const;
|
||||
|
||||
//! Returns the <I>-th sub-expression of <me>
|
||||
//! raises OutOfRange if <I> > NbSubExpressions(me)
|
||||
Standard_EXPORT const Handle(Expr_GeneralExpression)& SubExpression (const Standard_Integer I) const;
|
||||
|
||||
//! Returns a GeneralExpression after replacement of
|
||||
//! NamedUnknowns by an associated expression and after
|
||||
//! values computation.
|
||||
Standard_EXPORT Handle(Expr_GeneralExpression) Simplified() const;
|
||||
|
||||
//! Returns a GeneralExpression after a simplification
|
||||
//! of the arguments of <me>.
|
||||
Standard_EXPORT Handle(Expr_GeneralExpression) ShallowSimplified() const;
|
||||
|
||||
//! Returns a copy of <me> having the same unknowns and functions.
|
||||
Standard_EXPORT Handle(Expr_GeneralExpression) Copy() const;
|
||||
|
||||
//! Tests if <me> contains NamedUnknown.
|
||||
Standard_EXPORT Standard_Boolean ContainsUnknowns() const;
|
||||
|
||||
//! Tests if <exp> is contained in <me>.
|
||||
Standard_EXPORT Standard_Boolean Contains (const Handle(Expr_GeneralExpression)& exp) const;
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsLinear() const;
|
||||
|
||||
//! Returns the derivative on <X> unknown of <me>
|
||||
Standard_EXPORT Handle(Expr_GeneralExpression) Derivative (const Handle(Expr_NamedUnknown)& X) const;
|
||||
|
||||
//! Replaces all occurences of <var> with <with> in <me>
|
||||
//! Raises InvalidOperand if <with> contains <me>.
|
||||
Standard_EXPORT void Replace (const Handle(Expr_NamedUnknown)& var, const Handle(Expr_GeneralExpression)& with);
|
||||
|
||||
//! Returns the value of <me> (as a Real) by
|
||||
//! replacement of <vars> by <vals>.
|
||||
//! Raises NotEvaluable if <me> contains NamedUnknown not
|
||||
//! in <vars> or NumericError if result cannot be computed.
|
||||
Standard_EXPORT Standard_Real Evaluate (const Expr_Array1OfNamedUnknown& vars, const TColStd_Array1OfReal& vals) const;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(Expr_NamedUnknown,Expr_NamedExpression)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Handle(Expr_GeneralExpression) myExpression;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#include <Expr_NamedUnknown.lxx>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Expr_NamedUnknown_HeaderFile
|
37
src/Expr/Expr_NotAssigned.hxx
Normal file
37
src/Expr/Expr_NotAssigned.hxx
Normal file
@@ -0,0 +1,37 @@
|
||||
// Created on: 1991-01-14
|
||||
// Created by: Arnaud BOUZY
|
||||
// Copyright (c) 1991-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Expr_NotAssigned_HeaderFile
|
||||
#define _Expr_NotAssigned_HeaderFile
|
||||
|
||||
#include <Standard_Type.hxx>
|
||||
#include <Standard_DefineException.hxx>
|
||||
#include <Standard_SStream.hxx>
|
||||
#include <Expr_ExprFailure.hxx>
|
||||
|
||||
class Expr_NotAssigned;
|
||||
DEFINE_STANDARD_HANDLE(Expr_NotAssigned, Expr_ExprFailure)
|
||||
|
||||
#if !defined No_Exception && !defined No_Expr_NotAssigned
|
||||
#define Expr_NotAssigned_Raise_if(CONDITION, MESSAGE) \
|
||||
if (CONDITION) Expr_NotAssigned::Raise(MESSAGE);
|
||||
#else
|
||||
#define Expr_NotAssigned_Raise_if(CONDITION, MESSAGE)
|
||||
#endif
|
||||
|
||||
DEFINE_STANDARD_EXCEPTION(Expr_NotAssigned, Expr_ExprFailure)
|
||||
|
||||
#endif // _Expr_NotAssigned_HeaderFile
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user