UNIVERS
15.3
UNIVERS base processing software API
|
Classes | |
struct | PolyCoeff |
Typedefs | |
typedef std::vector< PolyCoeff > | PolyCoeffs |
Functions | |
bool | getPoly (const vector< double > &x, const vector< double > &y, const vector< double > &w, PolyCoeffs &cfs) |
bool | getPoly (const vector< double > &x, const vector< double > &y, PolyCoeffs &cfs) |
double | calcPoly (const PolyCoeffs &coeffs, double x) |
double | ls_m_elem (size_t i, size_t j, const vector< double > &x, const vector< double > &w) |
double | ls_b_elem (size_t i, const vector< double > &x, const vector< double > &y, const vector< double > &w) |
Least squares. Functions return false if there is any error.
typedef std::vector<PolyCoeff> LeastSquares2D::PolyCoeffs |
Vector of coefficients
double LeastSquares2D::calcPoly | ( | const PolyCoeffs & | coeffs, |
double | x | ||
) |
Calculates polynom with given coefficients for x.
bool LeastSquares2D::getPoly | ( | const vector< double > & | x, |
const vector< double > & | y, | ||
const vector< double > & | w, | ||
PolyCoeffs & | cfs | ||
) |
Calculates polynomial coefficients for provided nodes (x,y) and weights w. Vector of coefficients should be predefined by number of polynomial coefficients in the form of y = cfs[0] + cfs[1]*x + cfs[1]*x^2 + ... Sizes of x,y and w should be equal and <= than size of cfs. If any coefficients are fixed, its values will be preserved after calculation. Return false on error.
bool LeastSquares2D::getPoly | ( | const vector< double > & | x, |
const vector< double > & | y, | ||
PolyCoeffs & | cfs | ||
) |
The same as above but without weights.