00001 /* 00002 * This file is part of MultiBoost, a multi-class 00003 * AdaBoost learner/classifier 00004 * 00005 * Copyright (C) 2005 Norman Casagrande 00006 * For informations write to nova77@gmail.com 00007 * 00008 * This library is free software; you can redistribute it and/or 00009 * modify it under the terms of the GNU Lesser General Public 00010 * License as published by the Free Software Foundation; either 00011 * version 2.1 of the License, or (at your option) any later version. 00012 * 00013 * This library is distributed in the hope that it will be useful, 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00016 * Lesser General Public License for more details. 00017 * 00018 * You should have received a copy of the GNU Lesser General Public 00019 * License along with this library; if not, write to the Free Software 00020 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00021 * 00022 */ 00023 00028 #ifndef __SORTED_DATA_H 00029 #define __SORTED_DATA_H 00030 00031 #include "IO/InputData.h" 00032 00033 #include <vector> 00034 #include <utility> // for pair 00035 00036 using namespace std; 00037 00038 namespace MultiBoost { 00039 00042 00056 class SortedData : public InputData 00057 { 00058 public: 00059 00068 void load(const string& fileName, const eInputType inputType = IT_TRAIN, const int verboseLevel = 1); 00069 00076 vpIterator getSortedBegin(const int colIdx) { return _sortedData[colIdx].begin(); } 00077 00085 vpIterator getSortedEnd(const int colIdx) { return _sortedData[colIdx].end(); } 00086 00087 protected: 00088 00098 typedef vector< pair<int, double> > column; 00099 00100 vector<column> _sortedData; 00101 00102 }; 00103 00104 } // end of namespace MultiBoost 00105 00106 #endif