Files Classes Functions Hierarchy
#include <leastsqrs.h>
Public Member Functions | |
| leastsqrs (vector< pt2 > const &pts_, double const alpha_=1.0, double const beta_=1.0) | |
| ~leastsqrs () | |
| void | operator() (double &fval) |
Public Attributes | |
| double | alpha |
| The weight of the change in y. | |
| double | beta |
| The weight of the line length. | |
| double * | xi |
| The varying y coordinate state. | |
Minimize the y coordinate of each point. alpha * distance(pts[i].y-x[i])
Minimize the straight line segment lengths. beta * dist(pts[i+1],pts[i])
Definition at line 19 of file leastsqrs.h.
| leastsqrs::leastsqrs | ( | vector< pt2 > const & | pts_, | |
| double const | alpha_ = 1.0, |
|||
| double const | beta_ = 1.0 | |||
| ) |
| leastsqrs::~leastsqrs | ( | ) |
| void leastsqrs::operator() | ( | double & | fval | ) |
Definition at line 17 of file leastsqrs.cpp.
References pts.
00020 { 00021 fval=0.0; 00022 double z; 00023 for (uint i=0; i<size; ++i) 00024 { 00025 z = pts[i].y-xi[i]; 00026 fval += alpha*z*z; 00027 } 00028 for (uint i=0; i<size-1; ++i) 00029 { 00030 z = (pts[i].x-pts[i+1].x); //can remove 00031 fval += beta*z*z; 00032 z = xi[i+1]-xi[i]; 00033 fval += beta*z*z; 00034 } 00035 }
| double leastsqrs::alpha |
| double leastsqrs::beta |
| double* leastsqrs::xi |
The varying y coordinate state.
Definition at line 31 of file leastsqrs.h.
Referenced by ~leastsqrs().
1.5.8