1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-08 18:40:55 +03:00

0025622: CAST analysis: Avoid invocation of virtual Methods of the declared Class in a Constructor or Destructor

The Delete() methods have been deleted from the following classes:
- Adaptor2d_Curve2d
- Adaptor3d_Curve
- Adaptor3d_Surface
- AppBlend_Approx
- AppCont_Function
- AppParCurves_MultiCurve
- AppParCurves_MultiPoint
- ApproxInt_SvSurfaces
- BRepPrim_OneAxis
- BRepSweep_NumLinearRegularSweep
- BRepSweep_Translation
- BRepSweep_Trsf
- DBC_BaseArray
- GeomFill_Profiler
- HatchGen_PointOnHatching
- math_BFGS
- math_FunctionSet
- math_FunctionSetRoot
- math_FunctionWithDerivative
- math_MultipleVarFunction
- math_MultipleVarFunctionWithHessian
- math_MultipleVarFunctionWithGradient
- math_Powell
- math_NewtonMinimum
- math_NewtonFunctionSetRoot
- math_BissecNewton (just add virtual destructor)
- math_FRPR
- math_BrentMinimum (just add virtual destructor)
- OSD_Chronometer
- ProjLib_Projector

Virtual methods Delete() or Destroy() of the transient inheritors is not changed (-> separate issue).
Classes Graphic3d_DataStructureManager and PrsMgr_Presentation without changes.
This commit is contained in:
azn 2014-12-18 10:27:01 +03:00 committed by bugmaster
parent e2b55410ff
commit 6da30ff153
63 changed files with 226 additions and 239 deletions
src
Adaptor2d
Adaptor3d
AppBlend
AppCont
AppParCurves
ApproxInt
BRepPrim
BRepSweep
DBC
GeomFill
HatchGen
Interface
OSD
ProjLib
math

@ -52,9 +52,6 @@ is
-- Global methods - Apply to the whole curve. -- Global methods - Apply to the whole curve.
-- --
Delete(me:out) is virtual;
---C++: alias "Standard_EXPORT virtual ~Adaptor2d_Curve2d(){Delete();}"
FirstParameter(me) returns Real FirstParameter(me) returns Real
is virtual; is virtual;
@ -230,6 +227,8 @@ is
NoSuchObject from Standard NoSuchObject from Standard
is virtual; is virtual;
---C++: alias " Standard_EXPORT virtual ~Adaptor2d_Curve2d();"
end Curve2d; end Curve2d;

@ -17,8 +17,15 @@
#include <Adaptor2d_Curve2d.ixx> #include <Adaptor2d_Curve2d.ixx>
#include <Standard_NotImplemented.hxx> #include <Standard_NotImplemented.hxx>
void Adaptor2d_Curve2d::Delete()
{} //=======================================================================
//function : ~Adaptor2d_Curve2d
//purpose : Destructor
//=======================================================================
Adaptor2d_Curve2d::~Adaptor2d_Curve2d()
{
}
//======================================================================= //=======================================================================
//function : FirstParameter //function : FirstParameter

@ -54,9 +54,6 @@ is
-- Global methods - Apply to the whole curve. -- Global methods - Apply to the whole curve.
-- --
Delete(me:out) is virtual;
---C++: alias "Standard_EXPORT virtual ~Adaptor3d_Curve(){Delete();}"
FirstParameter(me) returns Real FirstParameter(me) returns Real
is virtual; is virtual;
@ -246,6 +243,8 @@ is
NoSuchObject from Standard NoSuchObject from Standard
is virtual; is virtual;
---C++: alias " Standard_EXPORT virtual ~Adaptor3d_Curve();"
end Curve; end Curve;

@ -17,8 +17,14 @@
#include <Adaptor3d_Curve.ixx> #include <Adaptor3d_Curve.ixx>
#include <Standard_NotImplemented.hxx> #include <Standard_NotImplemented.hxx>
void Adaptor3d_Curve::Delete() //=======================================================================
{} //function : ~Adaptor3d_Curve
//purpose : Destructor
//=======================================================================
Adaptor3d_Curve::~Adaptor3d_Curve()
{
}
//======================================================================= //=======================================================================
//function : FirstParameter //function : FirstParameter

@ -62,9 +62,6 @@ is
-- Global methods - Apply to the whole surface. -- Global methods - Apply to the whole surface.
-- --
Delete(me:out) is virtual;
---C++: alias "Standard_EXPORT virtual ~Adaptor3d_Surface(){Delete();}"
FirstUParameter(me) returns Real FirstUParameter(me) returns Real
is virtual; is virtual;
@ -316,6 +313,8 @@ is
NoSuchObject from Standard -- only for Offset Surface NoSuchObject from Standard -- only for Offset Surface
is virtual; is virtual;
---C++: alias " Standard_EXPORT virtual ~Adaptor3d_Surface();"
end Surface; end Surface;

@ -17,8 +17,14 @@
#include <Adaptor3d_Surface.ixx> #include <Adaptor3d_Surface.ixx>
#include <Standard_NotImplemented.hxx> #include <Standard_NotImplemented.hxx>
void Adaptor3d_Surface::Delete() //=======================================================================
{} //function : ~Adaptor3d_Surface
//purpose : Destructor
//=======================================================================
Adaptor3d_Surface::~Adaptor3d_Surface()
{
}
//======================================================================= //=======================================================================
//function : FirstUParameter //function : FirstUParameter

@ -35,13 +35,6 @@ raises NotDone from StdFail,
is is
Delete(me:out) is virtual;
---C++: alias "Standard_EXPORT virtual ~AppBlend_Approx(){Delete() ; }"
IsDone(me) IsDone(me)
returns Boolean from Standard returns Boolean from Standard
is deferred; is deferred;
@ -204,5 +197,6 @@ is
raises NotDone from StdFail raises NotDone from StdFail
is deferred; is deferred;
---C++: alias " Standard_EXPORT virtual ~AppBlend_Approx();"
end Approx; end Approx;

@ -16,5 +16,10 @@
#include <AppBlend_Approx.ixx> #include <AppBlend_Approx.ixx>
void AppBlend_Approx::Delete() //=======================================================================
{} //function : AppBlend_Approx
//purpose : Destructor
//=======================================================================
AppBlend_Approx::~AppBlend_Approx()
{
}

@ -54,6 +54,7 @@ public:
return myNbPnt2d; return myNbPnt2d;
} }
//! Destructor
Standard_EXPORT virtual ~AppCont_Function() {} Standard_EXPORT virtual ~AppCont_Function() {}
//! Returns the first parameter of the function. //! Returns the first parameter of the function.

@ -81,9 +81,7 @@ is
returns MultiCurve from AppParCurves returns MultiCurve from AppParCurves
raises ConstructionError from Standard; raises ConstructionError from Standard;
---C++: alias " Standard_EXPORT virtual ~AppParCurves_MultiCurve();"
Delete(me:out) is virtual;
---C++: alias "Standard_EXPORT virtual ~AppParCurves_MultiCurve(){Delete();}"
SetNbPoles(me: in out; nbPoles: Integer) SetNbPoles(me: in out; nbPoles: Integer)
---Purpose: The number of poles of the MultiCurve ---Purpose: The number of poles of the MultiCurve

@ -40,8 +40,9 @@ AppParCurves_MultiCurve::AppParCurves_MultiCurve (const AppParCurves_Array1OfMul
} }
void AppParCurves_MultiCurve::Delete() AppParCurves_MultiCurve::~AppParCurves_MultiCurve()
{} {
}
Standard_Integer AppParCurves_MultiCurve::Dimension (const Standard_Integer Index) const { Standard_Integer AppParCurves_MultiCurve::Dimension (const Standard_Integer Index) const {
Standard_Integer Lo = tabPoint->Lower(); Standard_Integer Lo = tabPoint->Lower();

@ -75,9 +75,7 @@ is
returns MultiPoint from AppParCurves; returns MultiPoint from AppParCurves;
---C++: alias " Standard_EXPORT virtual ~AppParCurves_MultiPoint();"
Delete(me:out) is virtual;
---C++: alias "Standard_EXPORT virtual ~AppParCurves_MultiPoint(){Delete();}"
SetPoint(me: in out; Index: Integer; Point: Pnt) SetPoint(me: in out; Index: Integer; Point: Pnt)
---Purpose: the 3d Point of range Index of this MultiPoint is ---Purpose: the 3d Point of range Index of this MultiPoint is

@ -99,8 +99,9 @@ AppParCurves_MultiPoint::AppParCurves_MultiPoint(const TColgp_Array1OfPnt& tab
} }
} }
void AppParCurves_MultiPoint::Delete() AppParCurves_MultiPoint::~AppParCurves_MultiPoint()
{} {
}
void AppParCurves_MultiPoint::Transform(const Standard_Integer CuIndex, void AppParCurves_MultiPoint::Transform(const Standard_Integer CuIndex,
const Standard_Real x, const Standard_Real x,

@ -24,9 +24,6 @@ uses
is is
Delete(me:out) is virtual;
---C++: alias "Standard_EXPORT virtual ~ApproxInt_SvSurfaces(){Delete() ; }"
Compute(me: in out; Compute(me: in out;
u1,v1,u2,v2: in out Real from Standard; u1,v1,u2,v2: in out Real from Standard;
Pt: out Pnt from gp; Pt: out Pnt from gp;
@ -54,6 +51,8 @@ is
Tg: out Vec2d from gp) Tg: out Vec2d from gp)
returns Boolean from Standard is deferred; returns Boolean from Standard is deferred;
---C++: alias " Standard_EXPORT virtual ~ApproxInt_SvSurfaces();"
end SvSurfaces; end SvSurfaces;

@ -14,5 +14,10 @@
#include <ApproxInt_SvSurfaces.ixx> #include <ApproxInt_SvSurfaces.ixx>
void ApproxInt_SvSurfaces::Delete() //=======================================================================
{} //function : ~ApproxInt_SvSurfaces
//purpose : Destructor
//=======================================================================
ApproxInt_SvSurfaces::~ApproxInt_SvSurfaces()
{
}

@ -67,9 +67,6 @@ raises
OutOfRange OutOfRange
is is
Delete(me:out) is virtual ;
---C++: alias ~
Initialize(B : Builder from BRepPrim; Initialize(B : Builder from BRepPrim;
A : Ax2 from gp; A : Ax2 from gp;
VMin, VMax : Real from Standard); VMin, VMax : Real from Standard);
@ -433,6 +430,8 @@ is
raises DomainError -- if VMinInfinite() raises DomainError -- if VMinInfinite()
is static; is static;
---C++ : alias " Standard_EXPORT virtual ~BRepPrim_OneAxis();"
fields fields
myBuilder : Builder from BRepPrim is protected; myBuilder : Builder from BRepPrim is protected;
myAxes : Ax2 from gp; myAxes : Ax2 from gp;

@ -129,8 +129,14 @@ BRepPrim_OneAxis::BRepPrim_OneAxis(const BRepPrim_Builder& B,
} }
void BRepPrim_OneAxis::Delete() //=======================================================================
{} //function : ~BRepPrim_OneAxis
//purpose : Destructor
//=======================================================================
BRepPrim_OneAxis::~BRepPrim_OneAxis()
{
}
//======================================================================= //=======================================================================
//function : SetMeridianOffset //function : SetMeridianOffset

@ -81,26 +81,22 @@ is
-- """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -- """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
Delete(me:out) is virtual ;
---C++: alias ~
Initialize(aBuilder : Builder from BRepSweep; Initialize(aBuilder : Builder from BRepSweep;
aGenShape : Shape from TopoDS; aGenShape : Shape from TopoDS;
aDirWire : NumShape from Sweep); aDirWire : NumShape from Sweep);
---Purpose: Creates a NumLinearRegularSweep. <aBuilder> gives ---Purpose: Creates a NumLinearRegularSweep. <aBuilder> gives
-- basic topological services. -- basic topological services.
-- """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -- """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
-- Deferred Methods supporting the creation of the geometric part. -- Deferred Methods supporting the creation of the geometric part.
-- """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -- """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
MakeEmptyVertex(me : in out; aGenV: Shape from TopoDS; aDirV: NumShape from Sweep) MakeEmptyVertex(me : in out; aGenV: Shape from TopoDS; aDirV: NumShape from Sweep)
returns Shape from TopoDS returns Shape from TopoDS is deferred;
---Purpose: Builds the vertex addressed by [aGenV,aDirV], with its ---Purpose: Builds the vertex addressed by [aGenV,aDirV], with its
-- geometric part, but without subcomponents. -- geometric part, but without subcomponents.
is deferred; ---C++ : alias " Standard_EXPORT virtual ~BRepSweep_NumLinearRegularSweep();"
MakeEmptyDirectingEdge(me: in out; aGenV: Shape from TopoDS; aDirE: NumShape from Sweep) MakeEmptyDirectingEdge(me: in out; aGenV: Shape from TopoDS; aDirE: NumShape from Sweep)
returns Shape from TopoDS returns Shape from TopoDS
@ -327,7 +323,6 @@ is
Closed(me) returns Boolean from Standard is static; Closed(me) returns Boolean from Standard is static;
fields fields
-- Topology builder. -- Topology builder.

@ -62,8 +62,14 @@ BRepSweep_NumLinearRegularSweep::BRepSweep_NumLinearRegularSweep
myBuiltShapes.Init(Standard_False); myBuiltShapes.Init(Standard_False);
} }
void BRepSweep_NumLinearRegularSweep::Delete() //=======================================================================
{} //function : ~BRepSweep_NumLinearRegularSweep
//purpose : Destructor
//=======================================================================
BRepSweep_NumLinearRegularSweep::~BRepSweep_NumLinearRegularSweep()
{
}
//======================================================================= //=======================================================================
//function : Shape //function : Shape

@ -45,9 +45,6 @@ is
raises raises
ConstructionError from Standard; -- if <V> is null ConstructionError from Standard; -- if <V> is null
Delete(me:out) is redefined;
---C++: alias "Standard_EXPORT virtual ~BRepSweep_Translation(){Delete() ; }"
-- """""""""""""""""""""""""""""""""""""""""""""""""""""" -- """"""""""""""""""""""""""""""""""""""""""""""""""""""
-- Methods supporting the creation of the geometric part. -- Methods supporting the creation of the geometric part.
-- """""""""""""""""""""""""""""""""""""""""""""""""""""" -- """"""""""""""""""""""""""""""""""""""""""""""""""""""

@ -94,10 +94,6 @@ BRepSweep_Translation::BRepSweep_Translation(const TopoDS_Shape& S,
Init(); Init();
} }
void BRepSweep_Translation::Delete()
{}
//======================================================================= //=======================================================================
//function : MakeEmptyVertex //function : MakeEmptyVertex
//purpose : //purpose :

@ -42,10 +42,6 @@ uses
Orientation from TopAbs Orientation from TopAbs
is is
Delete(me:out) is redefined;
---C++: alias "Standard_EXPORT virtual ~BRepSweep_Trsf(){Delete() ; }"
Initialize(aBuilder : Builder from BRep; Initialize(aBuilder : Builder from BRep;
aGenShape : Shape from TopoDS; aGenShape : Shape from TopoDS;
aDirWire : NumShape from Sweep; aDirWire : NumShape from Sweep;

@ -40,10 +40,6 @@ BRepSweep_Trsf::BRepSweep_Trsf(const BRep_Builder& aBuilder,
{ {
} }
void BRepSweep_Trsf::Delete()
{}
void BRepSweep_Trsf::Init() void BRepSweep_Trsf::Init()
{ {
if(!myCopy){ if(!myCopy){

@ -35,8 +35,7 @@ is
---Purpose: Creates an array which is the copy of the given ---Purpose: Creates an array which is the copy of the given
-- argument. -- argument.
Delete ( me : out ) is redefined; ---C++: alias " Standard_EXPORT virtual ~DBC_BaseArray();"
---C++: alias "Standard_EXPORT virtual ~DBC_BaseArray(){Delete();}"
Length (me) returns Integer is static ; Length (me) returns Integer is static ;
---C++: inline ---C++: inline

@ -163,8 +163,9 @@ DBC_BaseArray::DBC_BaseArray (const DBC_BaseArray& Other)
} }
void DBC_BaseArray::Delete() DBC_BaseArray::~DBC_BaseArray()
{} {
}
// -------------------------------------------------------------------- // --------------------------------------------------------------------

@ -37,8 +37,7 @@ raises
is is
Create returns Profiler from GeomFill; Create returns Profiler from GeomFill;
Delete(me:out) is virtual; ---C++: alias " Standard_EXPORT virtual ~GeomFill_Profiler();"
---C++: alias "Standard_EXPORT virtual ~GeomFill_Profiler(){Delete() ; }"
AddCurve( me : in out; AddCurve( me : in out;
Curve : in Curve from Geom) Curve : in Curve from Geom)

@ -125,8 +125,9 @@ GeomFill_Profiler::GeomFill_Profiler()
//======================================================================= //=======================================================================
void GeomFill_Profiler::Delete() GeomFill_Profiler::~GeomFill_Profiler()
{} {
}
//======================================================================= //=======================================================================

@ -170,7 +170,9 @@ is
---Purpose: Dump of the point on element. ---Purpose: Dump of the point on element.
is deferred ; is deferred;
---C++: alias " Standard_EXPORT virtual ~HatchGen_IntersectionPoint();"
fields fields

@ -32,6 +32,16 @@ HatchGen_IntersectionPoint::HatchGen_IntersectionPoint () :
{ {
} }
//=======================================================================
// Function : ~HatchGen_IntersectionPoint
// Purpose : Destructor
//=======================================================================
HatchGen_IntersectionPoint::~HatchGen_IntersectionPoint()
{
}
//======================================================================= //=======================================================================
// Function : SetIndex // Function : SetIndex
// Purpose : Sets the index of the supporting curve. // Purpose : Sets the index of the supporting curve.

@ -59,11 +59,6 @@ is
returns PointOnHatching from HatchGen ; returns PointOnHatching from HatchGen ;
Delete (me : out) is virtual;
---C++: alias "Standard_EXPORT virtual ~HatchGen_PointOnHatching(){Delete();}"
---Purpose: linux porting
AddPoint (me : in out ; Point : PointOnElement from HatchGen ; AddPoint (me : in out ; Point : PointOnElement from HatchGen ;
Confusion : Real from Standard) Confusion : Real from Standard)

@ -68,9 +68,6 @@ HatchGen_PointOnHatching::HatchGen_PointOnHatching (const IntRes2d_IntersectionP
myPoints.Clear() ; myPoints.Clear() ;
} }
void HatchGen_PointOnHatching::Delete()
{}
//======================================================================= //=======================================================================
// Function : AddPoint // Function : AddPoint
// Purpose : Adds a point on element to the point. // Purpose : Adds a point on element to the point.
@ -88,7 +85,6 @@ void HatchGen_PointOnHatching::AddPoint (const HatchGen_PointOnElement& Point,
if (IPnt > NbPnt) myPoints.Append (Point) ; if (IPnt > NbPnt) myPoints.Append (Point) ;
} }
//======================================================================= //=======================================================================
// Function : NbPoints // Function : NbPoints
// Purpose : Returns the number of elements intersecting the hatching at // Purpose : Returns the number of elements intersecting the hatching at

@ -192,8 +192,7 @@ is
-- asked for copy by the user of CopyTool, not by copying -- asked for copy by the user of CopyTool, not by copying
-- another Entity) -- another Entity)
Destroy (me: in out) is virtual; ---C++: alias " Standard_EXPORT virtual ~Interface_CopyTool();"
---C++: alias "Standard_EXPORT virtual ~Interface_CopyTool() { Destroy(); }"
fields fields

@ -325,4 +325,11 @@ Interface_CopyTool::Interface_CopyTool
return iter; return iter;
} }
void Interface_CopyTool::Destroy(){} //=======================================================================
//function : ~Interface_CopyTool
//purpose : Destructor
//=======================================================================
Interface_CopyTool::~Interface_CopyTool()
{
}

@ -42,8 +42,7 @@ is
-- --
---Level: Public ---Level: Public
Destroy ( me : out ) is virtual; ---C++ : alias " Standard_EXPORT virtual ~OSD_Chronometer();"
---C++: alias ~
Reset (me : in out) is virtual; Reset (me : in out) is virtual;
---Purpose: Stops and Reinitializes the Chronometer. ---Purpose: Stops and Reinitializes the Chronometer.

@ -171,10 +171,10 @@ OSD_Chronometer::OSD_Chronometer(const Standard_Boolean ThisThreadOnly)
} }
//======================================================================= //=======================================================================
//function : Destroy //function : ~OSD_Chronometer
//purpose : //purpose : Destructor
//======================================================================= //=======================================================================
void OSD_Chronometer::Destroy () OSD_Chronometer::~OSD_Chronometer()
{ {
} }

@ -42,8 +42,7 @@ is
Create ; Create ;
---Purpose: Sets the type to OtherCurve ---Purpose: Sets the type to OtherCurve
Delete(me:out) is virtual; ---C++: alias " Standard_EXPORT virtual ~ProjLib_Projector();"
---C++: alias "Standard_EXPORT virtual ~ProjLib_Projector(){Delete() ; }"
IsDone(me) returns Boolean from Standard IsDone(me) returns Boolean from Standard
is static; is static;

@ -28,13 +28,18 @@
//======================================================================= //=======================================================================
ProjLib_Projector::ProjLib_Projector() ProjLib_Projector::ProjLib_Projector()
{} {
}
//======================================================================= //=======================================================================
void ProjLib_Projector::Delete() //function : ~ProjLib_Projector
{} //purpose : Destructor
//=======================================================================
ProjLib_Projector::~ProjLib_Projector()
{
}
//======================================================================= //=======================================================================

@ -43,9 +43,7 @@ is
-- function F. -- function F.
returns BFGS; returns BFGS;
---C++: alias "Standard_EXPORT virtual ~math_BFGS();"
Delete(me:out) is virtual;
---C++: alias "Standard_EXPORT virtual ~math_BFGS(){Delete() ; }"
Perform(me: in out; F: in out MultipleVarFunctionWithGradient; Perform(me: in out; F: in out MultipleVarFunctionWithGradient;
StartingPoint: Vector) StartingPoint: Vector)

@ -281,8 +281,9 @@ void math_BFGS::Perform(math_MultipleVarFunctionWithGradient& F,
} }
void math_BFGS::Delete() math_BFGS::~math_BFGS()
{} {
}
void math_BFGS::Dump(Standard_OStream& o) const { void math_BFGS::Dump(Standard_OStream& o) const {

@ -52,6 +52,7 @@ is
returns BissecNewton; returns BissecNewton;
---C++: alias " Standard_EXPORT virtual ~math_BissecNewton();"
IsSolutionReached(me: in out; F: out FunctionWithDerivative) IsSolutionReached(me: in out; F: out FunctionWithDerivative)
---Purpose: ---Purpose:

@ -15,6 +15,9 @@
#include <math_BissecNewton.ixx> #include <math_BissecNewton.ixx>
#include <math_FunctionWithDerivative.hxx> #include <math_FunctionWithDerivative.hxx>
math_BissecNewton::~math_BissecNewton()
{
}
void math_BissecNewton::Perform(math_FunctionWithDerivative& F, void math_BissecNewton::Perform(math_FunctionWithDerivative& F,
const Standard_Real Bound1, const Standard_Real Bound1,

@ -65,6 +65,7 @@ is
returns BrentMinimum; returns BrentMinimum;
---C++: alias " Standard_EXPORT virtual ~math_BrentMinimum();"
Perform(me: in out; F: in out Function; Perform(me: in out; F: in out Function;
Ax, Bx, Cx: Real) Ax, Bx, Cx: Real)

@ -23,6 +23,10 @@
#define SIGN(a,b) ((b) > 0.0 ? fabs(a) : -fabs(a)) #define SIGN(a,b) ((b) > 0.0 ? fabs(a) : -fabs(a))
#define SHFT(a,b,c,d) (a)=(b);(b)=(c);(c)=(d) #define SHFT(a,b,c,d) (a)=(b);(b)=(c);(c)=(d)
math_BrentMinimum::~math_BrentMinimum()
{
}
void math_BrentMinimum::Perform(math_Function& F, void math_BrentMinimum::Perform(math_Function& F,
const Standard_Real ax, const Standard_Real ax,
const Standard_Real bx, const Standard_Real bx,

@ -52,9 +52,7 @@ is
-- initialization to compute the minimum of the function. -- initialization to compute the minimum of the function.
returns FRPR; returns FRPR;
---C++: alias " Standard_EXPORT virtual ~math_FRPR();"
Delete(me:out) is virtual;
---C++: alias "Standard_EXPORT virtual ~math_FRPR(){Delete();}"
Perform(me: in out; F: in out MultipleVarFunctionWithGradient; Perform(me: in out; F: in out MultipleVarFunctionWithGradient;
StartingPoint: Vector) StartingPoint: Vector)

@ -216,8 +216,9 @@ void math_FRPR::Perform(math_MultipleVarFunctionWithGradient& F,
} }
void math_FRPR::Delete() math_FRPR::~math_FRPR()
{} {
}
void math_FRPR::Dump(Standard_OStream& o) const { void math_FRPR::Dump(Standard_OStream& o) const {

@ -22,10 +22,6 @@ deferred class FunctionSet from math
uses Vector from math uses Vector from math
is is
Delete(me:out) is virtual;
---C++: alias "Standard_EXPORT virtual ~math_FunctionSet(){Delete();}"
NbVariables(me) NbVariables(me)
---Purpose: Returns the number of variables of the function. ---Purpose: Returns the number of variables of the function.
@ -46,8 +42,7 @@ is
-- returns True if the computation was done successfully, -- returns True if the computation was done successfully,
-- False otherwise. -- False otherwise.
returns Boolean returns Boolean is deferred;
is deferred;
GetStateNumber(me: in out) GetStateNumber(me: in out)
@ -66,8 +61,9 @@ is
-- to save the current state of the function and to return -- to save the current state of the function and to return
-- an Integer that allows retrieval of the state. -- an Integer that allows retrieval of the state.
returns Integer returns Integer is virtual;
is virtual;
---C++: alias " Standard_EXPORT virtual ~math_FunctionSet();"
end FunctionSet; end FunctionSet;

@ -15,7 +15,19 @@
#include <Standard_Integer.hxx> #include <Standard_Integer.hxx>
#include <math_FunctionSet.ixx> #include <math_FunctionSet.ixx>
Standard_Integer math_FunctionSet::GetStateNumber() { return 0; } //=======================================================================
//function : ~math_FunctionSet
//purpose : Destructor
//=======================================================================
math_FunctionSet::~math_FunctionSet()
{
}
void math_FunctionSet::Delete() //=======================================================================
{} //function : GetStateNumber
//purpose :
//=======================================================================
Standard_Integer math_FunctionSet::GetStateNumber()
{
return 0;
}

@ -85,10 +85,7 @@ is
returns FunctionSetRoot from math; returns FunctionSetRoot from math;
---C++: alias " Standard_EXPORT virtual ~math_FunctionSetRoot();"
Delete(me:out) is virtual;
---C++: alias "Standard_EXPORT virtual ~math_FunctionSetRoot(){Delete();}"
SetTolerance(me: in out; Tolerance: Vector) SetTolerance(me: in out; Tolerance: Vector)
---Purpose: Initializes the tolerance values. ---Purpose: Initializes the tolerance values.

@ -689,8 +689,9 @@ DF(1, F.NbEquations(),
Perform(F, StartingPoint, InfBound, SupBound); Perform(F, StartingPoint, InfBound, SupBound);
} }
void math_FunctionSetRoot::Delete() math_FunctionSetRoot::~math_FunctionSetRoot()
{} {
}
void math_FunctionSetRoot::SetTolerance(const math_Vector& Tolerance) void math_FunctionSetRoot::SetTolerance(const math_Vector& Tolerance)
{ {

@ -23,17 +23,12 @@ deferred class FunctionWithDerivative from math
inherits Function inherits Function
is is
Delete(me:out) is virtual;
---C++: alias "Standard_EXPORT virtual ~math_FunctionWithDerivative(){Delete();}"
Value(me: in out; X: Real; F: out Real) Value(me: in out; X: Real; F: out Real)
---Purpose: Computes the value <F>of the function for the variable <X>. ---Purpose: Computes the value <F>of the function for the variable <X>.
-- Returns True if the calculation were successfully done, -- Returns True if the calculation were successfully done,
-- False otherwise. -- False otherwise.
returns Boolean returns Boolean is deferred;
is deferred;
Derivative(me: in out; X: Real; D: out Real) Derivative(me: in out; X: Real; D: out Real)
---Purpose: Computes the derivative <D> of the function ---Purpose: Computes the derivative <D> of the function
@ -41,8 +36,7 @@ is
-- Returns True if the calculation were successfully done, -- Returns True if the calculation were successfully done,
-- False otherwise. -- False otherwise.
returns Boolean returns Boolean is deferred;
is deferred;
Values(me: in out; X: Real; F, D: out Real) Values(me: in out; X: Real; F, D: out Real)
---Purpose: Computes the value <F> and the derivative <D> of the ---Purpose: Computes the value <F> and the derivative <D> of the
@ -50,7 +44,8 @@ is
-- Returns True if the calculation were successfully done, -- Returns True if the calculation were successfully done,
-- False otherwise. -- False otherwise.
returns Boolean returns Boolean is deferred;
is deferred;
---C++: alias " Standard_EXPORT virtual ~math_FunctionWithDerivative();"
end FunctionWithDerivative; end FunctionWithDerivative;

@ -14,5 +14,10 @@
#include <math_FunctionWithDerivative.ixx> #include <math_FunctionWithDerivative.ixx>
void math_FunctionWithDerivative::Delete() //=======================================================================
{} //function : ~math_FunctionWithDerivative
//purpose : Destructor
//=======================================================================
math_FunctionWithDerivative::~math_FunctionWithDerivative()
{
}

@ -20,9 +20,6 @@ deferred class MultipleVarFunction from math
uses Vector from math uses Vector from math
is is
Delete(me:out) is virtual;
---C++: alias "Standard_EXPORT virtual ~math_MultipleVarFunction(){Delete();}"
NbVariables(me) NbVariables(me)
---Purpose: ---Purpose:
-- Returns the number of variables of the function -- Returns the number of variables of the function
@ -60,4 +57,6 @@ is
returns Integer returns Integer
is virtual; is virtual;
---C++: alias " Standard_EXPORT virtual ~math_MultipleVarFunction();"
end MultipleVarFunction; end MultipleVarFunction;

@ -15,7 +15,19 @@
#include <Standard_Integer.hxx> #include <Standard_Integer.hxx>
#include <math_MultipleVarFunction.ixx> #include <math_MultipleVarFunction.ixx>
Standard_Integer math_MultipleVarFunction::GetStateNumber() { return 0; } //=======================================================================
//function : ~math_MultipleVarFunction
//purpose : Destructor
//=======================================================================
math_MultipleVarFunction::~math_MultipleVarFunction()
{
}
void math_MultipleVarFunction::Delete() //=======================================================================
{} //function : GetStateNumber
//purpose :
//=======================================================================
Standard_Integer math_MultipleVarFunction::GetStateNumber()
{
return 0;
}

@ -23,15 +23,10 @@ inherits MultipleVarFunction
uses Vector from math uses Vector from math
is is
Delete(me:out) is redefined virtual;
---C++: alias "Standard_EXPORT virtual ~math_MultipleVarFunctionWithGradient(){Delete();}"
NbVariables(me) NbVariables(me)
---Purpose: Returns the number of variables of the function. ---Purpose: Returns the number of variables of the function.
returns Integer returns Integer is deferred;
is deferred;
Value(me: in out; X: Vector; F: out Real) Value(me: in out; X: Vector; F: out Real)
@ -39,8 +34,7 @@ is
-- Returns True if the computation was done successfully, -- Returns True if the computation was done successfully,
-- False otherwise. -- False otherwise.
returns Boolean returns Boolean is deferred;
is deferred;
Gradient(me: in out; X: Vector; G: out Vector) Gradient(me: in out; X: Vector; G: out Vector)
@ -48,8 +42,7 @@ is
-- Returns True if the computation was done successfully, -- Returns True if the computation was done successfully,
-- False otherwise. -- False otherwise.
returns Boolean returns Boolean is deferred;
is deferred;
Values(me: in out; X: Vector; F: out Real; G: out Vector) Values(me: in out; X: Vector; F: out Real; G: out Vector)
@ -58,7 +51,6 @@ is
-- Returns True if the computation was done successfully, -- Returns True if the computation was done successfully,
-- False otherwise. -- False otherwise.
returns Boolean returns Boolean is deferred;
is deferred;
end MultipleVarFunctionWithGradient; end MultipleVarFunctionWithGradient;

@ -1,18 +0,0 @@
// Copyright (c) 1997-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.
#include <math_MultipleVarFunctionWithGradient.ixx>
void math_MultipleVarFunctionWithGradient::Delete()
{}

@ -23,15 +23,10 @@ uses Matrix from math,
Vector from math Vector from math
is is
Delete(me:out) is redefined virtual;
---C++: alias "Standard_EXPORT virtual ~math_MultipleVarFunctionWithHessian(){Delete();}"
NbVariables(me) NbVariables(me)
---Purpose: returns the number of variables of the function. ---Purpose: returns the number of variables of the function.
returns Integer returns Integer is deferred;
is deferred;
Value(me: in out; X: Vector; F: out Real) Value(me: in out; X: Vector; F: out Real)
@ -40,8 +35,7 @@ is
-- Returns True if the computation was done successfully, -- Returns True if the computation was done successfully,
-- False otherwise. -- False otherwise.
returns Boolean returns Boolean is deferred;
is deferred;
Gradient(me: in out; X: Vector; G: out Vector) Gradient(me: in out; X: Vector; G: out Vector)
@ -50,8 +44,7 @@ is
-- Returns True if the computation was done successfully, -- Returns True if the computation was done successfully,
-- False otherwise. -- False otherwise.
returns Boolean returns Boolean is deferred;
is deferred;
Values(me: in out; X: Vector; F: out Real; G: out Vector) Values(me: in out; X: Vector; F: out Real; G: out Vector)
@ -60,8 +53,7 @@ is
-- Returns True if the computation was done successfully, -- Returns True if the computation was done successfully,
-- False otherwise. -- False otherwise.
returns Boolean returns Boolean is deferred;
is deferred;
Values(me: in out; X: Vector; F: out Real; G: out Vector; H: out Matrix) Values(me: in out; X: Vector; F: out Real; G: out Vector; H: out Matrix)
---Purpose: computes the value <F>, the gradient <G> and the ---Purpose: computes the value <F>, the gradient <G> and the
@ -69,8 +61,6 @@ is
-- Returns True if the computation was done -- Returns True if the computation was done
-- successfully, False otherwise. -- successfully, False otherwise.
returns Boolean returns Boolean is deferred;
is deferred;
end MultipleVarFunctionWithHessian; end MultipleVarFunctionWithHessian;

@ -1,20 +0,0 @@
// Created on: 1996-05-03
// Created by: Philippe MANGIN
// Copyright (c) 1996-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.
#include <math_MultipleVarFunctionWithHessian.ixx>
void math_MultipleVarFunctionWithHessian::Delete()
{}

@ -88,8 +88,7 @@ is
returns NewtonFunctionSetRoot; returns NewtonFunctionSetRoot;
Delete(me:out) is virtual; ---C++: alias " Standard_EXPORT virtual ~math_NewtonFunctionSetRoot();"
---C++: alias "Standard_EXPORT virtual ~math_NewtonFunctionSetRoot(){Delete();}"
SetTolerance(me: in out; XTol: Vector) SetTolerance(me: in out; XTol: Vector)
---Purpose: Initializes the tolerance values for the unknowns. ---Purpose: Initializes the tolerance values for the unknowns.

@ -130,8 +130,9 @@ math_NewtonFunctionSetRoot::math_NewtonFunctionSetRoot
Perform(F, StartingPoint, InfBound, SupBound); Perform(F, StartingPoint, InfBound, SupBound);
} }
void math_NewtonFunctionSetRoot::Delete() math_NewtonFunctionSetRoot::~math_NewtonFunctionSetRoot()
{} {
}
void math_NewtonFunctionSetRoot::SetTolerance void math_NewtonFunctionSetRoot::SetTolerance
(const math_Vector& XTol) (const math_Vector& XTol)

@ -60,8 +60,7 @@ is
-- Warning: This constructor do not computation -- Warning: This constructor do not computation
returns NewtonMinimum; returns NewtonMinimum;
Delete(me:out) is virtual; ---C++: alias " Standard_EXPORT virtual ~math_NewtonMinimum();"
---C++: alias "Standard_EXPORT virtual ~math_NewtonMinimum(){Delete();}"
Perform(me: in out; F: in out MultipleVarFunctionWithHessian; Perform(me: in out; F: in out MultipleVarFunctionWithHessian;
StartingPoint: Vector) StartingPoint: Vector)

@ -69,8 +69,10 @@ math_NewtonMinimum::math_NewtonMinimum(math_MultipleVarFunctionWithHessian& F,
TheStatus = math_NotBracketed; TheStatus = math_NotBracketed;
} }
//============================================================================ //============================================================================
void math_NewtonMinimum::Delete() math_NewtonMinimum::~math_NewtonMinimum()
{} {
}
//============================================================================ //============================================================================
void math_NewtonMinimum::Perform(math_MultipleVarFunctionWithHessian& F, void math_NewtonMinimum::Perform(math_MultipleVarFunctionWithHessian& F,
const math_Vector& StartingPoint) const math_Vector& StartingPoint)

@ -49,9 +49,7 @@ is
returns Powell; returns Powell;
---C++: alias " Standard_EXPORT virtual ~math_Powell();"
Delete(me:out) is virtual;
---C++: alias "Standard_EXPORT virtual ~math_Powell(){Delete();}"
Perform(me: in out;F: in out MultipleVarFunction; Perform(me: in out;F: in out MultipleVarFunction;
StartingPoint: Vector; StartingPoint: Vector;

@ -104,7 +104,9 @@ static Standard_Boolean MinimizeDirection(math_Vector& P,
return Standard_False; return Standard_False;
} }
math_Powell::~math_Powell()
{
}
void math_Powell::Perform(math_MultipleVarFunction& F, void math_Powell::Perform(math_MultipleVarFunction& F,
const math_Vector& StartingPoint, const math_Vector& StartingPoint,
@ -231,10 +233,7 @@ math_Powell::math_Powell(math_MultipleVarFunction& F,
XTol = Tolerance; XTol = Tolerance;
EPSZ = ZEPS; EPSZ = ZEPS;
Itermax = NbIterations; Itermax = NbIterations;
} }
void math_Powell::Delete()
{}
void math_Powell::Dump(Standard_OStream& o) const { void math_Powell::Dump(Standard_OStream& o) const {