But the logic in Hunt still has some problem especiall when Abs(Coord-Arr(i))==Tol.
The raw Hunt function is:
---------------------------------------------------------
static void Hunt(const TColStd_Array1OfReal& Arr,
const Standard_Real Coord,
Standard_Integer& Iloc)
{//Warning: Hunt is used to find number of knot which equals co-ordinate component,
// when co-ordinate component definitly equals a knot only.
Standard_Real Tol=Precision::PConfusion()/10;
Standard_Integer i=1;
while((i<=Arr.Upper())&&(Abs(Coord-Arr(i))>Tol)){
i++;}
if(Abs(Coord-Arr(i))<Tol)
Iloc = i;
else
if(Abs(Coord-Arr(i))>Tol) Standard_NotImplemented::Raise("Adaptor3d_CurveOnSurface:Hunt");
}
--------------------------------------------------------------------------------
When Abs(Coord-Arr(i))==Tol, the Iloc has a undefined value, so it may cause crash in release version.