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 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
58class VTKCOMMONMATH_EXPORT vtkPolynomialSolversUnivariate : public vtkObject
59{
60public:
63 void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
64 static ostream& PrintPolynomial( ostream& os, double* P, int degP );
65
67
107 double* P, int d, double* a, double* upperBnds, double tol );
109 double* P, int d, double* a, double* upperBnds, double tol,
110 int intervalType );
112 double* P, int d, double* a, double* upperBnds, double tol,
113 int intervalType, bool divideGCD );
115
117
148 double* P, int d, double* a, double* upperBnds, double tol );
150 double* P, int d, double* a, double* upperBnds, double tol,
151 int intervalType );
153 double* P, int d, double* a, double* upperBnds, double tol,
154 int intervalType, bool divideGCD );
156
164 static int FilterRoots(
165 double* P, int d, double *upperBnds, int rootcount, double diameter );
166
178 static int LinBairstowSolve( double* c, int d, double* r, double& tolerance );
179
190 static int FerrariSolve( double* c, double* r, int* m, double tol );
191
207 static int TartagliaCardanSolve( double* c, double* r, int* m, double tol );
208
217 static double* SolveCubic(double c0, double c1, double c2, double c3);
218
227 static double* SolveQuadratic(double c0, double c1, double c2);
228
234 static double* SolveLinear(double c0, double c1);
235
249 static int SolveCubic(double c0, double c1, double c2, double c3,
250 double *r1, double *r2, double *r3, int *num_roots);
251
259 static int SolveQuadratic(double c0, double c1, double c2,
260 double *r1, double *r2, int *num_roots);
261
269 static int SolveQuadratic( double* c, double* r, int* m );
270
277 static int SolveLinear(double c0, double c1, double *r1, int *num_roots);
278
280
286 static void SetDivisionTolerance( double tol );
287 static double GetDivisionTolerance();
289
290protected:
293
294 static double DivisionTolerance;
295
296private:
298 void operator=(const vtkPolynomialSolversUnivariate&) VTK_DELETE_FUNCTION;
299};
300
301#endif
a simple class to control print indentation
Definition: vtkIndent.h:40
abstract base class for most VTK objects
Definition: vtkObject.h:60
static double * SolveCubic(double c0, double c1, double c2, double c3)
Solves a cubic equation c0*t^3 + c1*t^2 + c2*t + c3 = 0 when c0, c1, c2, and c3 are REAL.
static int HabichtBisectionSolve(double *P, int d, double *a, double *upperBnds, double tol, int intervalType, bool divideGCD)
static int FilterRoots(double *P, int d, double *upperBnds, int rootcount, double diameter)
This uses the derivative sequence to filter possible roots of a polynomial.
static int LinBairstowSolve(double *c, int d, double *r, double &tolerance)
Seeks all REAL roots of the d -th degree polynomial c[0] X^d + ... + c[d-1] X + c[d] = 0 equation Lin...
static int SolveCubic(double c0, double c1, double c2, double c3, double *r1, double *r2, double *r3, int *num_roots)
Solves a cubic equation when c0, c1, c2, And c3 Are REAL.
static int FerrariSolve(double *c, double *r, int *m, double tol)
Algebraically extracts REAL roots of the quartic polynomial with REAL coefficients X^4 + c[0] X^3 + c...
static int SturmBisectionSolve(double *P, int d, double *a, double *upperBnds, double tol, int intervalType)
static void SetDivisionTolerance(double tol)
Set/get the tolerance used when performing polynomial Euclidean division to find polynomial roots.
static double * SolveLinear(double c0, double c1)
Solves a linear equation c2*t + c3 = 0 when c2 and c3 are REAL.
static int SolveLinear(double c0, double c1, double *r1, int *num_roots)
Solves a linear equation c2*t + c3 = 0 when c2 and c3 are REAL.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static int SturmBisectionSolve(double *P, int d, double *a, double *upperBnds, double tol, int intervalType, bool divideGCD)
static int SolveQuadratic(double *c, double *r, int *m)
Algebraically extracts REAL roots of the quadratic polynomial with REAL coefficients c[0] X^2 + c[1] ...
static int TartagliaCardanSolve(double *c, double *r, int *m, double tol)
Algebraically extracts REAL roots of the cubic polynomial with REAL coefficients X^3 + c[0] X^2 + c[1...
static double GetDivisionTolerance()
static ostream & PrintPolynomial(ostream &os, double *P, int degP)
static int HabichtBisectionSolve(double *P, int d, double *a, double *upperBnds, double tol)
Finds all REAL roots (within tolerance tol) of the d -th degree polynomial.
static int SturmBisectionSolve(double *P, int d, double *a, double *upperBnds, double tol)
Finds all REAL roots (within tolerance tol) of the d -th degree polynomial P[0] X^d + ....
static int HabichtBisectionSolve(double *P, int d, double *a, double *upperBnds, double tol, int intervalType)
static double * SolveQuadratic(double c0, double c1, double c2)
Solves a quadratic equation c1*t^2 + c2*t + c3 = 0 when c1, c2, and c3 are REAL.
static int SolveQuadratic(double c0, double c1, double c2, double *r1, double *r2, int *num_roots)
Solves a quadratic equation c1*t^2 + c2*t + c3 = 0 when c1, c2, and c3 are REAL.
static vtkPolynomialSolversUnivariate * New()