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

Arak::GridColorEstimator Class Reference

#include <estimation.hpp>

Inheritance diagram for Arak::GridColorEstimator:

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

Collaboration graph
[legend]
List of all members.

Detailed Description

A grid of point color estimators.

Definition at line 286 of file estimation.hpp.

Public Member Functions

 GridColorEstimator (ArakMarkovChain &chain, const Arak::Util::PropertyMap &props)
 Constructor for a grid of point color estimators.

virtual ~GridColorEstimator ()
 Destructor.

virtual void recolored (const Geometry::Point &a, const Geometry::Point &b, const Geometry::Point &c)
 This method is invoked to inform the listener that the triangle with the supplied vertices has been recolored.

virtual void recolored (const Geometry::Point &a, const Geometry::Point &b, const Geometry::Point &c, const Geometry::Point &d)
 This method is invoked to inform the listener that the quadrilateral with the supplied vertices has been recolored.

virtual void visualize (CGAL::Qt_widget &widget) const
 Renders a graphical representation of this grid color estimator using the supplied widget.

template<typename charT, typename traits> void write (std::basic_ostream< charT, traits > &out) const
 Writes an ASCII representation of the current estimates to the supplied stream.


Protected Types

typedef Grid< PointColorEstimator * > EstimatorGrid

Protected Attributes

const ArakMarkovChainchain
 The Markov chain generating the samples used in estimation.

std::list< PointColorEstimator * > estimators
 A list of the point color estimators.

EstimatorGridgrid
 An index of the query points at whose locations the color is estimated.


Member Typedef Documentation

typedef Grid<PointColorEstimator*> Arak::GridColorEstimator::EstimatorGrid [protected]
 

Definition at line 303 of file estimation.hpp.

Referenced by GridColorEstimator().


Constructor & Destructor Documentation

GridColorEstimator::GridColorEstimator ArakMarkovChain chain,
const Arak::Util::PropertyMap props
 

Constructor for a grid of point color estimators.

This constructor uses the properties "arak.mcmc.estimation.avg_grid.rows" and "arak.mcmc.estimation.avg_grid.cols" to define a grid of points at which the color is estimated.

Parameters:
chain the Markov chain generating the samples used for estimation
props a properties map

Definition at line 42 of file estimation.cpp.

References Arak::ArakMarkovChain, Arak::Color, EstimatorGrid, Arak::Grid< ItemType >::getCell(), Arak::MarkovChain< MarkovChainTraits >::getState(), grid, Arak::Geometry::Point, Arak::Util::PropertyMap, and Arak::Geometry::Rectangle.

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

Destructor.

Definition at line 330 of file estimation.hpp.

References grid.


Member Function Documentation

virtual void Arak::GridColorEstimator::recolored const Geometry::Point a,
const Geometry::Point b,
const Geometry::Point c,
const Geometry::Point d
[inline, virtual]
 

This method is invoked to inform the listener that the quadrilateral with the supplied vertices has been recolored.

The vertices are supplied in either clockwise or counter-clockwise order. Note that this quadrilateral is simple, but not necessarily convex.

Parameters:
a the first vertex of the quadrilateral
b the second vertex of the quadrilateral
c the third vertex of the quadrilateral
d the fourth vertex of the quadrilateral

Reimplemented from Arak::Coloring::Listener.

Definition at line 363 of file estimation.hpp.

References Arak::Geometry::Point, and recolored().

void GridColorEstimator::recolored const Geometry::Point a,
const Geometry::Point b,
const Geometry::Point c
[virtual]
 

This method is invoked to inform the listener that the triangle with the supplied vertices has been recolored.

Parameters:
a the first vertex of the triangle
b the second vertex of the triangle
c the third vertex of the triangle

Reimplemented from Arak::Coloring::Listener.

Definition at line 70 of file estimation.cpp.

References Arak::PointColorEstimator::color, grid, Arak::opposite(), Arak::PointColorEstimator::point, Arak::Geometry::Point, Arak::PointColorEstimator::recolor(), and Arak::Geometry::Triangle.

Referenced by recolored().

void GridColorEstimator::visualize CGAL::Qt_widget &  widget  )  const [virtual]
 

Renders a graphical representation of this grid color estimator using the supplied widget.

The point color estimates are rendered as squares of varying gray level.

Todo:
Use a Qt image rendering method
Parameters:
widget the widget on which to visualize the estimates

Definition at line 82 of file estimation.cpp.

References Arak::PointColorEstimator::estimate(), Arak::Grid< ItemType >::getCell(), grid, Arak::Grid< ItemType >::numCols(), and Arak::Grid< ItemType >::numRows().

Referenced by Arak::ColoringQTLayer::draw(), and Arak::operator<<().

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

Writes an ASCII representation of the current estimates to the supplied stream.

The first line gives the number of samples used in estimation; the second gives the number of rows and columns of the grid; the third line is the boundary of the grid. Then the estimates are written out as a matrix (one line per row) in reverse-row order (so the first element corresponds to the upper left corner of the grid). Each estimate is the probability the cell's center point is black.

Parameters:
out the stream on which to write the estimates

Definition at line 395 of file estimation.hpp.

References Arak::Grid< ItemType >::boundary(), Arak::PointColorEstimator::estimate(), Arak::Grid< ItemType >::getCell(), Arak::MarkovChain< MarkovChainTraits >::getNumSamples(), grid, GRID_ESTIMATE_HEADER, Arak::Grid< ItemType >::numCols(), and Arak::Grid< ItemType >::numRows().


Member Data Documentation

const ArakMarkovChain& Arak::GridColorEstimator::chain [protected]
 

The Markov chain generating the samples used in estimation.

Definition at line 293 of file estimation.hpp.

std::list<PointColorEstimator*> Arak::GridColorEstimator::estimators [protected]
 

A list of the point color estimators.

Definition at line 298 of file estimation.hpp.

EstimatorGrid* Arak::GridColorEstimator::grid [protected]
 

An index of the query points at whose locations the color is estimated.

Definition at line 309 of file estimation.hpp.

Referenced by GridColorEstimator(), recolored(), visualize(), write(), and ~GridColorEstimator().


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