Djinni
2.2
|
A penalty function for annealing which substantially implements the Ohlmann-Thomas compressed annealing functionality. More...
#include <Penalties.h>
Public Types | |
typedef double | ReturnType |
Public Member Functions | |
Compressed () | |
Compressed (double expPower, double pcap, double cperc) | |
Compressed (const Compressed &pfun) | |
virtual | ~Compressed () |
void | setPower (const double power) |
void | setPressureCap (const double cap) |
void | setCapPercentage (const double perc) |
double | getCapPercentage () const |
double | getExpPower () const |
ReturnType | operator() (const int iter) const |
Protected Attributes | |
double | _expPower |
double | _pressureCap |
double | _capPercentage |
A penalty function for annealing which substantially implements the Ohlmann-Thomas compressed annealing functionality.
Unfortunately, this class does not entirely encapsulate the necessary functionality. A trivial specialization of the Annealer class is required. Interested parties are referred to the Annealer.initializeParam() method for more details.
Definition at line 19 of file Penalties.h.
typedef double Compressed::ReturnType |
All PenaltyFuncs must typedef their return value as ReturnType.
For compressed annealing, the lambda value is represented as a double. Hence, we typedef double to ReturnType.
Definition at line 26 of file Penalties.h.
Compressed::Compressed | ( | ) | [inline] |
Default constructor.
Please note that this will create a Compressed object with values you probably won't like. Make sure to set all values appropriately before use.
Definition at line 33 of file Penalties.h.
Compressed::Compressed | ( | double | expPower, |
double | pcap, | ||
double | cperc | ||
) | [inline] |
A constructor which initializes all data members at once.
This constructor is the one you should probably be using.
expPower | The exponential factor involved in compression |
pcap | The pressure cap |
cperc | The percentage of cap |
Definition at line 43 of file Penalties.h.
Compressed::Compressed | ( | const Compressed & | pfun | ) | [inline] |
This copy constructor should be entirely unnecessary.
pfun | The Compressed object to be copied |
Definition at line 51 of file Penalties.h.
virtual Compressed::~Compressed | ( | ) | [inline, virtual] |
A no-op destructor.
This destructor has been virtualized in case you wish to later subclass off Compressed.
Definition at line 59 of file Penalties.h.
double Compressed::getCapPercentage | ( | ) | const [inline] |
Gets the cap percentage.
Definition at line 90 of file Penalties.h.
Referenced by Annealer< Compressed, SolutionType >::initializeParam().
double Compressed::getExpPower | ( | ) | const [inline] |
Gets the current exponential factor used in compression.
Definition at line 98 of file Penalties.h.
ReturnType Compressed::operator() | ( | const int | iter | ) | const [inline] |
The required operator()(int) common to all PenaltyFuncs.
In compressed annealing, the return value varies over iterations. For many other types, this will simply return a constant value.
Definition at line 107 of file Penalties.h.
void Compressed::setCapPercentage | ( | const double | perc | ) | [inline] |
Sets the percentage of cap to use.
perc | The percentage of cap to use. |
Definition at line 82 of file Penalties.h.
void Compressed::setPower | ( | const double | power | ) | [inline] |
Sets the exponential factor for the compression.
power | The new exponential power to use |
Definition at line 66 of file Penalties.h.
void Compressed::setPressureCap | ( | const double | cap | ) | [inline] |
Sets the pressure cap.
cap | The new pressure cap to use |
Definition at line 74 of file Penalties.h.
Referenced by Annealer< Compressed, SolutionType >::initializeParam().