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

Arak::CN94Proposal Class Reference

#include <cn94.hpp>

Inheritance diagram for Arak::CN94Proposal:

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

Collaboration graph
[legend]
List of all members.

Detailed Description

An implementation of the proposal distribution described in Clifford & Nicholls (1994).

Definition at line 20 of file cn94.hpp.

Public Member Functions

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

virtual ~CN94Proposal ()
 Destructor.

virtual void sample (const Coloring &state, Arak::Util::Random &random, bool reversible=true)
 Resamples the proposal distribution to obtain a new move.

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.

virtual void result (bool accepted)
 This method is invoked by the Markov chain to inform the proposal of the result of its most recently proposed move.

template<typename charT, typename traits> void writeStatistics (std::basic_ostream< charT, traits > &out) const
 Writes statistics associated with the proposal to the supplied stream.


Protected Types

enum  MoveType {
  INT_TRIANGLE_BIRTH = 0, INT_TRIANGLE_DEATH, RECOLOR, MOVE_INT_VERTEX,
  MOVE_BD_VERTEX_ALONG_BD, MOVE_BD_VERTEX_PAST_CORNER, INT_VERTEX_BIRTH, INT_VERTEX_DEATH,
  BD_TRIANGLE_BIRTH, BD_TRIANGLE_DEATH, CORNER_CUT_BIRTH, CORNER_CUT_DEATH,
  INVALID_MOVE, UNSPECIFIED_MOVE
}
 The type of move. More...


Protected Member Functions

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

virtual void sampleInteriorDeath (const Coloring &state, Arak::Util::Random &random, bool reversible=true)
 Samples a move from the interior death group and updates this proposal object so the sampled move is the current proposal.

virtual void proposeBdTriangleDeath (const Coloring &state, Coloring::VertexHandle prevVertex, Coloring::VertexHandle vertex, Coloring::VertexHandle nextVertex, bool reversible=true)
virtual void proposeIntVertexDeath (const Coloring &state, Coloring::VertexHandle prevVertex, Coloring::VertexHandle vertex, Coloring::VertexHandle nextVertex, bool reversible=true)
virtual void proposeIntTriangleDeath (const Coloring &state, Coloring::VertexHandle prevVertex, Coloring::VertexHandle vertex, Coloring::VertexHandle nextVertex, bool reversible=true)
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 sampleMoveBdVertexPastCorner (const Coloring &state, Arak::Util::Random &random)
 Samples a move that moves a vertex along the boundary past an adjacent corner, and updates this proposal object so the sampled move is the current proposal.

virtual void sampleInteriorVertexBirth (const Coloring &state, Arak::Util::Random &random)
 Samples an interior vertex birth 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 interior vertex move and updates this proposal object so the sampled move is the current proposal.

virtual void sampleMoveVertexAlongBd (const Coloring &state, Arak::Util::Random &random)
 Samples a move that slides a boundary vertex along its boundary face 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 sampleBoundaryTriangleDeath (const Coloring &state, Arak::Util::Random &random, bool reversible=true)
 Samples a boundary triangle death move and updates this proposal object so the sampled move is the current proposal.

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

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

Point sampleInCastingBox (const Point &p, Arak::Util::Random &random) const
 Samples a point uniformly in a casting box centered at the supplied point.

bool inCastingBox (const Point &p, const Point &q) const
 Determines if q is in a casting box centered at p.

double castingArea () const
 Returns the area of a casting box.


Protected Attributes

unsigned long int numProposed [numMoveTypes]
 The number of times a move of each type has been proposed.

unsigned long int numAccepted [numMoveTypes]
 The number of times a move of each type has been accepted.

InteriorTriangleBirth itb
 The most recently proposed interior triangle birth move.

InteriorTriangleDeath itd
 The most recently proposed interior triangle death move.

Recolor rec
 The most recently proposed recolor move.

MoveInteriorVertex miv
 The most recently proposed "move interior vertex" move.

MoveVertexAlongBdEdge mbb
 The most recently proposed "move boundary vertex along boundary edge" move.

MoveBdVertexPastCorner mbc
 The most recently proposed "move boundary vertex past corner" move.

InteriorVertexBirth ivb
 The most recently proposed "interior vertex birth" move.

InteriorVertexDeath ivd
 The most recently proposed interior vertex death move.

BoundaryTriangleBirth btb
 The most recently proposed "boundary triangle birth" move.

BoundaryTriangleDeath btd
 The most recently proposed boundary triangle death move.

CornerCutBirth ccb
 The most recently proposed "corner cut birth" move.

CornerCutDeath ccd
 The most recently proposed boundary triangle death move.

double ZETA_BD_NOT_MR
 The probability that a move from the birth/death (BD) group is proposed rather than a move from the move/recolor (MR) group.

double ZETA_MOVE_NOT_RECOLOR
 The probability that a move from the move group is proposed rather than a recolor move.

double ZETA_BIRTH_NOT_DEATH
 The probability that a move from the birth group is proposed rather than one from the death group.

double ZETA_INT_NOT_BOUNDARY
 The probability that a move is proposed to act in the interior rather than on the boundary.

double ZETA_BOUND_NOT_CORNER
 The probability that a move acting on the boundary is proposed to act on an edge structure rather than a corner structure.

double ZETA_IB_VERTEX_NOT_TRIANGLE
 The probability that an interior birth move is proposed to create a new vertex rather than a new triangle.

MoveType curMoveType
 The move type most recently proposed.

double castingBoxRadius
 Half of the side-length of the casting boxes used by this algorithm.


Static Protected Attributes

const int numMoveTypes = 13
 The number of move types (excluding the unspecified marker).

const char * moveNames [numMoveTypes]
 The names of the moves.


Member Enumeration Documentation

enum Arak::CN94Proposal::MoveType [protected]
 

The type of move.

Enumeration values:
INT_TRIANGLE_BIRTH 
See also:
InteriorTriangleBirth
INT_TRIANGLE_DEATH 
See also:
InteriorTriangleDeath
RECOLOR 
See also:
Recolor
MOVE_INT_VERTEX 
See also:
MoveInteriorVertex
MOVE_BD_VERTEX_ALONG_BD 
See also:
MoveVertexAlongBd
MOVE_BD_VERTEX_PAST_CORNER 
See also:
MoveBdVertexPastCorner
INT_VERTEX_BIRTH 
See also:
InteriorVertexBirth
INT_VERTEX_DEATH 
See also:
InteriorVertexDeath
BD_TRIANGLE_BIRTH 
See also:
BoundaryTriangleBirth
BD_TRIANGLE_DEATH 
See also:
BoundaryTriangleDeath
CORNER_CUT_BIRTH 
See also:
CornerCutBirth
CORNER_CUT_DEATH 
See also:
CornerCutDeath
INVALID_MOVE  a move that is rejected
UNSPECIFIED_MOVE  a marker used for debugging

Definition at line 27 of file cn94.hpp.


Constructor & Destructor Documentation

CN94Proposal::CN94Proposal const Arak::Util::PropertyMap props  ) 
 

Constructor.

Definition at line 329 of file cn94.cpp.

References castingBoxRadius, curMoveType, INVALID_MOVE, itd, ivd, numAccepted, numMoveTypes, numProposed, Arak::Util::PropertyMap, ZETA_BD_NOT_MR, ZETA_BIRTH_NOT_DEATH, ZETA_BOUND_NOT_CORNER, ZETA_IB_VERTEX_NOT_TRIANGLE, ZETA_INT_NOT_BOUNDARY, and ZETA_MOVE_NOT_RECOLOR.

CN94Proposal::~CN94Proposal  )  [virtual]
 

Destructor.

Definition at line 366 of file cn94.cpp.


Member Function Documentation

double Arak::CN94Proposal::castingArea  )  const [inline, protected]
 

Returns the area of a casting box.

Returns:
the area of a casting box

Definition at line 1047 of file cn94.hpp.

References castingBoxRadius.

Referenced by Arak::ModifiedCN94Proposal::ll(), ll(), Arak::ModifiedCN94Proposal::rll(), and rll().

bool CN94Proposal::inCastingBox const Point p,
const Point q
const [protected]
 

Determines if q is in a casting box centered at p.

Parameters:
p the center of the casting box
q another point
Returns:
true iff q is in the casting box centered at p

Definition at line 36 of file cn94.cpp.

References castingBoxRadius, and Arak::Geometry::Point.

Referenced by ll(), and proposeIntTriangleDeath().

double CN94Proposal::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

Implements Arak::ColoringProposal.

Reimplemented in Arak::ModifiedCN94Proposal.

Definition at line 940 of file cn94.cpp.

References Arak::Coloring::area(), BD_TRIANGLE_BIRTH, BD_TRIANGLE_DEATH, Arak::Coloring::BdEdgeHandle, btb, castingArea(), ccb, Arak::CN94Proposal::CornerCutBirth::corner, CORNER_CUT_BIRTH, CORNER_CUT_DEATH, curMoveType, Arak::CN94Proposal::BoundaryTriangleBirth::edge, Arak::CN94Proposal::MoveBdVertexPastCorner::edge, inCastingBox(), INT_TRIANGLE_BIRTH, INT_TRIANGLE_DEATH, INT_VERTEX_BIRTH, INT_VERTEX_DEATH, INVALID_MOVE, Arak::CN94Proposal::Recolor::isConvex(), itb, ivb, Arak::ln(), mbb, mbc, MOVE_BD_VERTEX_ALONG_BD, MOVE_BD_VERTEX_PAST_CORNER, MOVE_INT_VERTEX, Arak::CN94Proposal::InteriorVertexBirth::nextVertex, Arak::Coloring::numBoundaryEdges(), Arak::Coloring::numInteriorEdges(), Arak::Coloring::numVertices(), Arak::CN94Proposal::InteriorVertexBirth::prevVertex, rec, RECOLOR, Arak::CN94Proposal::BoundaryTriangleBirth::u, Arak::CN94Proposal::BoundaryTriangleBirth::v, Arak::CN94Proposal::InteriorTriangleBirth::v, Arak::CN94Proposal::MoveVertexAlongBdEdge::vertex, Arak::CN94Proposal::InteriorTriangleBirth::w, ZETA_BD_NOT_MR, ZETA_BIRTH_NOT_DEATH, ZETA_BOUND_NOT_CORNER, ZETA_IB_VERTEX_NOT_TRIANGLE, ZETA_INT_NOT_BOUNDARY, and ZETA_MOVE_NOT_RECOLOR.

Referenced by Arak::ModifiedCN94Proposal::ll().

ColoringMove & CN94Proposal::move  )  [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

Implements Arak::ColoringProposal.

Reimplemented in Arak::ModifiedCN94Proposal.

Definition at line 368 of file cn94.cpp.

References BD_TRIANGLE_BIRTH, BD_TRIANGLE_DEATH, btb, btd, ccb, ccd, CORNER_CUT_BIRTH, CORNER_CUT_DEATH, curMoveType, INT_TRIANGLE_BIRTH, INT_TRIANGLE_DEATH, INT_VERTEX_BIRTH, INT_VERTEX_DEATH, INVALID_MOVE, itb, itd, ivb, ivd, mbb, mbc, miv, MOVE_BD_VERTEX_ALONG_BD, MOVE_BD_VERTEX_PAST_CORNER, MOVE_INT_VERTEX, rec, and RECOLOR.

Referenced by Arak::ModifiedCN94Proposal::move().

void CN94Proposal::proposeBdTriangleDeath const Coloring state,
Coloring::VertexHandle  prevVertex,
Coloring::VertexHandle  vertex,
Coloring::VertexHandle  nextVertex,
bool  reversible = true
[protected, virtual]
 

Definition at line 479 of file cn94.cpp.

References BD_TRIANGLE_DEATH, btd, curMoveType, Arak::Coloring::deleteBdTriangle(), INVALID_MOVE, Arak::Geometry::Point, Arak::CN94Proposal::BoundaryTriangleDeath::reset(), Arak::Geometry::Segment, and Arak::Coloring::VertexHandle.

Referenced by sampleBoundaryTriangleDeath(), and sampleInteriorDeath().

void CN94Proposal::proposeIntTriangleDeath const Coloring state,
Coloring::VertexHandle  prevVertex,
Coloring::VertexHandle  vertex,
Coloring::VertexHandle  nextVertex,
bool  reversible = true
[protected, virtual]
 

Definition at line 546 of file cn94.cpp.

References curMoveType, Arak::Coloring::deleteIntTriangle(), inCastingBox(), INT_TRIANGLE_DEATH, INVALID_MOVE, itd, Arak::Geometry::Point, Arak::CN94Proposal::InteriorTriangleDeath::reset(), and Arak::Coloring::VertexHandle.

Referenced by sampleInteriorDeath().

void CN94Proposal::proposeIntVertexDeath const Coloring state,
Coloring::VertexHandle  prevVertex,
Coloring::VertexHandle  vertex,
Coloring::VertexHandle  nextVertex,
bool  reversible = true
[protected, virtual]
 

Definition at line 509 of file cn94.cpp.

References curMoveType, Arak::Coloring::deleteVertex(), INT_VERTEX_DEATH, INVALID_MOVE, ivd, Arak::Geometry::Point, Arak::CN94Proposal::InteriorVertexDeath::reset(), Arak::Geometry::Segment, and Arak::Coloring::VertexHandle.

Referenced by sampleInteriorDeath().

virtual void Arak::CN94Proposal::result bool  accepted  )  [inline, virtual]
 

This method is invoked by the Markov chain to inform the proposal of the result of its most recently proposed move.

Implements Arak::ColoringProposal.

Definition at line 1110 of file cn94.hpp.

References curMoveType, and numAccepted.

double CN94Proposal::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

Implements Arak::ColoringProposal.

Reimplemented in Arak::ModifiedCN94Proposal.

Definition at line 1061 of file cn94.cpp.

References Arak::Coloring::area(), BD_TRIANGLE_BIRTH, BD_TRIANGLE_DEATH, Arak::Coloring::BdEdgeHandle, btd, castingArea(), ccb, Arak::CN94Proposal::CornerCutBirth::corner, CORNER_CUT_BIRTH, CORNER_CUT_DEATH, curMoveType, Arak::CN94Proposal::MoveBdVertexPastCorner::edge, INT_TRIANGLE_BIRTH, INT_TRIANGLE_DEATH, INT_VERTEX_BIRTH, INT_VERTEX_DEATH, INVALID_MOVE, Arak::CN94Proposal::Recolor::isConvex(), Arak::CN94Proposal::InteriorTriangleDeath::isShort, itd, ivd, Arak::ln(), mbb, mbc, MOVE_BD_VERTEX_ALONG_BD, MOVE_BD_VERTEX_PAST_CORNER, MOVE_INT_VERTEX, Arak::CN94Proposal::InteriorVertexDeath::newEdgeLength, Arak::CN94Proposal::BoundaryTriangleDeath::nextBoundaryVertex, Arak::Coloring::numBoundaryEdges(), Arak::Coloring::numInteriorEdges(), Arak::Coloring::numVertices(), Arak::CN94Proposal::BoundaryTriangleDeath::prevBoundaryVertex, rec, RECOLOR, Arak::CN94Proposal::BoundaryTriangleDeath::up, Arak::CN94Proposal::MoveVertexAlongBdEdge::vertex, Arak::CN94Proposal::BoundaryTriangleDeath::vp, ZETA_BD_NOT_MR, ZETA_BIRTH_NOT_DEATH, ZETA_BOUND_NOT_CORNER, ZETA_IB_VERTEX_NOT_TRIANGLE, ZETA_INT_NOT_BOUNDARY, and ZETA_MOVE_NOT_RECOLOR.

Referenced by Arak::ModifiedCN94Proposal::rll().

void CN94Proposal::sample const Coloring state,
Arak::Util::Random random,
bool  reversible = true
[virtual]
 

Resamples the proposal distribution to obtain a new move.

Parameters:
state the current state of the Markov chain
random a source of pseudorandomness
reversible a flag which indicates whether the proposal must be capable of proposing the reverse of sampled move. This is set to false when the proposal is used for stochastic optimization. (Note that it must be possible to undo any move; this flag allows the proposal to sample moves whose reverses cannot be sampled.)

Implements Arak::ColoringProposal.

Definition at line 389 of file cn94.cpp.

References curMoveType, numProposed, sampleBoundaryTriangleBirth(), sampleBoundaryTriangleDeath(), sampleCornerCutBirth(), sampleCornerCutDeath(), sampleInteriorDeath(), sampleInteriorTriangleBirth(), sampleInteriorVertexBirth(), sampleMoveBdVertexPastCorner(), sampleMoveInteriorVertex(), sampleMoveVertexAlongBd(), sampleRecolor(), Arak::Util::Random::uniform(), UNSPECIFIED_MOVE, ZETA_BD_NOT_MR, ZETA_BIRTH_NOT_DEATH, ZETA_BOUND_NOT_CORNER, ZETA_IB_VERTEX_NOT_TRIANGLE, ZETA_INT_NOT_BOUNDARY, and ZETA_MOVE_NOT_RECOLOR.

void CN94Proposal::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.

A window edge $e$ is sampled uniformly, and two points $u$ and $v$ are sampled uniformly along $e$. A third point $w$ is sampled in a square box of side length $|e|$ that is inside the colored region with $e$ as one of its sides. 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 in Arak::ModifiedCN94Proposal.

Definition at line 810 of file cn94.cpp.

References BD_TRIANGLE_BIRTH, Arak::Coloring::BdEdgeHandle, btb, curMoveType, Arak::Coloring::getBoundaryEdge(), Arak::Coloring::interior(), INVALID_MOVE, Arak::Coloring::newBoundaryTriangle(), Arak::Coloring::numBoundaryEdges(), Arak::Geometry::Point, Arak::CN94Proposal::BoundaryTriangleBirth::reset(), Arak::Util::Random::uniform(), and Arak::Geometry::Vector.

Referenced by sample(), and Arak::ModifiedCN94Proposal::sampleBoundaryTriangleBirth().

void CN94Proposal::sampleBoundaryTriangleDeath const Coloring state,
Arak::Util::Random random,
bool  reversible = true
[protected, virtual]
 

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

A boundary edge is selected uniformly at random, and if it is part of a boundary triangle (that could be created by a boundary triangle birth), a move that removes the triangle is proposed.

Parameters:
state the current state of the Markov chain
random a source of pseudorandomness
reversible a flag which indicates whether the proposal must be capable of proposing the reverse of sampled move. This is set to false when the proposal is used for stochastic optimization. (Note that it must be possible to undo any move; this flag allows the proposal to sample moves whose reverses cannot be sampled.)

Definition at line 855 of file cn94.cpp.

References Arak::Coloring::BdEdgeHandle, curMoveType, Arak::Coloring::getBoundaryEdge(), INVALID_MOVE, Arak::Coloring::numBoundaryEdges(), proposeBdTriangleDeath(), Arak::Util::Random::uniform(), and Arak::Coloring::VertexHandle.

Referenced by sample().

void CN94Proposal::sampleCornerCutBirth const Coloring state,
Arak::Util::Random random
[protected, virtual]
 

Samples a corner cut birth move and updates this proposal object so the sampled move is the current proposal.

A corner vertex $c$ is sampled uniformly, and two points $u$ and $v$ are sampled uniformly along its adjacent boundary edges. A move adding the corner triangle $cuv$ 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

Definition at line 889 of file cn94.cpp.

References Arak::Coloring::BdEdgeHandle, ccb, CORNER_CUT_BIRTH, curMoveType, INVALID_MOVE, Arak::Coloring::newCornerTriangle(), Arak::Geometry::Point, Arak::Coloring::randomVertex(), Arak::CN94Proposal::CornerCutBirth::reset(), and Arak::Coloring::VertexHandle.

Referenced by sample().

void CN94Proposal::sampleCornerCutDeath const Coloring state,
Arak::Util::Random random
[protected, virtual]
 

Samples a corner cut death move and updates this proposal object so the sampled move is the current proposal.

A corner vertex is selected uniformly at random, and if it is part of a corner triangle (that could be created by a corner cut birth), a move that removes the triangle is proposed.

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

Definition at line 913 of file cn94.cpp.

References ccd, CORNER_CUT_DEATH, curMoveType, Arak::Coloring::deleteCornerTriangle(), INVALID_MOVE, Arak::Coloring::randomVertex(), Arak::CN94Proposal::CornerCutDeath::reset(), and Arak::Coloring::VertexHandle.

Referenced by sample().

Point CN94Proposal::sampleInCastingBox const Point p,
Arak::Util::Random random
const [protected]
 

Samples a point uniformly in a casting box centered at the supplied point.

Parameters:
p the center of the casting box
random a source of pseudorandomness
Returns:
a point sampled uniformly in the casting box

Definition at line 26 of file cn94.cpp.

References castingBoxRadius, Point, Arak::Geometry::Point, and Arak::Util::Random::uniform().

Referenced by sampleInteriorTriangleBirth(), and sampleMoveInteriorVertex().

void CN94Proposal::sampleInteriorDeath const Coloring state,
Arak::Util::Random random,
bool  reversible = true
[protected, virtual]
 

Samples a move from the interior death group and updates this proposal object so the sampled move is the current proposal.

The interior death group consists of moves that remove one or more vertices from the interior of the coloring. A vertex in the interior of the coloring is selected uniformly at random and then one of the three move types is proposed, depending upon the topology of the vertex's neighborhood:

  • Interior triangle death: If the sampled vertex is part of an interior triangle, then the triangle is removed from the coloring. (This is the reverse of a triangle birth move.)

  • Interior vertex death: If the sampled vertex is part of an interior polygon with more than three vertices, then the vertex is removed and its neighbors are connected. (This is the reverse of an interior vertex birth move.)

  • Boundary triangle death: If the sampled vertex is part of a triangle where the other two vertices lie on the boundary, then the triangle is removed. (This is the reverse of a boundary triangle birth move, and its result can also be achieved by a boundary edge death move.)

Parameters:
state the current state of the Markov chain
random a source of pseudorandomness
reversible a flag which indicates whether the proposal must be capable of proposing the reverse of sampled move. This is set to false when the proposal is used for stochastic optimization. (Note that it must be possible to undo any move; this flag allows the proposal to sample moves whose reverses cannot be sampled.)

Definition at line 587 of file cn94.cpp.

References curMoveType, INVALID_MOVE, Arak::Coloring::numVertices(), proposeBdTriangleDeath(), proposeIntTriangleDeath(), proposeIntVertexDeath(), Arak::Coloring::randomVertex(), and Arak::Coloring::VertexHandle.

Referenced by sample().

void CN94Proposal::sampleInteriorTriangleBirth const Coloring state,
Arak::Util::Random random
[protected, virtual]
 

Samples an interior triangle birth move and updates this proposal object so the sampled move is the current proposal.

A point $u$ is sampled uniformly from the colored region. Two other points $v$ and $w$ are sampled uniformly at a casting box centered at $u$, and a move adding the 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

Definition at line 462 of file cn94.cpp.

References curMoveType, INT_TRIANGLE_BIRTH, Arak::Coloring::interior(), INVALID_MOVE, itb, Arak::Coloring::newInteriorTriangle(), Arak::Geometry::Point, Arak::Coloring::randomPoint(), Arak::CN94Proposal::InteriorTriangleBirth::reset(), and sampleInCastingBox().

Referenced by sample().

void CN94Proposal::sampleInteriorVertexBirth const Coloring state,
Arak::Util::Random random
[protected, virtual]
 

Samples an interior vertex birth move and updates this proposal object so the sampled move is the current proposal.

An interior edge $e$ is sampled uniformly and a point $p$ is sampled uniformly in a box of side length $|e|$ that is oriented so its edges are parallel and orthogonal to $e$ and its center is the center of $e$. The proposed move splits $e$ at $p$.

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

Definition at line 726 of file cn94.cpp.

References curMoveType, Arak::Coloring::getInteriorEdge(), INT_VERTEX_BIRTH, Arak::Coloring::IntEdgeHandle, Arak::Coloring::interior(), INVALID_MOVE, ivb, Arak::Coloring::numInteriorEdges(), Arak::Geometry::Point, Arak::CN94Proposal::InteriorVertexBirth::reset(), Arak::Coloring::splitEdge(), Arak::Util::Random::uniform(), and Arak::Geometry::Vector.

Referenced by sample().

void CN94Proposal::sampleMoveBdVertexPastCorner const Coloring state,
Arak::Util::Random random
[protected, virtual]
 

Samples a move that moves a vertex along the boundary past an adjacent corner, and updates this proposal object so the sampled move is the current proposal.

A corner vertex $u$is sampled uniformly and one of its adjacent boundary edges $\{u, v\}$ is sampled uniformly. A point $p$ is sampled uniformly on its other incident boundary edge $\{u, w\}$. The proposed move relocates $v$ to $p$.

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

Definition at line 681 of file cn94.cpp.

References Arak::Coloring::BdEdgeHandle, Arak::Util::Random::bernoulli(), curMoveType, INVALID_MOVE, mbc, MOVE_BD_VERTEX_PAST_CORNER, Arak::Coloring::moveBdVertexPastCorner(), Arak::Geometry::Point, Arak::Coloring::randomVertex(), Arak::CN94Proposal::MoveBdVertexPastCorner::reset(), and Arak::Coloring::VertexHandle.

Referenced by sample().

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

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

An interior vertex is sampled uniformly, a new location is sampled uniformly in a casting box centered at the vertex, and a move that relocates the vertex to the new location is proposed.

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

Reimplemented in Arak::ModifiedCN94Proposal.

Definition at line 756 of file cn94.cpp.

References curMoveType, Arak::Coloring::interior(), INVALID_MOVE, miv, MOVE_INT_VERTEX, Arak::Coloring::moveIntVertex(), Arak::Coloring::numVertices(), Arak::Geometry::Point, Arak::Coloring::randomVertex(), Arak::CN94Proposal::MoveInteriorVertex::reset(), sampleInCastingBox(), and Arak::Coloring::VertexHandle.

Referenced by sample(), and Arak::ModifiedCN94Proposal::sampleMoveInteriorVertex().

void CN94Proposal::sampleMoveVertexAlongBd const Coloring state,
Arak::Util::Random random
[protected, virtual]
 

Samples a move that slides a boundary vertex along its boundary face and updates this proposal object so the sampled move is the current proposal.

A boundary vertex is sampled uniformly, a new location is sampled uniformly in the union of its incident boundary edges. A move that relocates the vertex to the new location is proposed.

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

Definition at line 778 of file cn94.cpp.

References curMoveType, INVALID_MOVE, mbb, MOVE_BD_VERTEX_ALONG_BD, Arak::Coloring::moveVertexAlongBd(), Arak::Coloring::numVertices(), Arak::Geometry::Point, Arak::Coloring::randomVertex(), Arak::CN94Proposal::MoveVertexAlongBdEdge::reset(), Arak::Util::Random::uniform(), Arak::Geometry::Vector, and Arak::Coloring::VertexHandle.

Referenced by sample().

void CN94Proposal::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.

Two distinct interior edges $e_1$ and $e_2$ are sampled uniformly. The proposed move replaces these edges with two new edges that join one vertex of each original edge.

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

Reimplemented in Arak::ModifiedCN94Proposal.

Definition at line 641 of file cn94.cpp.

References Arak::Util::Random::bernoulli(), curMoveType, Arak::Coloring::getInteriorEdge(), Arak::Coloring::IntEdgeHandle, INVALID_MOVE, Arak::Coloring::numInteriorEdges(), rec, RECOLOR, Arak::Coloring::recolorQuadrilateral(), Arak::CN94Proposal::Recolor::reset(), Arak::Geometry::Segment, and Arak::Util::Random::uniform().

Referenced by sample(), and Arak::ModifiedCN94Proposal::sampleRecolor().

template<typename charT, typename traits>
void Arak::CN94Proposal::writeStatistics std::basic_ostream< charT, traits > &  out  )  const [inline]
 

Writes statistics associated with the proposal to the supplied stream.

Parameters:
out the stream on which the statistics should be written

Definition at line 1121 of file cn94.hpp.

References moveNames, numAccepted, numMoveTypes, and numProposed.

Referenced by sampler().


Member Data Documentation

BoundaryTriangleBirth Arak::CN94Proposal::btb [protected]
 

The most recently proposed "boundary triangle birth" move.

Definition at line 571 of file cn94.hpp.

Referenced by ll(), move(), and sampleBoundaryTriangleBirth().

BoundaryTriangleDeath Arak::CN94Proposal::btd [protected]
 

The most recently proposed boundary triangle death move.

Definition at line 639 of file cn94.hpp.

Referenced by move(), proposeBdTriangleDeath(), and rll().

double Arak::CN94Proposal::castingBoxRadius [protected]
 

Half of the side-length of the casting boxes used by this algorithm.

A casting box is an axis-aligned square that is used to enforce locality in many of the moves used by this proposal distribution.

Definition at line 1020 of file cn94.hpp.

Referenced by castingArea(), CN94Proposal(), inCastingBox(), and sampleInCastingBox().

CornerCutBirth Arak::CN94Proposal::ccb [protected]
 

The most recently proposed "corner cut birth" move.

Definition at line 701 of file cn94.hpp.

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

CornerCutDeath Arak::CN94Proposal::ccd [protected]
 

The most recently proposed boundary triangle death move.

Definition at line 759 of file cn94.hpp.

Referenced by move(), and sampleCornerCutDeath().

MoveType Arak::CN94Proposal::curMoveType [protected]
 

The move type most recently proposed.

Definition at line 1012 of file cn94.hpp.

Referenced by CN94Proposal(), ll(), move(), proposeBdTriangleDeath(), proposeIntTriangleDeath(), proposeIntVertexDeath(), result(), rll(), sample(), sampleBoundaryTriangleBirth(), sampleBoundaryTriangleDeath(), sampleCornerCutBirth(), sampleCornerCutDeath(), sampleInteriorDeath(), sampleInteriorTriangleBirth(), sampleInteriorVertexBirth(), sampleMoveBdVertexPastCorner(), sampleMoveInteriorVertex(), sampleMoveVertexAlongBd(), and sampleRecolor().

InteriorTriangleBirth Arak::CN94Proposal::itb [protected]
 

The most recently proposed interior triangle birth move.

Definition at line 108 of file cn94.hpp.

Referenced by ll(), move(), and sampleInteriorTriangleBirth().

InteriorTriangleDeath Arak::CN94Proposal::itd [protected]
 

The most recently proposed interior triangle death move.

Definition at line 173 of file cn94.hpp.

Referenced by CN94Proposal(), move(), proposeIntTriangleDeath(), and rll().

InteriorVertexBirth Arak::CN94Proposal::ivb [protected]
 

The most recently proposed "interior vertex birth" move.

Definition at line 445 of file cn94.hpp.

Referenced by ll(), move(), and sampleInteriorVertexBirth().

InteriorVertexDeath Arak::CN94Proposal::ivd [protected]
 

The most recently proposed interior vertex death move.

Definition at line 505 of file cn94.hpp.

Referenced by CN94Proposal(), move(), proposeIntVertexDeath(), and rll().

MoveVertexAlongBdEdge Arak::CN94Proposal::mbb [protected]
 

The most recently proposed "move boundary vertex along boundary edge" move.

Definition at line 342 of file cn94.hpp.

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

MoveBdVertexPastCorner Arak::CN94Proposal::mbc [protected]
 

The most recently proposed "move boundary vertex past corner" move.

Definition at line 398 of file cn94.hpp.

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

MoveInteriorVertex Arak::CN94Proposal::miv [protected]
 

The most recently proposed "move interior vertex" move.

Definition at line 294 of file cn94.hpp.

Referenced by move(), and sampleMoveInteriorVertex().

const char * CN94Proposal::moveNames [static, protected]
 

Initial value:

 {
  "interior triangle birth",
  "interior triangle death",
  "recolor quadrilateral",
  "move interior vertex",
  "move vertex along boundary",
  "move vertex past corner",
  "interior vertex birth",
  "interior vertex death",
  "boundary triangle birth",
  "boundary triangle death",
  "corner cut birth",
  "corner cut death",
  "invalid move"
}
The names of the moves.

Definition at line 10 of file cn94.cpp.

Referenced by writeStatistics().

unsigned long int Arak::CN94Proposal::numAccepted[numMoveTypes] [protected]
 

The number of times a move of each type has been accepted.

Definition at line 62 of file cn94.hpp.

Referenced by CN94Proposal(), result(), and writeStatistics().

const int Arak::CN94Proposal::numMoveTypes = 13 [static, protected]
 

The number of move types (excluding the unspecified marker).

Definition at line 47 of file cn94.hpp.

Referenced by CN94Proposal(), and writeStatistics().

unsigned long int Arak::CN94Proposal::numProposed[numMoveTypes] [protected]
 

The number of times a move of each type has been proposed.

Definition at line 57 of file cn94.hpp.

Referenced by CN94Proposal(), sample(), and writeStatistics().

Recolor Arak::CN94Proposal::rec [protected]
 

The most recently proposed recolor move.

Definition at line 247 of file cn94.hpp.

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

double Arak::CN94Proposal::ZETA_BD_NOT_MR [protected]
 

The probability that a move from the birth/death (BD) group is proposed rather than a move from the move/recolor (MR) group.

This is referred to as $\zeta_1$ in (Clifford & Nicholls, 1994).

Definition at line 972 of file cn94.hpp.

Referenced by CN94Proposal(), ll(), rll(), and sample().

double Arak::CN94Proposal::ZETA_BIRTH_NOT_DEATH [protected]
 

The probability that a move from the birth group is proposed rather than one from the death group.

This is referred to as $\zeta_3$ in (Clifford & Nicholls, 1994).

Definition at line 986 of file cn94.hpp.

Referenced by CN94Proposal(), ll(), rll(), and sample().

double Arak::CN94Proposal::ZETA_BOUND_NOT_CORNER [protected]
 

The probability that a move acting on the boundary is proposed to act on an edge structure rather than a corner structure.

This is referred to as $\zeta_5$ in (Clifford & Nicholls, 1994).

Definition at line 1000 of file cn94.hpp.

Referenced by CN94Proposal(), ll(), rll(), and sample().

double Arak::CN94Proposal::ZETA_IB_VERTEX_NOT_TRIANGLE [protected]
 

The probability that an interior birth move is proposed to create a new vertex rather than a new triangle.

This is referred to as $\zeta_6$ in (Clifford & Nicholls, 1994).

Definition at line 1007 of file cn94.hpp.

Referenced by CN94Proposal(), ll(), rll(), and sample().

double Arak::CN94Proposal::ZETA_INT_NOT_BOUNDARY [protected]
 

The probability that a move is proposed to act in the interior rather than on the boundary.

This is referred to as $\zeta_4$ in (Clifford & Nicholls, 1994).

Definition at line 993 of file cn94.hpp.

Referenced by CN94Proposal(), ll(), rll(), and sample().

double Arak::CN94Proposal::ZETA_MOVE_NOT_RECOLOR [protected]
 

The probability that a move from the move group is proposed rather than a recolor move.

This is referred to as $\zeta_2$ in (Clifford & Nicholls, 1994).

Definition at line 979 of file cn94.hpp.

Referenced by CN94Proposal(), ll(), rll(), and sample().


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