NeoPZ
pzpolynomial.h
Go to the documentation of this file.
1 
6 #ifndef TPZPOLYNOMIAL_H
7 #define TPZPOLYNOMIAL_H
8 
9 #include <iostream>
10 #include <cmath>
11 
12 #include "pzvec.h"
13 #include "pznumeric.h"
14 
20 public:
22  TPZPolynomial();
23 
25  TPZPolynomial(const TPZVec<REAL> &coef, const REAL &tol);
26 
28  TPZPolynomial(const TPZVec<REAL> &coef);
29 
31  void SetTolerance(const REAL &tol);
32 
34  void GetTolerance(REAL & tol);
35 
37  void SetCoef(const REAL &c0, const REAL &c1, const REAL &c2, const REAL &c3);
38 
40  void SetCoef(const TPZVec<REAL> &coef);
41 
43  int GetRoots(const TPZVec<REAL> &coef, TPZVec<REAL> &r);
44 
46  int GetRoots(TPZVec<REAL> &r);
47 
49  int Tartaglia(const TPZVec<REAL> &coef, TPZVec<REAL> &real, REAL &imagem);
50 
51 private:
53  int SetRoots();
54 
56  REAL fTolerance;
57 
60 
63  REAL fImagem;
64 };
65 
66 #endif
Implements a polynomial. Utility.
Definition: pzpolynomial.h:19
TPZVec< REAL > fReal
Roots of the polynomial.
Definition: pzpolynomial.h:62
void GetTolerance(REAL &tol)
Gets the tolerance value.
TPZVec< REAL > fCo
Polynomial coefficients.
Definition: pzpolynomial.h:59
Templated vector implementation.
void SetCoef(const REAL &c0, const REAL &c1, const REAL &c2, const REAL &c3)
Sets up four coefficients to polynomial.
static const double tol
Definition: pzgeoprism.cpp:23
REAL fTolerance
Tolerance value to computes.
Definition: pzpolynomial.h:56
TPZPolynomial()
Default constructor.
int SetRoots()
Computes the roots of the polynomial and stores into the fReal.
int GetRoots(const TPZVec< REAL > &coef, TPZVec< REAL > &r)
On given coefficients computes the roots of the polynomial in r.
void SetTolerance(const REAL &tol)
Sets the tolerance value to computes.
Contains declaration of the TPZNumeric class which implements several methods to calculation.
int Tartaglia(const TPZVec< REAL > &coef, TPZVec< REAL > &real, REAL &imagem)
Computes the roots of the cubic polynomial using Tartaglia method (until 3 degree) ...