source: trunk/yat/classifier/utility.cc @ 779

Last change on this file since 779 was 779, checked in by Peter, 15 years ago

Refs #101

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date ID
File size: 1.5 KB
RevLine 
[581]1// $Id$
2
[675]3/*
4  Copyright (C) The authors contributing to this file.
[581]5
[675]6  This file is part of the yat library, http://lev.thep.lu.se/trac/yat
[581]7
[675]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.
[581]12
[675]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.
[581]17
[675]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
[680]24#include "utility.h"
25#include "DataLookup1D.h"
[779]26#include "DataLookupWeighted1D.h"
[675]27#include "yat/utility/vector.h"
28
29
[581]30namespace theplu {
[680]31namespace yat {
[581]32namespace classifier {
33
[616]34  void convert(const DataLookup1D& lookup, utility::vector& vector) 
[581]35  {
[616]36    vector=utility::vector(lookup.size());
[581]37    for(u_int i=0; i<lookup.size(); i++)
38      vector(i)=lookup(i);
39  }
40
[779]41  void convert(const DataLookupWeighted1D& lookup, utility::vector& value,
42               utility::vector& weight) 
43  {
44   
45    value=utility::vector(lookup.size());
46    weight=utility::vector(lookup.size());
47    for(u_int i=0; i<lookup.size(); i++){
48      value(i)=lookup.data(i);
49      weight(i)=lookup.weight(i);
50    }
51  }
52
[680]53}}} // of namespace classifier, yat, and theplu
Note: See TracBrowser for help on using the repository browser.