source: trunk/yat/classifier/Sampler.cc @ 720

Last change on this file since 720 was 720, checked in by Jari Häkkinen, 15 years ago

Fixes #170. Almost all inlines removed, some classes have no cc file.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1.7 KB
Line 
1// $Id: Sampler.cc 720 2006-12-26 18:21:36Z jari $
2
3/*
4  Copyright (C) 2006 Peter Johansson
5
6  This file is part of the yat library, http://lev.thep.lu.se/trac/yat
7
8  The yat library is free software; you can redistribute it and/or
9  modify it under the terms of the GNU General Public License as
10  published by the Free Software Foundation; either version 2 of the
11  License, or (at your option) any later version.
12
13  The yat library is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  General Public License for more details.
17
18  You should have received a copy of the GNU General Public License
19  along with this program; if not, write to the Free Software
20  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
21  02111-1307, USA.
22*/
23
24#include "Sampler.h"
25#include "Target.h"
26
27namespace theplu {
28namespace yat {
29namespace classifier { 
30
31  Sampler::Sampler(const Target& target)
32    : target_(target)
33  { 
34  }
35
36  Sampler::~Sampler()
37  { 
38  }
39
40  u_long Sampler::size(void) const
41  {
42    return training_index_.size();
43  }
44
45  const Target& Sampler::target(void) const
46  {
47    return target_;
48  }
49
50  const std::vector<size_t>&
51  Sampler::training_index(std::vector<size_t>::size_type i) const
52  {
53    return training_index_[i];
54  }
55
56  const Target& 
57  Sampler::training_target(std::vector<Target>::size_type i) const 
58  {
59    return training_target_[i];
60  }
61
62  const std::vector<size_t>& 
63  Sampler::validation_index(std::vector<size_t>::size_type i) const
64  {
65    return validation_index_[i];
66  }
67
68  const Target& 
69  Sampler::validation_target(std::vector<Target>::size_type i) const 
70  {
71    return validation_target_[i];
72  }
73
74}}} // of namespace classifier, yat, and theplu
Note: See TracBrowser for help on using the repository browser.