Changeset 385 for trunk/lib/statistics/Polynomial.h
 Timestamp:
 Aug 13, 2005, 11:24:18 AM (16 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/lib/statistics/Polynomial.h
r383 r385 26 26 /// 27 27 /// 28 Polynomial(gslapi::matrix&,size_t); 28 inline Polynomial(size_t power) 29 : OneDimensional(), chisquare_(0), 30 covariance_(gslapi::matrix(power+1,power+1)), 31 fit_parameters_(gslapi::vector(power+1)), work_(NULL) {} 29 32 30 33 /// … … 36 39 /// 37 40 /// 38 int fit(void) 39 { return gsl_multifit_linear(X_.gsl_matrix_pointer(), 40 target_.TEMP_gsl_vector_pointer(), 41 fit_parameters_.TEMP_gsl_vector_pointer(), 42 covariance_.gsl_matrix_pointer(), 43 &chisquare_,work_); } 41 void fit(const gslapi::vector& x, const gslapi::vector& y); 44 42 45 43 /// … … 48 46 gslapi::vector fit_parameters(void) { return fit_parameters_; } 49 47 48 inline void fit(const gslapi::vector& x, const gslapi::vector& y, 49 const gslapi::vector& w) { assert(0); } 50 51 inline void predict(const double x, double& y, double& y_err, 52 const double w=1) { assert(0); } 53 54 inline std::ostream& print(std::ostream& s) const 55 { assert(0); return s; } 56 57 inline std::ostream& print_header(std::ostream& s) const 58 { assert(0); return s; } 59 50 60 51 61 private: … … 53 63 gslapi::matrix covariance_; 54 64 gslapi::vector fit_parameters_; 55 gslapi::vector target_;56 65 gsl_multifit_linear_workspace* work_; 57 66 gslapi::matrix X_; // matrix of predictor variables in GSL language
Note: See TracChangeset
for help on using the changeset viewer.