Frobby
0.9.5
|
This class adds code to the SliceStrategy base class that is useful for derived classes. More...
#include <SliceStrategyCommon.h>
Public Member Functions | |
SliceStrategyCommon (const SplitStrategy *splitStrategy) | |
virtual | ~SliceStrategyCommon () |
virtual void | freeSlice (auto_ptr< Slice > slice) |
It is allowed to delete returned slices directly, but it is better to use freeSlice. More... | |
virtual void | setUseIndependence (bool use) |
This method should only be called before calling run(). More... | |
virtual void | setUseSimplification (bool use) |
This method should only be called before calling run(). More... | |
Public Member Functions inherited from SliceStrategy | |
virtual | ~SliceStrategy () |
virtual void | run (const Ideal &ideal)=0 |
Run the Slice algorithm. More... | |
virtual bool | processSlice (TaskEngine &tasks, auto_ptr< Slice > slice)=0 |
Process the parameter slice. More... | |
Protected Member Functions | |
virtual bool | simplify (Slice &slice) |
Simplifies slice and returns true if it changed. More... | |
virtual auto_ptr< Slice > | allocateSlice ()=0 |
Directly allocate a slice of the correct type using new. More... | |
virtual bool | debugIsValidSlice (Slice *slice)=0 |
Check that this slice is valid for use with this strategy. More... | |
auto_ptr< Slice > | newSlice () |
Returns a slice from the cache that freeSlice adds to, or allocate a new one using allocateSlice. More... | |
virtual void | pivotSplit (auto_ptr< Slice > slice) |
Takes over ownership of slice. More... | |
virtual void | getPivot (Term &pivot, Slice &slice)=0 |
Used by pivotSplit to obtain a pivot. More... | |
bool | getUseIndependence () const |
Returns true if independence splits should be performed when possible. More... | |
bool | getUseSimplification () const |
Returns true if slices should be simplified. More... | |
Protected Attributes | |
const SplitStrategy * | _split |
TaskEngine | _tasks |
This keeps track of pending tasks to process. More... | |
Private Attributes | |
bool | _useIndependence |
bool | _useSimplification |
vector< Slice * > | _sliceCache |
This is the cache maintained through newSlice and freeSlice. More... | |
Term | _pivotTmp |
This class adds code to the SliceStrategy base class that is useful for derived classes.
The public interface is unchanged.
Definition at line 34 of file SliceStrategyCommon.h.
SliceStrategyCommon::SliceStrategyCommon | ( | const SplitStrategy * | splitStrategy | ) |
Definition at line 24 of file SliceStrategyCommon.cpp.
|
virtual |
Definition at line 31 of file SliceStrategyCommon.cpp.
|
protectedpure virtual |
Directly allocate a slice of the correct type using new.
Implemented in MsmStrategy, and HilbertStrategy.
|
protectedpure virtual |
Check that this slice is valid for use with this strategy.
No check need be performed unless DEBUG is defined, making it acceptable to check things using ASSERT. This method should not be called if DEBUG is not defined.
Implemented in MsmStrategy, and HilbertStrategy.
|
virtual |
It is allowed to delete returned slices directly, but it is better to use freeSlice.
freeSlice can only be called on slices obtained from a method of the same strategy. This allows caching of slices to avoid frequent allocation and deallocation.
Implements SliceStrategy.
Definition at line 39 of file SliceStrategyCommon.cpp.
Used by pivotSplit to obtain a pivot.
Implemented in HilbertStrategy, OptimizeStrategy, and MsmStrategy.
|
protected |
Returns true if independence splits should be performed when possible.
Definition at line 113 of file SliceStrategyCommon.cpp.
|
protectedvirtual |
Returns true if slices should be simplified.
Implements SliceStrategy.
Definition at line 117 of file SliceStrategyCommon.cpp.
|
protected |
Returns a slice from the cache that freeSlice adds to, or allocate a new one using allocateSlice.
This method should be used in place of allocating new slices directly.
Definition at line 65 of file SliceStrategyCommon.cpp.
|
protectedvirtual |
Takes over ownership of slice.
Uses the pivot gotten through getPivot.
Definition at line 77 of file SliceStrategyCommon.cpp.
|
virtual |
This method should only be called before calling run().
Implements SliceStrategy.
Reimplemented in OptimizeStrategy.
Definition at line 47 of file SliceStrategyCommon.cpp.
|
virtual |
This method should only be called before calling run().
Implements SliceStrategy.
Definition at line 51 of file SliceStrategyCommon.cpp.
|
protectedvirtual |
Simplifies slice and returns true if it changed.
Reimplemented in OptimizeStrategy.
Definition at line 55 of file SliceStrategyCommon.cpp.
|
private |
Definition at line 97 of file SliceStrategyCommon.h.
|
private |
This is the cache maintained through newSlice and freeSlice.
It would make more sense with a stack, but that class has (surprisingly!) proven to have too high overhead, even when it seems to be implemented in terms of vector.
Definition at line 95 of file SliceStrategyCommon.h.
|
protected |
Definition at line 80 of file SliceStrategyCommon.h.
|
protected |
This keeps track of pending tasks to process.
These are slices and other events.
Definition at line 84 of file SliceStrategyCommon.h.
|
private |
Definition at line 87 of file SliceStrategyCommon.h.
|
private |
Definition at line 88 of file SliceStrategyCommon.h.