00001 #ifndef PMST_HEAP_CACHE_H 00002 #define PMST_HEAP_CACHE_H 00003 00004 //-------------------------------------------------------------------- 00005 // 00006 // This file is part of PEACE. 00007 // 00008 // PEACE is free software: you can redistribute it and/or modify it 00009 // under the terms of the GNU General Public License as published by 00010 // the Free Software Foundation, either version 3 of the License, or 00011 // (at your option) any later version. 00012 // 00013 // PEACE is distributed in the hope that it will be useful, but 00014 // WITHOUT ANY WARRANTY; without even the implied warranty of 00015 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00016 // General Public License for more details. 00017 // 00018 // You should have received a copy of the GNU General Public License 00019 // along with PEACE. If not, see <http://www.gnu.org/licenses/>. 00020 // 00021 // Miami University makes no representations or warranties about the 00022 // suitability of the software, either express or implied, including 00023 // but not limited to the implied warranties of merchantability, 00024 // fitness for a particular purpose, or non-infringement. Miami 00025 // University shall not be liable for any damages suffered by licensee 00026 // as a result of using, result of using, modifying or distributing 00027 // this software or its derivatives. 00028 // 00029 // By using or copying this Software, Licensee agrees to abide by the 00030 // intellectual property laws, and all other applicable laws of the 00031 // U.S., and the terms of GNU General Public License (version 3). 00032 // 00033 // Authors: Dhananjai M. Rao raodm@muohio.edu 00034 // 00035 //--------------------------------------------------------------------- 00036 00037 #include "MSTHeapCache.h" 00038 00039 /** A version of the MSTHeapCache that is specialized to work with 00040 the Partitioned MST Cluster Maker. It provides some special 00041 functionality needed to construct the full MST using Kruskal's 00042 algorithm after merging MSTs that were constructed in parallel. 00043 00044 This class is not designed for use by any subclasses and should 00045 not be extended. 00046 */ 00047 class PMSTHeapCache : public MSTHeapCache { 00048 public: 00049 /** The constructor. 00050 00051 This MST cache requires information about the number of ESTs 00052 in the system in order to effectively track the ESTs already 00053 added to the MST. These values must be passed in as the 00054 various parameters to this class. The constructor essentially 00055 passes off the parameters to the base class that saves the 00056 information (for future reference) in suitable instance 00057 variables. 00058 00059 \note This object is typically instantiated in the 00060 PMSTClusterMaker::mergeManager() method. 00061 00062 \param[in] totalESTCount The total number of ESTs to be 00063 processed (that is, to be added to the MST). 00064 00065 \param[in] startOwnESTidx The starting index of the EST that 00066 is owned by the process that is using this cache. This value 00067 is used to internally normalize est index values to 0 for the 00068 first EST owned by this process. 00069 00070 \param[in] numOwnESTs The number of ESTs owned by the process 00071 that is using this cache. This information is used to reserve 00072 necessary space to hold SMLists for each EST owned by the 00073 manager/worker process. 00074 00075 \param[in] analyzer The analyzer to be used for EST 00076 comparisons, comparing metrics, and ordering entries in this 00077 cache depending on the type of EST analyzer (whether it is 00078 similarity based or distance metric based). 00079 */ 00080 PMSTHeapCache(const int totalESTCount, const int startOwnESTidx, 00081 const int numOwnESTs, const ESTAnalyzer *analyzer); 00082 00083 /** The destructor. 00084 00085 The STL data structures used by this class manage all the 00086 memory operations for this class. Consequently, the 00087 destructor does not have any special tasks to perform. It 00088 here present merely to adhere to coding conventions. 00089 */ 00090 virtual ~PMSTHeapCache() {} 00091 00092 /** Obtains and removes the top-most similar entry from the MSTCache. 00093 00094 This method simply uses the top-most entry in the heap and 00095 populates the parameters with the appropriate value. Note 00096 that the parameters are initialized to -1, -1, -1.0f, and -1 00097 respectively. 00098 00099 \param[out] srcESTidx The source EST index from where the 00100 similarity metric is being measured. The srcESTidx is already 00101 present in the MST. 00102 00103 \param[out] destESTidx The destination EST index that is the 00104 best choice to be added to the MST (based on the local 00105 information). 00106 00107 \param[out] metric The similarity/distance metric between the 00108 srcESTidx and the destESTidx. 00109 00110 \param[out] alignmentData The alignment data associated with 00111 the srcESTidx and the destESTidx. 00112 */ 00113 virtual void popBestEntry(int& srcESTidx, int& destESTidx, 00114 float& metric, int& alignmentData); 00115 00116 protected: 00117 // Currently this class does not have any protected instance 00118 // variables or methods for use. 00119 00120 private: 00121 // Currently this class does not have any private instance 00122 // variables or methods for use. 00123 }; 00124 00125 #endif