Bidirectional mutation strategy. More...
#include <mitsuba/bidir/mut_bidir.h>
Public Member Functions | |
BidirectionalMutator (const Scene *scene, Sampler *sampler, MemoryPool &pool, int kmin, int kmax) | |
Construct a new bidirectional mutator. More... | |
virtual const Class * | getClass () const |
Retrieve this object's class. More... | |
Implementation of the Mutator interface | |
EMutationType | getType () const |
What kind of mutations does this mutator perform? More... | |
Float | suitability (const Path &path) const |
Determine the general "suitability" of this mutator for a given kind of path. More... | |
bool | sampleMutation (Path &source, Path &proposal, MutationRecord &muRec, const MutationRecord &sourceMuRec) |
Given a path, this function produces a new proposal according to the internally implemented mutation strategy. More... | |
Float | Q (const Path &source, const Path &proposal, const MutationRecord &muRec) const |
For a pair of paths, this function computes the inverse transition probability (matching the Q term in [Veach 97]) More... | |
void | accept (const MutationRecord &muRec) |
Record an accepted mutation. More... | |
Public Member Functions inherited from Object | |
Object () | |
Construct a new object. More... | |
int | getRefCount () const |
Return the current reference count. More... | |
void | incRef () const |
Increase the reference count of the object by one. More... | |
void | decRef (bool autoDeallocate=true) const |
Decrease the reference count of the object and possibly deallocate it. More... | |
virtual std::string | toString () const |
Return a human-readable string representation of the object's contents. More... | |
Static Public Attributes | |
static Class * | m_theClass |
Static Public Attributes inherited from mitsuba::Mutator | |
static Class * | m_theClass |
Static Public Attributes inherited from Object | |
static Class * | m_theClass |
Pointer to the object's class descriptor. More... | |
Protected Member Functions | |
Float | pmfMutation (const Path &source, const MutationRecord &muRec) const |
Compute the probability mass associated with one of the internally implemented mutation strategies. More... | |
virtual | ~BidirectionalMutator () |
Virtual destructor. More... | |
Protected Member Functions inherited from mitsuba::Mutator | |
virtual | ~Mutator () |
Virtual destructor. More... | |
Protected Member Functions inherited from Object | |
virtual | ~Object () |
Virtual private deconstructor. (Will only be called by ref) More... | |
Protected Attributes | |
ref< const Scene > | m_scene |
ref< Sampler > | m_sampler |
std::vector< int > | m_temp |
MemoryPool & | m_pool |
int | m_kmin |
int | m_kmax |
Path | m_tempPath |
Additional Inherited Members | |
Public Types inherited from mitsuba::Mutator | |
enum | EMutationType { EBidirectionalMutation = 0, ELensPerturbation, ELensSubpathMutation, EIndependentMutation, ECausticPerturbation, EMultiChainPerturbation, EManifoldPerturbation, EMutationTypeCount } |
Specifies the type of mutation implemented by the mutator. More... | |
Static Public Member Functions inherited from Object | |
static void | staticInitialization () |
Initializes the built-in reference count debugger (if enabled) More... | |
static void | staticShutdown () |
Free the memory taken by staticInitialization() More... | |
Bidirectional mutation strategy.
This class implements a slightly extended version of the bidirectional mutation proposed by Veach. The main change is that it builds on top of a two-tailed geometric distribution that is used to sample path configuration proposals in a more flexible manner.
mitsuba::BidirectionalMutator::BidirectionalMutator | ( | const Scene * | scene, |
Sampler * | sampler, | ||
MemoryPool & | pool, | ||
int | kmin, | ||
int | kmax | ||
) |
Construct a new bidirectional mutator.
scene | A pointer to the underlying scene |
sampler | A sample generator |
pool | A memory pool used to allocate new path vertices and edges |
kmin | Minimum number of edges in newly proposed paths. This can be used to exclude direct illumination. |
kmax | Minimum number of edges in newly proposed paths. |
|
protectedvirtual |
Virtual destructor.
|
virtual |
Record an accepted mutation.
This function exists to allow mutators to track their acceptance rate and other statistics.
Implements mitsuba::Mutator.
|
virtual |
Retrieve this object's class.
Reimplemented from mitsuba::Mutator.
|
virtual |
What kind of mutations does this mutator perform?
Implements mitsuba::Mutator.
|
protected |
Compute the probability mass associated with one of the internally implemented mutation strategies.
|
virtual |
For a pair of paths, this function computes the inverse transition probability (matching the Q term in [Veach 97])
source | A path data structure containing the original path |
proposal | A path data structure containing the proposed mutated path |
muRec | Data record that describes the mutation strategy, which transformed source to proposal . |
Implements mitsuba::Mutator.
|
virtual |
Given a path, this function produces a new proposal according to the internally implemented mutation strategy.
source | The sampling strategy implemented by the mutator will condition on this path. |
proposal | Path data structure to be filled with the proposed mutated path |
muRec | Data record that describes the sampled mutation strategy |
sourceMuRec | Data record that describes the last successful mutation strategy (for the source path) |
false
. Implements mitsuba::Mutator.
Determine the general "suitability" of this mutator for a given kind of path.
Implements mitsuba::Mutator.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
static |