Main Page | Modules | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

Arak::ModifiedCN94Proposal Class Reference

#include <cn94.hpp>

Inheritance diagram for Arak::ModifiedCN94Proposal:

Inheritance graph
[legend]
Collaboration diagram for Arak::ModifiedCN94Proposal:

Collaboration graph
[legend]
List of all members.

Detailed Description

This is a modified version of the Clifford & Nicholls (1994) proposal distribution in which the recolor move samples edges that are close together.

Definition at line 1152 of file cn94.hpp.

Public Member Functions

 ModifiedCN94Proposal (const Arak::Util::PropertyMap &props)
 Constructor.

virtual ~ModifiedCN94Proposal ()
 Destructor.

virtual ColoringMovemove ()
 Returns a reference to the move most recently sampled from this proposal distribution.

virtual double ll (const Coloring &c)
 Returns the log likelihood of proposing a move that would lead to the same coloring as does the most recently sampled move.

virtual double rll (const Coloring &c)
 Returns the log likelihood of proposing a return to the current state from the most recently proposed state.


Protected Member Functions

virtual void sampleRecolor (const Coloring &state, Arak::Util::Random &random)
 Samples a recolor move and updates this proposal object so the sampled move is the current proposal.

virtual void sampleBoundaryTriangleBirth (const Coloring &state, Arak::Util::Random &random)
 Samples a boundary triangle birth move and updates this proposal object so the sampled move is the current proposal.

virtual void sampleSlideInteriorVertex (const Coloring &state, Arak::Util::Random &random)
 Samples a slide interior vertex move and updates this proposal object so the sampled move is the current proposal.

virtual void sampleMoveInteriorVertex (const Coloring &state, Arak::Util::Random &random)
 Samples a move/slide interior vertex move and updates this proposal object so the sampled move is the current proposal.


Protected Attributes

double ZETA_LOCAL_NOT_GLOBAL_RECOLOR
 The probability that a local recolor move is proposed rather than a global recolor move.

double ZETA_LOCAL_NOT_GLOBAL_BD_TRI_BIRTH
 The probability that a local boundary triangle birth move is proposed rather than a global boundary triangle birth move.

SlideInteriorVertex siv
 The most recently proposed "slide interior vertex" move.

double ZETA_SLIDE_NOT_MOVE_INT_VERTEX
 The probability that a slide interior vertex move is proposed rather than a move interior vertex move.

bool slide_not_move
 This flag indicates whether miv represents a slide interior vertex move rather than a move interior vertex move.


Constructor & Destructor Documentation

ModifiedCN94Proposal::ModifiedCN94Proposal const Arak::Util::PropertyMap props  ) 
 

Constructor.

Definition at line 1197 of file cn94.cpp.

References Arak::Util::PropertyMap, ZETA_LOCAL_NOT_GLOBAL_BD_TRI_BIRTH, ZETA_LOCAL_NOT_GLOBAL_RECOLOR, and ZETA_SLIDE_NOT_MOVE_INT_VERTEX.

virtual Arak::ModifiedCN94Proposal::~ModifiedCN94Proposal  )  [inline, virtual]
 

Destructor.

Definition at line 1309 of file cn94.hpp.


Member Function Documentation

double ModifiedCN94Proposal::ll const Coloring c  )  [virtual]
 

Returns the log likelihood of proposing a move that would lead to the same coloring as does the most recently sampled move.

Returns:
the log likelihood of the proposed state

Reimplemented from Arak::CN94Proposal.

Definition at line 1425 of file cn94.cpp.

References Arak::CN94Proposal::castingArea(), Arak::Coloring::IntEdgeHandle, Arak::CN94Proposal::ll(), Arak::ln(), localRecolorSampleProb(), Arak::ModifiedCN94Proposal::SlideInteriorVertex::next, Arak::Coloring::numBoundaryEdges(), Arak::Coloring::numInteriorEdges(), Arak::Coloring::numVertices(), siv, slide_not_move, Arak::CN94Proposal::MoveInteriorVertex::vertex, ZETA_LOCAL_NOT_GLOBAL_BD_TRI_BIRTH, ZETA_LOCAL_NOT_GLOBAL_RECOLOR, and ZETA_SLIDE_NOT_MOVE_INT_VERTEX.

virtual ColoringMove& Arak::ModifiedCN94Proposal::move  )  [inline, virtual]
 

Returns a reference to the move most recently sampled from this proposal distribution.

This move is guaranteed to be stable only until #resample(Arak::Util::Random&) is called again.

Returns:
the most recently sampled move

Reimplemented from Arak::CN94Proposal.

Definition at line 1318 of file cn94.hpp.

References Arak::CN94Proposal::move(), siv, and slide_not_move.

double ModifiedCN94Proposal::rll const Coloring c  )  [virtual]
 

Returns the log likelihood of proposing a return to the current state from the most recently proposed state.

Returns:
the log likelihood of returning to the current state from the proposed state

Reimplemented from Arak::CN94Proposal.

Definition at line 1485 of file cn94.cpp.

References Arak::CN94Proposal::castingArea(), Arak::ln(), localRecolorSampleProb(), Arak::CN94Proposal::MoveInteriorVertex::newLoc, Arak::ModifiedCN94Proposal::SlideInteriorVertex::next, Arak::Coloring::numBoundaryEdges(), Arak::Coloring::numInteriorEdges(), Arak::Coloring::numVertices(), Arak::CN94Proposal::rll(), siv, slide_not_move, Arak::CN94Proposal::MoveInteriorVertex::vertex, Arak::Coloring::VertexHandle, ZETA_LOCAL_NOT_GLOBAL_BD_TRI_BIRTH, ZETA_LOCAL_NOT_GLOBAL_RECOLOR, and ZETA_SLIDE_NOT_MOVE_INT_VERTEX.

void ModifiedCN94Proposal::sampleBoundaryTriangleBirth const Coloring state,
Arak::Util::Random random
[protected, virtual]
 

Samples a boundary triangle birth move and updates this proposal object so the sampled move is the current proposal.

With some probability, the recolor move of the Clifford & Nicholls (1994) proposal distribution is sampled; with the remaining probability a recolor move is sampled as follows. A window edge $e$ is sampled uniformly, and a point $u$ is sampled uniformly along $e$. Let $c$ be the axis-aligned casting box against $e$ with $u$ in the center of one of its sides $s$. A second point $v$ is sampled uniformly from $s$. (If $v$ is not on $e$, the move is rejected.) A third point $w$ is sampled from the interior of $c$. A move adding the boundary triangle $uvw$ is proposed (i.e., a recoloring of the triangle's interior is proposed).

Parameters:
state the current state of the Markov chain
random a source of pseudorandomness

Reimplemented from Arak::CN94Proposal.

Definition at line 1286 of file cn94.cpp.

References Arak::Coloring::BdEdgeHandle, Arak::Coloring::getBoundaryEdge(), Arak::Coloring::interior(), Arak::Coloring::newBoundaryTriangle(), Arak::Coloring::numBoundaryEdges(), Arak::Geometry::Point, Arak::CN94Proposal::sampleBoundaryTriangleBirth(), Arak::Util::Random::uniform(), Arak::Geometry::Vector, and ZETA_LOCAL_NOT_GLOBAL_BD_TRI_BIRTH.

void ModifiedCN94Proposal::sampleMoveInteriorVertex const Coloring state,
Arak::Util::Random random
[protected, virtual]
 

Samples a move/slide interior vertex move and updates this proposal object so the sampled move is the current proposal.

With some probability, the move interior vertex move of the Clifford & Nicholls (1994) proposal distribution is sampled; with the remaining probability a slide interior vertex move.

Parameters:
state the current state of the Markov chain
random a source of pseudorandomness

Reimplemented from Arak::CN94Proposal.

Definition at line 1413 of file cn94.cpp.

References Arak::CN94Proposal::sampleMoveInteriorVertex(), sampleSlideInteriorVertex(), slide_not_move, Arak::Util::Random::uniform(), and ZETA_SLIDE_NOT_MOVE_INT_VERTEX.

void ModifiedCN94Proposal::sampleRecolor const Coloring state,
Arak::Util::Random random
[protected, virtual]
 

Samples a recolor move and updates this proposal object so the sampled move is the current proposal.

With some probability, the recolor move of the Clifford & Nicholls (1994) proposal distribution is sampled; with the remaining probability a recolor move is sampled as follows. An interior vertex $u$ is sampled uniformly at random and another interior vertex $v$ that is not adjacent to $u$ is sampled uniformly from a casting box centered at $u$. If there is no such vertex an invalid move is proposed. Otherwise, a neighbor $x$ of $u$ and a neighbor $y$ of $v$ are sampled and a recoloring move is proposed which joins $u$ to $v$ and $x$ to $y$.

Parameters:
state the current state of the Markov chain
random a source of pseudorandomness

Reimplemented from Arak::CN94Proposal.

Definition at line 1212 of file cn94.cpp.

References Arak::Util::Random::bernoulli(), Arak::Coloring::InteriorEdge::CellEntry, Arak::Coloring::InteriorEdge::CellEntryList, Arak::Coloring::getInteriorEdge(), Arak::Coloring::IntEdgeHandle, Arak::Coloring::numInteriorEdges(), Arak::Coloring::recolorQuadrilateral(), Arak::CN94Proposal::sampleRecolor(), Arak::Geometry::Segment, Arak::Util::Random::uniform(), and ZETA_LOCAL_NOT_GLOBAL_RECOLOR.

void ModifiedCN94Proposal::sampleSlideInteriorVertex const Coloring state,
Arak::Util::Random random
[protected, virtual]
 

Samples a slide interior vertex move and updates this proposal object so the sampled move is the current proposal.

An interior vertex $u$ is sampled uniformly, and one of its incident edges $e$ is chosen with probability 1/2. Let $\vec{e}$ be the vector from $u$ to the other vertex incident to $e$. A new point $p$ is sampled uniformly from the line segment between $u + \vec{e}$ and $u - \vec{e} / 2$. A move that relocates $u$ to $p$ is proposed.

Parameters:
state the current state of the Markov chain
random a source of pseudorandomness

Definition at line 1383 of file cn94.cpp.

References Arak::Util::Random::bernoulli(), Arak::Coloring::IntEdgeHandle, Arak::Coloring::interior(), Arak::Coloring::moveIntVertex(), Arak::Coloring::numVertices(), Arak::Geometry::Point, Arak::Coloring::randomVertex(), Arak::ModifiedCN94Proposal::SlideInteriorVertex::reset(), siv, slide_not_move, Arak::Util::Random::uniform(), Arak::Geometry::Vector, and Arak::Coloring::VertexHandle.

Referenced by sampleMoveInteriorVertex().


Member Data Documentation

SlideInteriorVertex Arak::ModifiedCN94Proposal::siv [protected]
 

The most recently proposed "slide interior vertex" move.

Definition at line 1250 of file cn94.hpp.

Referenced by ll(), move(), rll(), and sampleSlideInteriorVertex().

bool Arak::ModifiedCN94Proposal::slide_not_move [protected]
 

This flag indicates whether miv represents a slide interior vertex move rather than a move interior vertex move.

This is used to correctly evaluate proposal probabilities.

Todo:
This is an ugly consequence of the design of the base class--specifically, the fact that the MoveType enum is not easily extensible.

Definition at line 1267 of file cn94.hpp.

Referenced by ll(), move(), rll(), sampleMoveInteriorVertex(), and sampleSlideInteriorVertex().

double Arak::ModifiedCN94Proposal::ZETA_LOCAL_NOT_GLOBAL_BD_TRI_BIRTH [protected]
 

The probability that a local boundary triangle birth move is proposed rather than a global boundary triangle birth move.

Definition at line 1186 of file cn94.hpp.

Referenced by ll(), ModifiedCN94Proposal(), rll(), and sampleBoundaryTriangleBirth().

double Arak::ModifiedCN94Proposal::ZETA_LOCAL_NOT_GLOBAL_RECOLOR [protected]
 

The probability that a local recolor move is proposed rather than a global recolor move.

Definition at line 1160 of file cn94.hpp.

Referenced by ll(), ModifiedCN94Proposal(), rll(), and sampleRecolor().

double Arak::ModifiedCN94Proposal::ZETA_SLIDE_NOT_MOVE_INT_VERTEX [protected]
 

The probability that a slide interior vertex move is proposed rather than a move interior vertex move.

Definition at line 1256 of file cn94.hpp.

Referenced by ll(), ModifiedCN94Proposal(), rll(), and sampleMoveInteriorVertex().


The documentation for this class was generated from the following files:
Generated on Wed May 25 14:40:50 2005 for Arak by doxygen 1.3.6