- Main Page
- Namespaces
- Classes
- Files
- Related Pages

# /Users/fpy/titan-1-5-MBARI/Mers/Estimation/Discrete/EstimateHeap.h

    00001 //=============================================================================
    00002 // EstimateHeap.h: interface for the EstimateHeap class.
    00003 //
    00004 // Copyright (c) 2003           Model-based Embedded and Robotic Systems Group
    00005 // All Rights Reserved          Massachusetts Institute of Technology
    00006 //
    00007 // This software is provided as is. Model-based Embedded and Robotic Systems
    00008 // (MERS) group does not assume any responsibility.
    00009 //
    00010 // Author:                      Oliver B. Martin
    00011 // Organization:        Model-based Embedded and Robotic Systems Group
    00012 //                                      Massachusetts Institute of Technology
    00013 //
    00014 // Heap of Estimate, this is a priority queue of Estimate, where
    00015 // the key is the total posteriori probability, and the least
    00016 // costly (highest probability) element is always on top
    00017 //
    00018 //=============================================================================
    00019
    00020 #if !defined(_ESTIMATE_HEAP_H_)
    00021 #define _ESTIMATE_HEAP_H_
    00022
    00023 #if _MSC_VER > 1000
    00024 #pragma once
    00025 #endif // _MSC_VER > 1000
    00026
    00027 #include <Mers/Utils/Containers/DynamicHeap.h>
    00028
    00029 namespace Mers {
    00030         namespace Estimation {
    00031                 namespace Discrete {
    00032
    00033                         class Estimate;
    00034
    00040                         class EstimateHeap : public Mers::Utils::Containers::DynamicHeap
    00041                         {
    00042                         public:
    00043                                 //-----------------------------------------
    00044                                 // Constructors
    00045                                 //-----------------------------------------
    00046
    00052                                 EstimateHeap(bool myLargestFirstHeap);
    00053
    00054                                 //-----------------------------------------
    00055                                 // Copy constructors
    00056                                 //-----------------------------------------
    00057
    00063                                 EstimateHeap(EstimateHeap const &other);
    00069                                 EstimateHeap(EstimateHeap const * other);
    00070
    00071                                 //-----------------------------------------
    00072                                 // Destructors
    00073                                 //-----------------------------------------
    00074
    00078                                 virtual ~EstimateHeap();
    00079
    00080                                 //-----------------------------------------
    00081                                 // Functions
    00082                                 //-----------------------------------------
    00083
    00091                                 int insert(Estimate * element);
    00099                                 int peekFirst(Estimate * &element);
    00107                                 int getFirst(Estimate * &element);
    00108
    00109                         #ifndef EMBEDDED
    00110
    00115                                 void printElement(std::ostream &out, void const * element) const;
    00116                         #endif
    00117
    00118                         protected:
    00124                                 void deleteElement(void * element) const;
    00131                                 void * newElement(void const * element) const;
    00132
    00140                                 bool greaterThan(void const * e1, void const * e2) const;
    00148                                 bool lessThan(void const * e1, void const * e2) const;
    00149                         };
    00150                 }
    00151         }
    00152 }
    00153
    00154 #endif // !defined(_ESTIMATE_HEAP_H_)