src/IO/ClassMappings.h

Go to the documentation of this file.
00001 /*
00002 * This file is part of MultiBoost, a multi-class 
00003 * AdaBoost learner/classifier
00004 *
00005 * Copyright (C) 2005 Norman Casagrande
00006 *
00007 * This library is free software; you can redistribute it and/or
00008 * modify it under the terms of the GNU Lesser General Public
00009 * License as published by the Free Software Foundation; either
00010 * version 2.1 of the License, or (at your option) any later version.
00011 *
00012 * This library is distributed in the hope that it will be useful,
00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015 * Lesser General Public License for more details.
00016 *
00017 * You should have received a copy of the GNU Lesser General Public
00018 * License along with this library; if not, write to the Free Software
00019 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00020 *
00021 */
00022 
00027 #ifndef __CLASS_MAPPINGS_H
00028 #define __CLASS_MAPPINGS_H
00029 
00030 #include <string>
00031 #include <vector>
00032 #include <map>
00033 
00034 using namespace std;
00035 
00038 
00039 namespace MultiBoost {
00040 
00046 class ClassMappings
00047 {
00048 public:
00049 
00055    static int addClassName(const string& className);
00056 
00066    static void loadClassMapFile(const string& classMapFileName);
00067 
00077    static string getClassNameFromIdx(const int idx); 
00078 
00088    static int    getIdxFromClassName(const string& className);
00089 
00090    static int    getNumClasses() { return _numRegClasses; }   
00091 
00092 private:
00098    static vector<string>   _mapIdxToClass; 
00099 
00105    static map<string, int>  _mapClassToIdx;
00106 
00107    static int _numRegClasses; 
00108 };
00109 
00110 } // end of namespace MultiBoost
00111 
00112 #endif // CLASS_MAPPINGS_H

Generated on Mon Nov 28 21:43:46 2005 for MultiBoost by  doxygen 1.4.5