summaryrefslogtreecommitdiff
path: root/inc/Extrema_FuncExtCC.lxx
blob: 8456c48c5635e8990703f9341ae97e2144142d4d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
//=============================================================================

inline void Extrema_FuncExtCC::SetCurve (const Standard_Integer theRank, const Curve1& C)
{
  Standard_OutOfRange_Raise_if (theRank < 1 || theRank > 2, "Extrema_FuncExtCC::SetCurve()")
  if (theRank == 1) {myC1 = (Standard_Address)&C;}
  else {myC2 = (Standard_Address)&C;}
}

//=============================================================================

inline void Extrema_FuncExtCC::SetTolerance (const Standard_Real theTol)
{
  myTol = theTol;
}

//=============================================================================

inline Standard_Integer Extrema_FuncExtCC::NbVariables () const { return 2; }

//=============================================================================

inline Standard_Integer Extrema_FuncExtCC::NbEquations () const { return 2; }

//=============================================================================

inline Standard_Integer Extrema_FuncExtCC::NbExt () const { return mySqDist.Length(); }

//=============================================================================

inline Standard_Real Extrema_FuncExtCC::SquareDistance (const Standard_Integer N) const
{
  return mySqDist.Value(N);
}

//=============================================================================

inline Standard_Address Extrema_FuncExtCC::CurvePtr (const Standard_Integer theRank) const
{
  Standard_OutOfRange_Raise_if (theRank < 1 || theRank > 2, "Extrema_FuncExtCC::SetCurve()")
  return (theRank == 1 ? myC1 : myC2);
}

//=============================================================================

inline Standard_Real Extrema_FuncExtCC::Tolerance() const
{
  return myTol;
}