source: trunk/test/test_regression_local.cc @ 254

Last change on this file since 254 was 254, checked in by Peter, 17 years ago

modified to match new interface

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 682 bytes
Line 
1// $Id: test_regression_local.cc 254 2005-03-03 18:30:50Z peter $
2
3// C++ tools include
4////////////////////
5#include "RegressionKernelBox.h"
6#include "RegressionLinear.h"
7#include "RegressionLocal.h"
8#include "vector.h"
9
10#include <string>
11// Standard includes
12////////////////////
13#include <fstream>
14#include <iostream>
15#include <cmath>
16
17using namespace theplu;
18
19int main()
20
21{ 
22  bool ok=true;
23 
24  statistics::RegressionLinear r;
25  statistics::RegressionKernelBox k;
26  statistics::RegressionLocal rl(r,k);
27  for (size_t i=0; i<1000; i++){
28    double x = static_cast<double>(i)/100;
29    double y = sin(x);
30    rl.add(x, y);
31  }
32
33  std::string tmp = "tmp"; 
34  std::ofstream myout(tmp.c_str());
35  rl.fit(myout,0.1,1);
36   
37  if (ok)
38    return 0;
39  return -1;
40}
Note: See TracBrowser for help on using the repository browser.