PICCANTE  0.4
The hottest HDR imaging library!
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
pic::Polynomial Class Reference

#include <polynomial.hpp>

Public Member Functions

 Polynomial ()
 Polynomial. More...
 
 Polynomial (int nCoeff)
 Polynomial. More...
 
 Polynomial (float *coeff, int nCoeff)
 coeffnomial More...
 
 ~Polynomial ()
 
void computeAllCoeffPositive ()
 computeAllCoeffPositive More...
 
void print ()
 print More...
 
std::string toString ()
 
float * getArray (float *ret)
 getArray More...
 
float eval (float x)
 eval More...
 
float dEval (float x)
 dEval More...
 
void fit (std::vector< float > &x, std::vector< float > &y, int n)
 fit More...
 
void normalForm ()
 normalForm More...
 
Polynomial horner (float d, float &remainder)
 horner More...
 
bool getRoots (float *x)
 getRoots More...
 
bool getAllRoots (float *x)
 getAllRoots More...
 

Static Public Member Functions

static bool getQuarticRoots (float *p, float *x)
 getQuarticRoots –> MANDATORY p[5] == 1.0 More...
 
static bool getSecondOrderRoots (float a, float b, float c, float *x0, float *x1)
 getSecondOrderRoots solves second order equations, ax^2 + b x + c = 0 More...
 
static bool getSecondOrderRootsS (float a, float b, float c, float *x0, float *x1)
 getSecondOrderRootsS solves second order equations, ax^2 + 2 b x + c = 0; i.e., 2 b is even! More...
 

Public Attributes

std::vector< float > coeff
 
bool all_coeff_positive
 

Constructor & Destructor Documentation

◆ Polynomial() [1/3]

pic::Polynomial::Polynomial ( )
inline

◆ Polynomial() [2/3]

pic::Polynomial::Polynomial ( int  nCoeff)
inline

Polynomial.

Parameters
nCoeff

◆ Polynomial() [3/3]

pic::Polynomial::Polynomial ( float *  coeff,
int  nCoeff 
)
inline

coeffnomial

Parameters
coeff
nCoeff

◆ ~Polynomial()

pic::Polynomial::~Polynomial ( )
inline

Member Function Documentation

◆ computeAllCoeffPositive()

void pic::Polynomial::computeAllCoeffPositive ( )
inline

computeAllCoeffPositive

◆ dEval()

float pic::Polynomial::dEval ( float  x)
inline

dEval

Parameters
t
Returns

◆ eval()

float pic::Polynomial::eval ( float  x)
inline

eval

Parameters
x
Returns

◆ fit()

void pic::Polynomial::fit ( std::vector< float > &  x,
std::vector< float > &  y,
int  n 
)
inline

fit

Parameters
x
y
n

◆ getAllRoots()

bool pic::Polynomial::getAllRoots ( float *  x)
inline

getAllRoots

Parameters
x
Returns

◆ getArray()

float* pic::Polynomial::getArray ( float *  ret)
inline

getArray

Returns

◆ getQuarticRoots()

static bool pic::Polynomial::getQuarticRoots ( float *  p,
float *  x 
)
inlinestatic

getQuarticRoots –> MANDATORY p[5] == 1.0

Parameters
p
x
Returns

◆ getRoots()

bool pic::Polynomial::getRoots ( float *  x)
inline

getRoots

Parameters
x
Returns

◆ getSecondOrderRoots()

static bool pic::Polynomial::getSecondOrderRoots ( float  a,
float  b,
float  c,
float *  x0,
float *  x1 
)
inlinestatic

getSecondOrderRoots solves second order equations, ax^2 + b x + c = 0

Parameters
ais the a coefficient
bis the b coefficient
cis the c coefficient
x0is the first zero
x1is the second zero
Returns
It returns true, if x0 and x1 have a real value, false otherwise

◆ getSecondOrderRootsS()

static bool pic::Polynomial::getSecondOrderRootsS ( float  a,
float  b,
float  c,
float *  x0,
float *  x1 
)
inlinestatic

getSecondOrderRootsS solves second order equations, ax^2 + 2 b x + c = 0; i.e., 2 b is even!

Parameters
ais the a coefficient
bis the b coefficient
cis the c coefficient
x0is the first zero
x1is the second zero
Returns
It returns true, if x0 and x1 have a real value, false otherwise

◆ horner()

Polynomial pic::Polynomial::horner ( float  d,
float &  remainder 
)
inline

horner

Parameters
d
remainder
Returns

◆ normalForm()

void pic::Polynomial::normalForm ( )
inline

normalForm

◆ print()

void pic::Polynomial::print ( )
inline

print

◆ toString()

std::string pic::Polynomial::toString ( )
inline

Member Data Documentation

◆ all_coeff_positive

bool pic::Polynomial::all_coeff_positive

◆ coeff

std::vector<float> pic::Polynomial::coeff

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