source: trunk/test/test_inputranker.cc @ 151

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

.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 717 bytes
Line 
1// $Id: test_inputranker.cc 151 2004-09-09 16:24:23Z peter $
2
3// C++ tools include
4////////////////////
5#include "InputRanker.h"
6
7#include "ROC.h"
8
9// Standard includes
10////////////////////
11#include <cstdlib>
12#include <fstream>
13#include <iostream>
14//#include <vector>
15
16using namespace std;
17
18int main()
19{ 
20  ifstream is("data/rank_data.txt");
21  theplu::gslapi::matrix data(is);
22  is.close();
23
24  is.open("data/rank_target.txt");
25  theplu::gslapi::vector target(is);
26  is.close();
27
28  theplu::cpptools::ROC roc;
29  theplu::cpptools::InputRanker ir(data,target,roc);
30
31  if (ir.id(0)!=2 || ir.id(1)!=0 || ir.id(2)!=1){
32    cerr << "wrong id" << endl;
33    return -1;
34  }
35 
36  if (ir.rank(0)!=1 || ir.rank(1)!=2 || ir.rank(2)!=0){
37    cerr << "wrong rank" << endl;
38    return -1;
39  }
40 
41  return 0;
42}
Note: See TracBrowser for help on using the repository browser.