OpenGV
A library for solving calibrated central and non-central geometric vision problems
opengv::math::Sturm Class Reference

#include <Sturm.hpp>

Public Member Functions

 Sturm (const Eigen::MatrixXd &p)
 Contructor. More...
 
 Sturm (const std::vector< double > &p)
 Contructor. More...
 
virtual ~Sturm ()
 Destructor.
 
void findRoots2 (std::vector< double > &roots, double eps_x=0.001, double eps_val=0.001)
 
std::vector< double > findRoots ()
 Finds the roots of the polynomial. More...
 
void bracketRoots (std::vector< double > &roots, double eps=-1.0)
 Finds brackets for the real roots of the polynomial. More...
 
size_t evaluateChain (double bound)
 Evaluates the Sturm chain at a single bound. More...
 
size_t evaluateChain2 (double bound)
 Evaluates the Sturm chain at a single bound. More...
 
double computeLagrangianBound ()
 Composes an initial bracket for all the roots of the polynomial. More...
 

Public Attributes

EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef std::pair< double, double > bracket_t
 

Detailed Description

Sturm is initialized over polynomials of arbitrary order, and used to compute the real roots of the polynomial.

Constructor & Destructor Documentation

opengv::math::Sturm::Sturm ( const Eigen::MatrixXd &  p)

Contructor.

Parameters
[in]pThe polynomial coefficients (poly = p(0,0)*x^n + p(0,1)*x^(n-1) ...).
opengv::math::Sturm::Sturm ( const std::vector< double > &  p)

Contructor.

Parameters
[in]pThe polynomial coefficients (poly = p[0]*x^n + p[1]*x^(n-1) ...).

Member Function Documentation

void opengv::math::Sturm::bracketRoots ( std::vector< double > &  roots,
double  eps = -1.0 
)

Finds brackets for the real roots of the polynomial.

Returns
A list of brackets for the real roots of the polynomial.
double opengv::math::Sturm::computeLagrangianBound ( )

Composes an initial bracket for all the roots of the polynomial.

Returns
The maximum of the absolute values of the bracket-values (That's what the Lagrangian bound is able to find).
size_t opengv::math::Sturm::evaluateChain ( double  bound)

Evaluates the Sturm chain at a single bound.

Parameters
[in]boundThe bound.
Returns
The number of sign changes on the bound.
size_t opengv::math::Sturm::evaluateChain2 ( double  bound)

Evaluates the Sturm chain at a single bound.

Parameters
[in]boundThe bound.
Returns
The number of sign changes on the bound.
std::vector<double> opengv::math::Sturm::findRoots ( )

Finds the roots of the polynomial.

Returns
An array with the real roots of the polynomial.

Member Data Documentation

EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef std::pair<double,double> opengv::math::Sturm::bracket_t

A pair of values bracketing a real root


The documentation for this class was generated from the following file: