source: trunk/lib/statistics/OneDimensional.cc @ 429

Last change on this file since 429 was 429, checked in by Peter, 16 years ago

separating weighted and non-weighted regression to different classes.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 577 bytes
Line 
1// $Id: OneDimensional.cc 429 2005-12-08 19:50:11Z peter $
2
3#include <c++_tools/statistics/OneDimensional.h>
4
5namespace theplu {
6namespace statistics {
7namespace regression {
8
9  std::ostream& OneDimensional::print(std::ostream& os,
10                                    const double min, 
11                                    double max, 
12                                    const u_int n) const
13  {
14    double dx;
15    if (n>1)
16      dx=(max-min)/(n-1);
17    else{
18      dx=1.0;
19      max=min;
20    }
21
22    double y,y_err;
23    for ( double x=min; x<=max; x+=dx) {
24      predict(x,y,y_err);
25      os << x << "\t" << y << "\t" << y_err << "\n";
26    }
27    return os;
28  }
29
30}}} // of namespaces regression, statisitcs and thep
Note: See TracBrowser for help on using the repository browser.