Skip to content

Commit

Permalink
Update to Reduction()
Browse files Browse the repository at this point in the history
This simply removes minimise() from the reduce inner loop, as I believe
that this is unnecessary and potentially quite expensive.
  • Loading branch information
DavePearce committed Nov 19, 2015
1 parent 566ee7b commit ee7f5a1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/wyrw/core/Reduction.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ public Reduction(Schema schema, Comparator<Rewrite.Activation> comparator,
cache = new HashMap<Automaton,Integer>();
}

/**
* Automaton should be minimised
*/
public int initialise(Automaton automaton) {
states.add(probe(automaton));
return states.size()-1;
Expand All @@ -40,7 +43,6 @@ public int step(int from, int activation) {
int to;
if (target != Automaton.K_VOID && from != target) {
// Rule application produced an updated automaton
automaton.minimise(); // needed?
automaton.compact(0);
to = addState(automaton);
if(to >= states.size()) {
Expand Down

0 comments on commit ee7f5a1

Please sign in to comment.