latest version v1.9 - last update 10 Apr 2010 |
00001 /* 00002 * Copyright (C) 2002, 2003, 2004, 2005, 2006 00003 * Lehrstuhl fuer Technische Informatik, RWTH-Aachen, Germany 00004 * 00005 * This file is part of the LTI-Computer Vision Library (LTI-Lib) 00006 * 00007 * The LTI-Lib is free software; you can redistribute it and/or 00008 * modify it under the terms of the GNU Lesser General Public License (LGPL) 00009 * as published by the Free Software Foundation; either version 2.1 of 00010 * the License, or (at your option) any later version. 00011 * 00012 * The LTI-Lib is distributed in the hope that it will be 00013 * useful, but WITHOUT ANY WARRANTY; without even the implied warranty 00014 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 * GNU 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 the LTI-Lib; see the file LICENSE. If 00019 * not, write to the Free Software Foundation, Inc., 59 Temple Place - 00020 * Suite 330, Boston, MA 02111-1307, USA. 00021 */ 00022 00023 00024 /*-------------------------------------------------------------------- 00025 * project ....: LTI-Lib: Image Processing and Computer Vision Library 00026 * file .......: ltiSequentialForwardSearch.h 00027 * authors ....: Jens Paustenbach 00028 * organization: LTI, RWTH Aachen 00029 * creation ...: 8.7.2002 00030 * revisions ..: $Id: ltiSequentialForwardSearch.h,v 1.4 2006/02/07 18:25:41 ltilib Exp $ 00031 */ 00032 00033 #ifndef _LTI_SEQUENTIAL_FORWARD_SEARCH_H_ 00034 #define _LTI_SEQUENTIAL_FORWARD_SEARCH_H_ 00035 00036 //TODO: include only those files which are needed in this header!! 00037 00038 #include "ltiVector.h" 00039 #include "ltiMatrix.h" 00040 #include "ltiPlusLTakeAwayR.h" 00041 00042 namespace lti { 00043 /** 00044 * This class implements the sequential forward search algorithm for 00045 * feature selection. It is based on the PlusRTakeAwayR Algorithm with 00046 * parameters r=0 and l=1. It starts with an empty destination matrix. 00047 * Each iteration inserts the most significant feature from the source 00048 * data set into the destination until the predetermined number of features 00049 * is reached. 00050 */ 00051 class sequentialForwardSearch : public plusLTakeAwayR { 00052 public: 00053 /** 00054 * default constructor 00055 */ 00056 sequentialForwardSearch(); 00057 00058 /** 00059 * copy constructor 00060 * @param other the object to be copied 00061 */ 00062 sequentialForwardSearch(const sequentialForwardSearch& other); 00063 00064 /** 00065 * destructor 00066 */ 00067 virtual ~sequentialForwardSearch(); 00068 00069 /** 00070 * returns the name of this type ("sequentialForwardSearch") 00071 */ 00072 virtual const char* getTypeName() const; 00073 00074 00075 /** 00076 * copy the nbFeatures best features to the dest matrix 00077 * @param src dmatrix with the source data. 00078 * @param srcIds ids of the corresponding rows of src 00079 * @param dest dmatrix where the result will be left. 00080 * @return true if apply successful or false otherwise. 00081 */ 00082 bool apply(const dmatrix& src,const ivector& srcIds, 00083 dmatrix& dest) ; 00084 00085 /** 00086 * copy data of "other" functor. 00087 * @param other the functor to be copied 00088 * @return a reference to this functor object 00089 */ 00090 sequentialForwardSearch& copy(const sequentialForwardSearch& other); 00091 00092 /** 00093 * alias for copy member 00094 * @param other the functor to be copied 00095 * @return a reference to this functor object 00096 */ 00097 sequentialForwardSearch& operator=(const sequentialForwardSearch& other); 00098 00099 /** 00100 * returns a pointer to a clone of this functor. 00101 */ 00102 virtual functor* clone() const; 00103 00104 /** 00105 * returns used parameters 00106 */ 00107 const parameters& getParameters() const; 00108 00109 00110 }; 00111 } 00112 00113 #endif