File indexing completed on 2026-09-25 09:18:57
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 #ifndef _AppDef_TheFunction_HeaderFile
0018 #define _AppDef_TheFunction_HeaderFile
0019
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023
0024 #include <AppDef_MultiLine.hxx>
0025 #include <Standard_Integer.hxx>
0026 #include <Standard_Real.hxx>
0027 #include <AppDef_TheLeastSquares.hxx>
0028 #include <NCollection_Array1.hxx>
0029 #include <NCollection_HArray1.hxx>
0030 #include <AppParCurves_ConstraintCouple.hxx>
0031 #include <math_MultipleVarFunctionWithGradient.hxx>
0032 #include <AppParCurves_Constraint.hxx>
0033 class AppDef_MultiLine;
0034 class AppDef_MyLineTool;
0035 class AppDef_TheLeastSquares;
0036 class AppDef_TheResol;
0037 class AppParCurves_MultiCurve;
0038
0039 class AppDef_TheFunction : public math_MultipleVarFunctionWithGradient
0040 {
0041 public:
0042 DEFINE_STANDARD_ALLOC
0043
0044
0045
0046 Standard_EXPORT AppDef_TheFunction(
0047 const AppDef_MultiLine& SSP,
0048 const int FirstPoint,
0049 const int LastPoint,
0050 const occ::handle<NCollection_HArray1<AppParCurves_ConstraintCouple>>& TheConstraints,
0051 const math_Vector& Parameters,
0052 const int Deg);
0053
0054
0055
0056 Standard_EXPORT int NbVariables() const override;
0057
0058
0059
0060
0061
0062 Standard_EXPORT bool Value(const math_Vector& X, double& F) override;
0063
0064
0065
0066 Standard_EXPORT bool Gradient(const math_Vector& X, math_Vector& G) override;
0067
0068
0069
0070 Standard_EXPORT bool Values(const math_Vector& X, double& F, math_Vector& G) override;
0071
0072
0073 Standard_EXPORT const math_Vector& NewParameters() const;
0074
0075
0076
0077 Standard_EXPORT const AppParCurves_MultiCurve& CurveValue();
0078
0079
0080
0081 Standard_EXPORT double Error(const int IPoint, const int CurveIndex) const;
0082
0083
0084
0085 Standard_EXPORT double MaxError3d() const;
0086
0087
0088
0089 Standard_EXPORT double MaxError2d() const;
0090
0091 Standard_EXPORT AppParCurves_Constraint FirstConstraint(
0092 const occ::handle<NCollection_HArray1<AppParCurves_ConstraintCouple>>& TheConstraints,
0093 const int FirstPoint) const;
0094
0095 Standard_EXPORT AppParCurves_Constraint LastConstraint(
0096 const occ::handle<NCollection_HArray1<AppParCurves_ConstraintCouple>>& TheConstraints,
0097 const int LastPoint) const;
0098
0099 protected:
0100
0101
0102 Standard_EXPORT void Perform(const math_Vector& X);
0103
0104 private:
0105 bool Done;
0106 AppDef_MultiLine MyMultiLine;
0107 AppParCurves_MultiCurve MyMultiCurve;
0108 int Degre;
0109 math_Vector myParameters;
0110 double FVal;
0111 math_Vector ValGrad_F;
0112 math_Matrix MyF;
0113 math_Matrix PTLX;
0114 math_Matrix PTLY;
0115 math_Matrix PTLZ;
0116 math_Matrix A;
0117 math_Matrix DA;
0118 AppDef_TheLeastSquares MyLeastSquare;
0119 bool Contraintes;
0120 int NbP;
0121 int NbCu;
0122 int Adeb;
0123 int Afin;
0124 occ::handle<NCollection_HArray1<int>> tabdim;
0125 double ERR3d;
0126 double ERR2d;
0127 int FirstP;
0128 int LastP;
0129 occ::handle<NCollection_HArray1<AppParCurves_ConstraintCouple>> myConstraints;
0130 };
0131
0132 #endif