GEOS  3.9.1dev
Classes | Public Types | Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
geos::index::strtree::BoundablePair Class Reference

A pair of Boundables, whose leaf items support a distance metric between them. More...

#include <BoundablePair.h>

Collaboration diagram for geos::index::strtree::BoundablePair:
[legend]

Classes

struct  BoundablePairQueueCompare
 

Public Types

typedef std::priority_queue< BoundablePair *, std::vector< BoundablePair * >, BoundablePairQueueCompareBoundablePairQueue
 

Public Member Functions

 BoundablePair (const Boundable *boundable1, const Boundable *boundable2, ItemDistance *itemDistance)
 
const BoundablegetBoundable (int i) const
 
double distance () const
 Computes the distance between the Boundables in this pair. The boundables are either composites or leaves. More...
 
double getDistance () const
 Gets the minimum possible distance between the Boundables in this pair. More...
 
bool isLeaves () const
 
double maximumDistance ()
 Computes the maximum distance between any two items in the pair of nodes. More...
 
void expandToQueue (BoundablePairQueue &, double minDistance)
 
void expand (const Boundable *bndComposite, const Boundable *bndOther, bool isFlipped, BoundablePairQueue &priQ, double minDistance)
 

Static Public Member Functions

static bool isComposite (const Boundable *item)
 
static double area (const Boundable *b)
 

Private Attributes

const Boundableboundable1
 
const Boundableboundable2
 
ItemDistanceitemDistance
 
double mDistance
 

Detailed Description

A pair of Boundables, whose leaf items support a distance metric between them.

Used to compute the distance between the members, and to expand a member relative to the other in order to produce new branches of the Branch-and-Bound evaluation tree. Provides an ordering based on the distance between the members, which allows building a priority queue by minimum distance.

Author
Martin Davis

Definition at line 44 of file BoundablePair.h.

Member Typedef Documentation

Definition at line 60 of file BoundablePair.h.

Constructor & Destructor Documentation

geos::index::strtree::BoundablePair::BoundablePair ( const Boundable boundable1,
const Boundable boundable2,
ItemDistance itemDistance 
)

Member Function Documentation

static double geos::index::strtree::BoundablePair::area ( const Boundable b)
static
double geos::index::strtree::BoundablePair::distance ( ) const

Computes the distance between the Boundables in this pair. The boundables are either composites or leaves.

If either is composite, the distance is computed as the minimum distance between the bounds. If both are leaves, the distance is computed by ItemDistance::distance(const ItemBoundable* item1, const ItemBoundable* item2).

Returns
the distance between the items
void geos::index::strtree::BoundablePair::expand ( const Boundable bndComposite,
const Boundable bndOther,
bool  isFlipped,
BoundablePairQueue priQ,
double  minDistance 
)
void geos::index::strtree::BoundablePair::expandToQueue ( BoundablePairQueue ,
double  minDistance 
)
const Boundable* geos::index::strtree::BoundablePair::getBoundable ( int  i) const

Gets one of the member Boundables in the pair (indexed by [0, 1]).

Parameters
ithe index of the member to return (0 or 1)
Returns
the chosen member
double geos::index::strtree::BoundablePair::getDistance ( ) const

Gets the minimum possible distance between the Boundables in this pair.

If the members are both items, this will be the exact distance between them. Otherwise, this distance will be a lower bound on the distances between the items in the members.

Returns
the exact or lower bound distance for this pair

Referenced by geos::index::strtree::BoundablePair::BoundablePairQueueCompare::operator()().

Here is the caller graph for this function:

static bool geos::index::strtree::BoundablePair::isComposite ( const Boundable item)
static
bool geos::index::strtree::BoundablePair::isLeaves ( ) const

Tests if both elements of the pair are leaf nodes

Returns
true if both pair elements are leaf nodes
double geos::index::strtree::BoundablePair::maximumDistance ( )

Computes the maximum distance between any two items in the pair of nodes.

Returns
the maximum distance between items in the pair

Member Data Documentation

const Boundable* geos::index::strtree::BoundablePair::boundable1
private

Definition at line 46 of file BoundablePair.h.

const Boundable* geos::index::strtree::BoundablePair::boundable2
private

Definition at line 47 of file BoundablePair.h.

ItemDistance* geos::index::strtree::BoundablePair::itemDistance
private

Definition at line 48 of file BoundablePair.h.

double geos::index::strtree::BoundablePair::mDistance
private

Definition at line 49 of file BoundablePair.h.


The documentation for this class was generated from the following file: