00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00051 #ifndef __vtkPolynomialSolversUnivariate_h
00052 #define __vtkPolynomialSolversUnivariate_h
00053
00054 #include "vtkObject.h"
00055
00056 class VTK_COMMON_EXPORT vtkPolynomialSolversUnivariate : public vtkObject
00057 {
00058 public:
00059 static vtkPolynomialSolversUnivariate *New();
00060 vtkTypeRevisionMacro(vtkPolynomialSolversUnivariate,vtkObject);
00061 void PrintSelf(ostream& os, vtkIndent indent);
00062 static ostream& PrintPolynomial( ostream& os, double* P, int degP );
00063
00065
00092 static int HabichtBisectionSolve(
00093 double* P, int d, double* a, double* upperBnds, double tol );
00094 static int HabichtBisectionSolve(
00095 double* P, int d, double* a, double* upperBnds, double tol,
00096 int intervalType );
00097 static int HabichtBisectionSolve(
00098 double* P, int d, double* a, double* upperBnds, double tol,
00099 int intervalType, bool divideGCD );
00101
00103
00124 static int SturmBisectionSolve(
00125 double* P, int d, double* a, double* upperBnds, double tol );
00126 static int SturmBisectionSolve(
00127 double* P, int d, double* a, double* upperBnds, double tol,
00128 int intervalType );
00129 static int SturmBisectionSolve(
00130 double* P, int d, double* a, double* upperBnds, double tol,
00131 int intervalType, bool divideGCD );
00133
00135
00140 static int FilterRoots(
00141 double* P, int d, double *upperBnds, int rootcount, double diameter );
00143
00152 static int LinBairstowSolve( double* c, int d, double* r, double& tolerance );
00153
00162 static int FerrariSolve( double* c, double* r, int* m, double tol );
00163
00176 static int TartagliaCardanSolve( double* c, double* r, int* m, double tol );
00177
00179
00183 static void SetDivisionTolerance( double tol );
00184 static double GetDivisionTolerance();
00186
00187 protected:
00188 vtkPolynomialSolversUnivariate() {};
00189 ~vtkPolynomialSolversUnivariate() {};
00190
00191 static double DivisionTolerance;
00192
00193 private:
00194 vtkPolynomialSolversUnivariate(const vtkPolynomialSolversUnivariate&);
00195 void operator=(const vtkPolynomialSolversUnivariate&);
00196 };
00197
00198 #ifndef DBL_EPSILON
00199 # define VTK_DBL_EPSILON 2.2204460492503131e-16
00200 #else // DBL_EPSILON
00201 # define VTK_DBL_EPSILON DBL_EPSILON
00202 #endif // DBL_EPSILON
00203
00204 #ifndef DBL_MIN
00205 # define VTK_DBL_MIN 2.2250738585072014e-308
00206 #else // DBL_MIN
00207 # define VTK_DBL_MIN DBL_MIN
00208 #endif // DBL_MIN
00209
00210 #endif