VTK  9.2.6
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 2011 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 =========================================================================*/
52 #ifndef vtkPolynomialSolversUnivariate_h
53 #define vtkPolynomialSolversUnivariate_h
54 
55 #include "vtkCommonMathModule.h" // For export macro
56 #include "vtkObject.h"
57 
58 class VTKCOMMONMATH_EXPORT vtkPolynomialSolversUnivariate : public vtkObject
59 {
60 public:
63  void PrintSelf(ostream& os, vtkIndent indent) override;
64  static ostream& PrintPolynomial(ostream& os, double* P, int degP);
65 
67 
106  static int HabichtBisectionSolve(double* P, int d, double* a, double* upperBnds, double tol);
107  static int HabichtBisectionSolve(
108  double* P, int d, double* a, double* upperBnds, double tol, int intervalType);
109  static int HabichtBisectionSolve(
110  double* P, int d, double* a, double* upperBnds, double tol, int intervalType, bool divideGCD);
112 
114 
144  static int SturmBisectionSolve(double* P, int d, double* a, double* upperBnds, double tol);
145  static int SturmBisectionSolve(
146  double* P, int d, double* a, double* upperBnds, double tol, int intervalType);
147  static int SturmBisectionSolve(
148  double* P, int d, double* a, double* upperBnds, double tol, int intervalType, bool divideGCD);
150 
158  static int FilterRoots(double* P, int d, double* upperBnds, int rootcount, double diameter);
159 
171  static int LinBairstowSolve(double* c, int d, double* r, double& tolerance);
172 
183  static int FerrariSolve(double* c, double* r, int* m, double tol);
184 
200  static int TartagliaCardanSolve(double* c, double* r, int* m, double tol);
201 
210  static double* SolveCubic(double c0, double c1, double c2, double c3);
211 
220  static double* SolveQuadratic(double c0, double c1, double c2);
221 
227  static double* SolveLinear(double c0, double c1);
228 
242  static int SolveCubic(
243  double c0, double c1, double c2, double c3, double* r1, double* r2, double* r3, int* num_roots);
244 
252  static int SolveQuadratic(
253  double c0, double c1, double c2, double* r1, double* r2, int* num_roots);
254 
262  static int SolveQuadratic(double* c, double* r, int* m);
263 
270  static int SolveLinear(double c0, double c1, double* r1, int* num_roots);
271 
273 
279  static void SetDivisionTolerance(double tol);
280  static double GetDivisionTolerance();
282 
283 protected:
284  vtkPolynomialSolversUnivariate() = default;
285  ~vtkPolynomialSolversUnivariate() override = default;
286 
287  static double DivisionTolerance;
288 
289 private:
291  void operator=(const vtkPolynomialSolversUnivariate&) = delete;
292 };
293 
294 #endif
abstract base class for most VTK objects
Definition: vtkObject.h:62
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
a simple class to control print indentation
Definition: vtkIndent.h:39
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...