Minotaur 0.4.1
Docs for developers
NodeHeap.h
Go to the documentation of this file.
1//
2// Minotaur -- It's only 1/2 bull
3//
4// (C)opyright 2008 - 2025 The Minotaur Team.
5//
6
15#ifndef MINOTAURNODEHEAP_H
16#define MINOTAURNODEHEAP_H
17
18#include "Types.h"
19#include "ActiveNodeStore.h"
20
21namespace Minotaur {
22
35 class NodeHeap : public ActiveNodeStore {
36
37 public:
39 enum Type
40 {
41 Value,
42 Depth
43 };
44
47 : type_(type)
48 {
49 }
50
52 virtual ~NodeHeap();
53
58 virtual bool isEmpty() const { return nodes_.empty(); }
59
65 virtual double getBestLB() const;
66
68 virtual UInt getDeepestLevel() const;
69
71 virtual void pop();
72
77 virtual void write(std::ostream &out) const;
78
80 virtual void push(NodePtr n);
81
83 virtual void setType(Type type);
84
86 virtual NodePtr top() const { return (nodes_.front()); }
87
89 virtual size_t getSize() const { return (nodes_.size()); }
90
92 NodePtrIterator nodesBegin();
93
95 NodePtrIterator nodesEnd();
96
97 private:
99 NodePtrVector nodes_;
100
102 Type type_;
103 };
104 typedef NodeHeap *NodeHeapPtr;
105} //namespace Minotaur
106#endif
Declare the base class ActiveNodeStore for storing active nodes of the branch-and-bound tree.
Declare important 'types' used in Minotaur.
Save and retrieve active nodes.
Definition: ActiveNodeStore.h:31
Definition: NodeHeap.h:35
virtual void setType(Type type)
Set the type of ordering of this heap.
Definition: NodeHeap.cpp:136
virtual size_t getSize() const
Get the number of active nodes in the heap.
Definition: NodeHeap.h:89
virtual ~NodeHeap()
Destroy.
Definition: NodeHeap.cpp:53
NodePtrIterator nodesBegin()
Get iterator to the first node in the heap.
Definition: NodeHeap.cpp:154
virtual UInt getDeepestLevel() const
Find the maximum depth of all active nodes.
Definition: NodeHeap.cpp:92
virtual void write(std::ostream &out) const
Definition: NodeHeap.cpp:109
Type
Types of ordering.
Definition: NodeHeap.h:40
virtual void pop()
Remove the best node from the heap.
Definition: NodeHeap.cpp:59
NodePtrIterator nodesEnd()
Get iterator to the last node in the heap.
Definition: NodeHeap.cpp:160
virtual bool isEmpty() const
Definition: NodeHeap.h:58
NodeHeap(Type type)
Constructor.
Definition: NodeHeap.h:46
virtual double getBestLB() const
Definition: NodeHeap.cpp:76
virtual void push(NodePtr n)
Add a node to the set of active nodes.
Definition: NodeHeap.cpp:119
virtual NodePtr top() const
Get access to the best node in this heap.
Definition: NodeHeap.h:86
Definition: Node.h:54
Definition: ActiveNodeStore.h:20
unsigned int UInt
Unsigned integer.
Definition: Types.h:30

Minotaur source code documented by Doxygen 1.9.4 on Thu Apr 24 2025