|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.sf.saffron.opt.RuleQueue
Priority queue of relexps whose rules have not been called, and rule-matches which have not yet been acted upon.
Nested Class Summary | |
private class |
RuleQueue.RelImportanceComparator
Compares SaffronRel objects according to their cached
'importance'. |
private class |
RuleQueue.RuleMatchImportanceComparator
Compares VolcanoRuleMatch objects according to their
importance. |
Field Summary | |
private ArrayList |
matchList
|
private HashSet |
matchNames
|
private VolcanoPlanner |
planner
|
private Comparator |
relImportanceComparator
Compares relexps according to their cached 'importance'. |
private BinaryHeap |
relQueue
|
private HashSet |
rels
|
private Comparator |
ruleMatchImportanceComparator
|
(package private) HashMap |
subsetImportances
Maps RelSubset to Double . |
Constructor Summary | |
(package private) |
RuleQueue(VolcanoPlanner planner)
|
Method Summary | |
(package private) void |
add(RelSubset subset)
Registers a subset, if it has not already been registered. |
(package private) void |
add(SaffronRel rel)
Registers that a relational expression's rules have not been fired. |
(package private) void |
addMatch(VolcanoRuleMatch match)
Adds a rule match. |
(package private) double |
computeImportance(RelSubset subset)
Computes the importance of a node. |
private double |
computeImportanceOfChild(RelSubset child,
RelSubset parent)
Returns the importance of a child to a parent. |
boolean |
contains(SaffronRel rel)
|
(package private) void |
dump()
|
(package private) SaffronRel |
findCheapestMember(RelSubset childSubset)
|
double |
getImportance(RelSet set)
Computes the importance a set (which is that of its most important subset). |
(package private) double |
getImportance(RelSubset rel)
Returns the importance of an equivalence class of relational expressions. |
boolean |
hasNextMatch()
Returns whether there is a rule match in the queue. |
(package private) boolean |
isEmpty()
|
(package private) SaffronRel |
pop()
Returns the relational expression whose cost is highest |
(package private) VolcanoRuleMatch |
popMatch()
Removes the rule match with the highest importance, and returns it. |
void |
recompute(RelSubset subset)
|
(package private) boolean |
remove(SaffronRel rel)
|
private double |
toDouble(PlanCost cost)
Converts a cost to a scalar quantity. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
HashMap subsetImportances
RelSubset
to Double
.
private final ArrayList matchList
private final Comparator ruleMatchImportanceComparator
private final HashSet matchNames
private final VolcanoPlanner planner
private Comparator relImportanceComparator
private BinaryHeap relQueue
private HashSet rels
Constructor Detail |
RuleQueue(VolcanoPlanner planner)
Method Detail |
public double getImportance(RelSet set)
public boolean contains(SaffronRel rel)
public boolean hasNextMatch()
public void recompute(RelSubset subset)
boolean isEmpty()
double getImportance(RelSubset rel)
If a subset in the same set but with a different calling convention is deemed to be important, then this subset has at least half of its importance. (This rule is designed to encourage conversions to take place.)
void add(SaffronRel rel)
void add(RelSubset subset)
void addMatch(VolcanoRuleMatch match)
double computeImportance(RelSubset subset)
RelSubset
has an importance of 1
In = Sumparents p of n{Ip . Wn, p}where Wn, p, the weight of n within its parent p, is
Wn, p = Costn / (SelfCostp + Costn0 + ... + Costnk)
void dump()
SaffronRel findCheapestMember(RelSubset childSubset)
SaffronRel pop()
VolcanoRuleMatch popMatch()
boolean remove(SaffronRel rel)
private double computeImportanceOfChild(RelSubset child, RelSubset parent)
private double toDouble(PlanCost cost)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |