Changeset 253
- Timestamp:
- Mar 3, 2005, 12:08:37 PM (18 years ago)
- Location:
- trunk/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/RegressionLinear.h
r235 r253 89 89 y = alpha_ + beta_ * (x-m_x_); 90 90 y_err = sqrt( alpha_var_+beta_var_*(x-m_x_)*(x-m_x_)+s2_/w ); 91 x_=x; 92 y_=y; 93 y_err_=y_err; 91 94 } 92 95 -
trunk/src/RegressionLocal.cc
r245 r253 19 19 } 20 20 21 void RegressionLocal::fit(const double f, const u_int step_size) 21 void RegressionLocal::fit(std::ostream& s, const double f, 22 const u_int step_size) 22 23 { 23 24 sort(data_.begin(), data_.end()); 25 regressor_->print_header(s); 26 s << std::endl; 24 27 25 28 // number of points on each side … … 52 55 } 53 56 54 55 57 // copying data 56 58 // Peter, too much copying. Move the copying outside loop and … … 77 79 regressor_->predict(x_[x_.size()-1], y_[y_.size()-1], 78 80 y_err_[y_err_.size()-1]); 81 regressor_->print(s); 82 s << std::endl; 79 83 } 80 84 } 81 85 82 std::ostream& RegressionLocal::print(std::ostream& s) const83 {84 for (size_t i=0; i<x_.size(); i++) {85 regressor_->print(s);86 s << std::endl;87 }88 return s;89 }90 86 91 87 -
trunk/src/RegressionLocal.h
r235 r253 75 75 /// data points are used and the point where the fit is done is in 76 76 /// the middle. Starting with the smallest x, the function jumps 77 /// \a step_size point in each iteration to do the next fit 77 /// \a step_size point in each iteration to do the next 78 /// fit. Result is sent to ostream \a s. 78 79 /// 79 void fit( const double fraction, const u_int step_size=1);80 void fit(std::ostream& s, const double fraction, const u_int step_size=1); 80 81 81 /// 82 /// @return prediction values and parameters 83 /// 84 std::ostream& print(std::ostream&) const; 85 86 /// 87 /// @return header for print() 88 /// 89 inline std::ostream& print_header(std::ostream& s) const 90 { return regressor_->print_header(s); } 82 91 83 92 84
Note: See TracChangeset
for help on using the changeset viewer.