// Copyright (c) 1995-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. //============================================================================ //======================================================= IntAna2d_Outils.cxx //============================================================================ #include #include MyDirectPolynomialRoots::MyDirectPolynomialRoots(const Standard_Real A4, const Standard_Real A3, const Standard_Real A2, const Standard_Real A1, const Standard_Real A0) { //-- cout<<" IntAna2d : A4..A0 "< tol || val[nbsol]<-tol) { PbPossible = Standard_True; } nbsol++; } if(nbp & 1) PbPossible = Standard_True; } else { PbPossible = Standard_True; } //-- On recherche le plus petit coeff entre A4 et A0 if(PbPossible) { // Modified by Sergey KHROMOV - Thu Oct 24 12:45:35 2002 Begin Standard_Real anAMin = RealLast(); Standard_Real anAMax = -1; Standard_Real anEps = RealEpsilon(); for (i = 0; i < 5; i++) { anAMin = Min(anAMin, Max(anAA[i], anEps)); anAMax = Max(anAMax, Max(anAA[i], anEps)); } anEps = Min(1.e-4, Epsilon(1000.*anAMax/anAMin)); // Modified by Sergey KHROMOV - Thu Oct 24 15:46:24 2002 End math_DirectPolynomialRoots MATH_A4321(A4,A3,A2,A1); if(MATH_A4321.IsDone()) { nbp = MATH_A4321.NbSolutions(); //-- On Ajoute les valeurs au tableau for(i=1;i<=nbp;i++) { Standard_Real x = MATH_A4321.Value(i); Standard_Boolean Add = Standard_True; for(j=0;j4) { same=1; nbsol=0; } } MyDirectPolynomialRoots::MyDirectPolynomialRoots(const Standard_Real A2, const Standard_Real A1, const Standard_Real A0) { //-- cout<<" IntAna2d : A2..A0 "<1;i--) { Standard_Boolean Non_Egalite=Standard_True; for(j=i-1;(j>0) && Non_Egalite;j--) { // <--- Deja Teste ---> // | 1 |2 | | J | |I-1| I |I+1| |NPTS| // | 1 |2 | | J | |I-1|XXX|I+1| |NPTS| // | 1 |2 | | J | |I-1|I+1|I+2| |NPTS| if(Points_Confondus(pts[i-1].Value().X(), pts[i-1].Value().Y(), pts[j-1].Value().X(), pts[j-1].Value().Y())) { Standard_Integer k; Non_Egalite=Standard_False; for(k=i;k