libcrn  3.9.5
A document image processing library
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | List of all members
crn::PolynomialRegression Class Reference

Polynomial regression. More...

#include <CRNPolynomialRegression.h>

+ Inheritance diagram for crn::PolynomialRegression:
+ Collaboration diagram for crn::PolynomialRegression:

Public Types

enum  Extrapolation { Extrapolation::LINEAR, Extrapolation::POLY }
 Extrapolation modes. More...
 

Public Member Functions

template<typename Iter >
 PolynomialRegression (Iter beg, Iter en, size_t dim)
 Constructor from a list of points. More...
 
 PolynomialRegression (const PolynomialRegression &)=default
 
 PolynomialRegression (PolynomialRegression &&)=default
 
PolynomialRegressionoperator= (const PolynomialRegression &)=default
 
PolynomialRegressionoperator= (PolynomialRegression &&)=default
 
virtual ~PolynomialRegression () override
 
void SetExtrapolationMode (Extrapolation ex) noexcept
 Sets the behaviour for points before the first control point and after the last control point. More...
 
void TranslateY (int increment)
 Translates the polynomial. More...
 
virtual double operator[] (double x) const override
 Gets ordinate at x (double) More...
 
size_t GetDimension () const noexcept
 Returns the dimension of the polynomial. More...
 
const std::vector
< crn::Point2DDouble > & 
GetData () const noexcept
 Access to the sorted control point. More...
 
const std::vector< double > & GetCoefficients () const noexcept
 Access to the coefficients of the polynomial. More...
 
- Public Member Functions inherited from crn::Cartesian2DFunction
virtual ~Cartesian2DFunction () override
 
virtual int operator[] (int x) const
 Gets ordinate at x. More...
 
- Public Member Functions inherited from crn::Object
virtual ~Object ()=default
 

Detailed Description

Polynomial regression.

Creates a polynomial function representing a cloud of points.

Version
1.0
Author
Yann LEYDIER
Date
Sep 2011

Definition at line 40 of file CRNPolynomialRegression.h.

Member Enumeration Documentation

Extrapolation modes.

Enumerator
LINEAR 
POLY 

Definition at line 44 of file CRNPolynomialRegression.h.

Constructor & Destructor Documentation

template<typename Iter >
crn::PolynomialRegression::PolynomialRegression ( Iter  beg,
Iter  en,
size_t  dim 
)
inline

Constructor from a list of points.

Exceptions
crn::ExceptionDomainthe order of the polynomial is null
crn::ExceptionDimensionnot enough samples
Parameters
[in]begthe first element
[in]enthe element after the last
[in]dimthe dimension of the regression polynomial

Definition at line 53 of file CRNPolynomialRegression.h.

crn::PolynomialRegression::PolynomialRegression ( const PolynomialRegression )
default
crn::PolynomialRegression::PolynomialRegression ( PolynomialRegression &&  )
default
virtual crn::PolynomialRegression::~PolynomialRegression ( )
inlineoverridevirtual

Definition at line 72 of file CRNPolynomialRegression.h.

Member Function Documentation

const std::vector<double>& crn::PolynomialRegression::GetCoefficients ( ) const
inlinenoexcept

Access to the coefficients of the polynomial.

Definition at line 90 of file CRNPolynomialRegression.h.

const std::vector<crn::Point2DDouble>& crn::PolynomialRegression::GetData ( ) const
inlinenoexcept

Access to the sorted control point.

Definition at line 88 of file CRNPolynomialRegression.h.

size_t crn::PolynomialRegression::GetDimension ( ) const
inlinenoexcept

Returns the dimension of the polynomial.

Definition at line 86 of file CRNPolynomialRegression.h.

PolynomialRegression& crn::PolynomialRegression::operator= ( const PolynomialRegression )
default
PolynomialRegression& crn::PolynomialRegression::operator= ( PolynomialRegression &&  )
default
double PolynomialRegression::operator[] ( double  x) const
overridevirtual

Gets ordinate at x (double)

Implements crn::Cartesian2DFunction.

Definition at line 70 of file CRNPolynomialRegression.cpp.

void crn::PolynomialRegression::SetExtrapolationMode ( Extrapolation  ex)
inlinenoexcept

Sets the behaviour for points before the first control point and after the last control point.

Definition at line 75 of file CRNPolynomialRegression.h.

void PolynomialRegression::TranslateY ( int  increment)

Translates the polynomial.

Translates the polynomial

Parameters
[in]incrementthe vertical shift

Definition at line 31 of file CRNPolynomialRegression.cpp.


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