ProteoWizard
Public Member Functions | Private Attributes | List of all members
pwiz::math::Parabola Class Reference

#include <Parabola.hpp>

Public Member Functions

 Parabola (double a=0, double b=0, double c=0)
 
 Parabola (std::vector< double > a)
 
 Parabola (const std::vector< std::pair< double, double > > &samples)
 
 Parabola (const std::vector< std::pair< double, double > > &samples, const std::vector< double > &weights)
 
std::vector< double > & coefficients ()
 
const std::vector< double > & coefficients () const
 
double operator() (double x) const
 
double center () const
 

Private Attributes

std::vector< double > a_
 

Detailed Description

Definition at line 37 of file Parabola.hpp.

Constructor & Destructor Documentation

pwiz::math::Parabola::Parabola ( double  a = 0,
double  b = 0,
double  c = 0 
)
pwiz::math::Parabola::Parabola ( std::vector< double >  a)
pwiz::math::Parabola::Parabola ( const std::vector< std::pair< double, double > > &  samples)
pwiz::math::Parabola::Parabola ( const std::vector< std::pair< double, double > > &  samples,
const std::vector< double > &  weights 
)

Member Function Documentation

std::vector<double>& pwiz::math::Parabola::coefficients ( )
inline

Definition at line 52 of file Parabola.hpp.

Referenced by testBasic(), testExactFit(), testLeastSquares(), and testWeightedLeastSquares().

52 {return a_;}
const std::vector<double>& pwiz::math::Parabola::coefficients ( ) const
inline

Definition at line 53 of file Parabola.hpp.

53 {return a_;}
double pwiz::math::Parabola::operator() ( double  x) const
inline

Definition at line 55 of file Parabola.hpp.

55 {return a_[0]*x*x + a_[1]*x + a_[2];}
double pwiz::math::Parabola::center ( ) const
inline

Definition at line 56 of file Parabola.hpp.

Referenced by testExactFit(), testLeastSquares(), and testWeightedLeastSquares().

56 {return -a_[1]/(2*a_[0]);}

Member Data Documentation

std::vector<double> pwiz::math::Parabola::a_
private

Definition at line 59 of file Parabola.hpp.


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