9 #ifndef IMPALGEBRA_PARABOLIC_FIT_H
10 #define IMPALGEBRA_PARABOLIC_FIT_H
14 #include <boost/serialization/access.hpp>
17 IMPALGEBRA_BEGIN_NAMESPACE
35 double get_a()
const {
return a_; }
38 double get_b()
const {
return b_; }
41 double get_c()
const {
return c_; }
44 out <<
"y = " << a_ <<
"x^2 + " << b_ <<
"x + " << c_ << std::endl;
45 out <<
"Error = " << error_ << std::endl;
49 void find_regression(
const Vector2Ds& data);
50 void evaluate_error(
const Vector2Ds& data);
56 friend class boost::serialization::access;
58 template<
class Archive>
void serialize(Archive &ar,
const unsigned int) {
59 ar & a_ & b_ & c_ & error_;
68 IMPALGEBRA_END_NAMESPACE
Base class for geometric types.
double get_b() const
get b value (b*x)
#define IMP_SHOWABLE_INLINE(Name, how_to_show)
Declare the methods needed by an object that can be printed.
Calculate parabola that fits best the input data points.
Vector< VectorD< 2 > > Vector2Ds
#define IMP_VALUES(Name, PluralName)
Define the type for storing sets of values.
Base class for geometric types.
double get_c() const
get c value (constant)
double get_fit_error() const
fit error
double get_a() const
get a value (a*x^2)