psimpl 7
psimpl.h File Reference
#include <queue>
#include <stack>
#include <numeric>
#include <algorithm>
#include <cmath>

Go to the source code of this file.

Classes

class  psimpl::util::scoped_array< T >
 A smart pointer for holding a dynamically allocated array. More...
struct  psimpl::math::Statistics
 POD structure for storing several statistical values. More...
class  psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator >
 Provides various simplification algorithms for n-dimensional simple polylines. More...
class  psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator >::DPHelper
 Douglas-Peucker approximation helper class. More...
struct  psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator >::DPHelper::SubPoly
 Defines a sub polyline. More...
struct  psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator >::DPHelper::KeyInfo
 Defines the key of a polyline. More...
struct  psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator >::DPHelper::SubPolyAlt
 Defines a sub polyline including its key. More...

Namespaces

namespace  psimpl
 

Root namespace of the polyline simplification library.


namespace  psimpl::util
 

Contains utility functions and classes.


namespace  psimpl::math
 

Contains functions for calculating statistics and distances between various geometric entities.


Functions

template<typename T >
void psimpl::util::swap (scoped_array< T > &a, scoped_array< T > &b)
template<unsigned DIM, class InputIterator >
bool psimpl::math::equal (InputIterator p1, InputIterator p2)
 Determines if two points have the exact same coordinates.
template<unsigned DIM, class InputIterator , class OutputIterator >
OutputIterator psimpl::math::make_vector (InputIterator p1, InputIterator p2, OutputIterator result)
 Creates a vector from two points.
template<unsigned DIM, class InputIterator >
std::iterator_traits
< InputIterator >::value_type 
psimpl::math::dot (InputIterator v1, InputIterator v2)
 Computes the dot product of two vectors.
template<unsigned DIM, class InputIterator , class OutputIterator >
OutputIterator psimpl::math::interpolate (InputIterator p1, InputIterator p2, float fraction, OutputIterator result)
 Peforms linear interpolation between two points.
template<unsigned DIM, class InputIterator1 , class InputIterator2 >
std::iterator_traits
< InputIterator1 >::value_type 
psimpl::math::point_distance2 (InputIterator1 p1, InputIterator2 p2)
 Computes the squared distance of two points.
template<unsigned DIM, class InputIterator >
std::iterator_traits
< InputIterator >::value_type 
psimpl::math::line_distance2 (InputIterator l1, InputIterator l2, InputIterator p)
 Computes the squared distance between an infinite line (l1, l2) and a point p.
template<unsigned DIM, class InputIterator >
std::iterator_traits
< InputIterator >::value_type 
psimpl::math::segment_distance2 (InputIterator s1, InputIterator s2, InputIterator p)
 Computes the squared distance between a line segment (s1, s2) and a point p.
template<unsigned DIM, class InputIterator >
std::iterator_traits
< InputIterator >::value_type 
psimpl::math::ray_distance2 (InputIterator r1, InputIterator r2, InputIterator p)
 Computes the squared distance between a ray (r1, r2) and a point p.
template<class InputIterator >
Statistics psimpl::math::compute_statistics (InputIterator first, InputIterator last)
 Computes various statistics for the range [first, last)
template<unsigned DIM, class ForwardIterator , class OutputIterator >
OutputIterator psimpl::simplify_nth_point (ForwardIterator first, ForwardIterator last, unsigned n, OutputIterator result)
 Performs the nth point routine (NP).
template<unsigned DIM, class ForwardIterator , class OutputIterator >
OutputIterator psimpl::simplify_radial_distance (ForwardIterator first, ForwardIterator last, typename std::iterator_traits< ForwardIterator >::value_type tol, OutputIterator result)
 Performs the (radial) distance between points routine (RD).
template<unsigned DIM, class ForwardIterator , class OutputIterator >
OutputIterator psimpl::simplify_perpendicular_distance (ForwardIterator first, ForwardIterator last, typename std::iterator_traits< ForwardIterator >::value_type tol, unsigned repeat, OutputIterator result)
 Repeatedly performs the perpendicular distance routine (PD).
template<unsigned DIM, class ForwardIterator , class OutputIterator >
OutputIterator psimpl::simplify_perpendicular_distance (ForwardIterator first, ForwardIterator last, typename std::iterator_traits< ForwardIterator >::value_type tol, OutputIterator result)
 Performs the perpendicular distance routine (PD).
template<unsigned DIM, class ForwardIterator , class OutputIterator >
OutputIterator psimpl::simplify_reumann_witkam (ForwardIterator first, ForwardIterator last, typename std::iterator_traits< ForwardIterator >::value_type tol, OutputIterator result)
 Performs Reumann-Witkam polyline simplification (RW).
template<unsigned DIM, class ForwardIterator , class OutputIterator >
OutputIterator psimpl::simplify_opheim (ForwardIterator first, ForwardIterator last, typename std::iterator_traits< ForwardIterator >::value_type min_tol, typename std::iterator_traits< ForwardIterator >::value_type max_tol, OutputIterator result)
 Performs Opheim polyline simplification (OP).
template<unsigned DIM, class BidirectionalIterator , class OutputIterator >
OutputIterator psimpl::simplify_lang (BidirectionalIterator first, BidirectionalIterator last, typename std::iterator_traits< BidirectionalIterator >::value_type tol, unsigned look_ahead, OutputIterator result)
 Performs Lang polyline simplification (LA).
template<unsigned DIM, class ForwardIterator , class OutputIterator >
OutputIterator psimpl::simplify_douglas_peucker (ForwardIterator first, ForwardIterator last, typename std::iterator_traits< ForwardIterator >::value_type tol, OutputIterator result)
 Performs Douglas-Peucker polyline simplification (DP).
template<unsigned DIM, class ForwardIterator , class OutputIterator >
OutputIterator psimpl::simplify_douglas_peucker_n (ForwardIterator first, ForwardIterator last, unsigned count, OutputIterator result)
 Performs a variant of Douglas-Peucker polyline simplification (DPn).
template<unsigned DIM, class ForwardIterator , class OutputIterator >
OutputIterator psimpl::compute_positional_errors2 (ForwardIterator original_first, ForwardIterator original_last, ForwardIterator simplified_first, ForwardIterator simplified_last, OutputIterator result, bool *valid=0)
 Computes the squared positional error between a polyline and its simplification.
template<unsigned DIM, class ForwardIterator >
math::Statistics psimpl::compute_positional_error_statistics (ForwardIterator original_first, ForwardIterator original_last, ForwardIterator simplified_first, ForwardIterator simplified_last, bool *valid=0)
 Computes statistics for the positional errors between a polyline and its simplification.