VTK
vtkPolynomialSolversUnivariate.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkPolynomialSolversUnivariate.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================
15  Copyright 2007 Sandia Corporation.
16  Under the terms of Contract DE-AC04-94AL85000, there is a non-exclusive
17  license for use of this work by or on behalf of the
18  U.S. Government. Redistribution and use in source and binary forms, with
19  or without modification, are permitted provided that this Notice and any
20  statement of authorship are reproduced on all copies.
21 
22  Contact: pppebay@sandia.gov,dcthomp@sandia.gov
23 
24 =========================================================================*/
51 #ifndef __vtkPolynomialSolversUnivariate_h
52 #define __vtkPolynomialSolversUnivariate_h
53 
54 #include "vtkObject.h"
55 
57 {
58 public:
61  void PrintSelf(ostream& os, vtkIndent indent);
62  static ostream& PrintPolynomial( ostream& os, double* P, int degP );
63 
65 
92  static int HabichtBisectionSolve(
93  double* P, int d, double* a, double* upperBnds, double tol );
94  static int HabichtBisectionSolve(
95  double* P, int d, double* a, double* upperBnds, double tol,
96  int intervalType );
97  static int HabichtBisectionSolve(
98  double* P, int d, double* a, double* upperBnds, double tol,
99  int intervalType, bool divideGCD );
101 
103 
124  static int SturmBisectionSolve(
125  double* P, int d, double* a, double* upperBnds, double tol );
126  static int SturmBisectionSolve(
127  double* P, int d, double* a, double* upperBnds, double tol,
128  int intervalType );
129  static int SturmBisectionSolve(
130  double* P, int d, double* a, double* upperBnds, double tol,
131  int intervalType, bool divideGCD );
133 
135 
140  static int FilterRoots(
141  double* P, int d, double *upperBnds, int rootcount, double diameter );
143 
152  static int LinBairstowSolve( double* c, int d, double* r, double& tolerance );
153 
162  static int FerrariSolve( double* c, double* r, int* m, double tol );
163 
176  static int TartagliaCardanSolve( double* c, double* r, int* m, double tol );
177 
184  static double* SolveCubic(double c0, double c1, double c2, double c3);
185 
192  static double* SolveQuadratic(double c0, double c1, double c2);
193 
197  static double* SolveLinear(double c0, double c1);
198 
200 
211  static int SolveCubic(double c0, double c1, double c2, double c3,
212  double *r1, double *r2, double *r3, int *num_roots);
214 
216 
220  static int SolveQuadratic(double c0, double c1, double c2,
221  double *r1, double *r2, int *num_roots);
223 
229  static int SolveQuadratic( double* c, double* r, int* m );
230 
235  static int SolveLinear(double c0, double c1, double *r1, int *num_roots);
236 
238 
242  static void SetDivisionTolerance( double tol );
243  static double GetDivisionTolerance();
245 
246 protected:
249 
250  static double DivisionTolerance;
251 
252 private:
254  void operator=(const vtkPolynomialSolversUnivariate&); // Not implemented.
255 };
256 
257 #ifndef DBL_EPSILON
258 # define VTK_DBL_EPSILON 2.2204460492503131e-16
259 #else // DBL_EPSILON
260 # define VTK_DBL_EPSILON DBL_EPSILON
261 #endif // DBL_EPSILON
262 
263 #ifndef DBL_MIN
264 # define VTK_DBL_MIN 2.2250738585072014e-308
265 #else // DBL_MIN
266 # define VTK_DBL_MIN DBL_MIN
267 #endif // DBL_MIN
268 
269 #endif
abstract base class for most VTK objects
Definition: vtkObject.h:60
virtual void PrintSelf(ostream &os, vtkIndent indent)
a simple class to control print indentation
Definition: vtkIndent.h:37
#define VTK_COMMON_EXPORT
static vtkObject * New()