latest version v1.9 - last update 10 Apr 2010 |
00001 /* 00002 * Copyright (C) 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 .......: ltiMinimumSpanningTreeOfKeyValuetype.h 00027 * authors ....: Jens Paustenbach 00028 * organization: LTI, RWTH Aachen 00029 * creation ...: 8.5.2003 00030 * revisions ..: $Id: ltiMinimumSpanningTreeOfKeyValuetype.h,v 1.6 2006/02/08 12:37:02 ltilib Exp $ 00031 */ 00032 00033 #ifndef _LTI_MINIMUM_SPANNING_TREE_OF_KEY_VALUETYPE_H_ 00034 #define _LTI_MINIMUM_SPANNING_TREE_OF_KEY_VALUETYPE_H_ 00035 00036 00037 #include "ltiMinimumSpanningTree.h" 00038 00039 namespace lti { 00040 /** 00041 * Computes a minimum spanning tree of a given data set. 00042 * Computes the minimum spanning tree from a matrix of K::valuetype 00043 * elements, e.g. a matrix of doubles where each row represents one data 00044 * point. 00045 */ 00046 template < class K, class V=int, class Distantor=l2SquareDistantor<K> > 00047 class minimumSpanningTreeOfKeyValuetype : public minimumSpanningTree<K,V,Distantor> { 00048 public: 00049 00050 /** 00051 * This class uses the same parameters as its base class 00052 */ 00053 typedef typename 00054 minimumSpanningTree<K,V,Distantor>::parameters parameters; 00055 00056 /** 00057 * Distance type 00058 */ 00059 typedef typename 00060 minimumSpanningTree<K,V,Distantor>::distance_type distance_type; 00061 00062 /** 00063 * Key Value Type 00064 */ 00065 typedef typename 00066 minimumSpanningTree<K,V,Distantor>::key_value_type key_value_type; 00067 00068 /** 00069 * default constructor 00070 */ 00071 minimumSpanningTreeOfKeyValuetype(); 00072 00073 /** 00074 * Construct a functor using the given parameters 00075 */ 00076 minimumSpanningTreeOfKeyValuetype(const parameters& par); 00077 00078 /** 00079 * copy constructor 00080 * @param other the object to be copied 00081 */ 00082 minimumSpanningTreeOfKeyValuetype(const minimumSpanningTreeOfKeyValuetype& other); 00083 00084 /** 00085 * destructor 00086 */ 00087 virtual ~minimumSpanningTreeOfKeyValuetype(); 00088 00089 /** 00090 * returns the name of this type ("minimumSpanningTreeOfKeyValuetype") 00091 */ 00092 virtual const char* getTypeName() const; 00093 00094 /** 00095 * computes the minimum spanning tree of the given data 00096 * @param src matrix with the source data. 00097 * @param datas data set 00098 * @param graph the returned minimum spanning tree 00099 * @return true if apply successful or false otherwise. 00100 */ 00101 bool apply(const matrix<key_value_type>& src, 00102 const vector<V>& datas, 00103 weightedGraph<K,V,distance_type>& graph) const; 00104 00105 /** 00106 * copy data of "other" functor. 00107 * @param other the functor to be copied 00108 * @return a reference to this functor object 00109 */ 00110 minimumSpanningTreeOfKeyValuetype& 00111 copy(const minimumSpanningTreeOfKeyValuetype& other); 00112 00113 /** 00114 * alias for copy member 00115 * @param other the functor to be copied 00116 * @return a reference to this functor object 00117 */ 00118 minimumSpanningTreeOfKeyValuetype& 00119 operator=(const minimumSpanningTreeOfKeyValuetype& other); 00120 00121 /** 00122 * returns a pointer to a clone of this functor. 00123 */ 00124 virtual functor* clone() const; 00125 00126 /** 00127 * returns used parameters 00128 */ 00129 const parameters& getParameters() const; 00130 }; 00131 } 00132 00133 #include "ltiMinimumSpanningTreeOfKeyValuetype_template.h" 00134 00135 #endif