PCL
Search Algorithms

Functions

template<class FI , class T >
FI pcl::BinarySearch (FI i, FI j, const T &v) noexcept
 
template<class FI , class T , class BP >
FI pcl::BinarySearch (FI i, FI j, const T &v, BP p) noexcept(noexcept(p))
 
template<class FI , class T , class BP1 , class BP2 >
FI pcl::BinarySearch (FI i, FI j, const T &v, BP1 p1, BP2 p2) noexcept(noexcept(p1) &&noexcept(p2))
 
template<class FI , class T >
FI pcl::BinarySearchLast (FI i, FI j, const T &v) noexcept
 
template<class FI , class T , class BP >
FI pcl::BinarySearchLast (FI i, FI j, const T &v, BP p) noexcept(noexcept(p))
 
template<class FI , class T >
FI pcl::InsertionPoint (FI i, FI j, const T &v) noexcept
 
template<class FI , class T , class BP >
FI pcl::InsertionPoint (FI i, FI j, const T &v, BP p) noexcept(noexcept(p))
 
template<class FI , class T >
FI pcl::LinearSearch (FI i, FI j, const T &v) noexcept
 
template<class FI , class T , class BP >
FI pcl::LinearSearch (FI i, FI j, const T &v, BP p) noexcept(noexcept(p))
 
template<class BI , class T >
BI pcl::LinearSearchLast (BI i, BI j, const T &v) noexcept
 
template<class BI , class T , class BP >
BI pcl::LinearSearchLast (BI i, BI j, const T &v, BP p) noexcept(noexcept(p))
 
template<class FI1 , class FI2 >
FI1 pcl::Search (FI1 i1, FI1 j1, FI2 i2, FI2 j2) noexcept
 
template<class FI1 , class FI2 , class BP >
FI1 pcl::Search (FI1 i1, FI1 j1, FI2 i2, FI2 j2, BP p) noexcept(noexcept(p))
 
template<class BI1 , class FI2 >
BI1 pcl::SearchLast (BI1 i1, BI1 j1, FI2 i2, FI2 j2) noexcept
 
template<class BI1 , class FI2 , class BP >
BI1 pcl::SearchLast (BI1 i1, BI1 j1, FI2 i2, FI2 j2, BP p) noexcept(noexcept(p))
 

Detailed Description

Template formal parameters:

FI Forward iterator
BI Bidirectional iterator
RI Random access iterator
UP Unary predicate
BP Binary predicate
T Item type
F Function

Function Documentation

◆ BinarySearch() [1/3]

template<class FI , class T >
FI pcl::BinarySearch ( FI  i,
FI  j,
const T &  v 
)
inlinenoexcept

Generic binary search algorithm.

Returns the first iterator k in the range [i,j) such that *k == v. Returns j if no such occurrence of v is found.

The sequence [i,j) must be ordered in ascending order: for every pair a,b in [i,j) such that i precedes j, *j < *i must be false.

Definition at line 170 of file Search.h.

Referenced by pcl::EphemerisFile::ConstantValue(), pcl::JPLEphemeris::ConstantValue(), and pcl::EphemerisFile::IsConstantAvailable().

◆ BinarySearch() [2/3]

template<class FI , class T , class BP >
FI pcl::BinarySearch ( FI  i,
FI  j,
const T &  v,
BP  p 
)
inlinenoexcept

Generic binary search algorithm.

Returns the first iterator k in the range [i,j) such that both p( *k, v ) and p( v, *k ) are false. Returns j if no such occurrence of v is found.

The sequence [i,j) must be ordered in ascending order: for every pair a,b in [i,j) such that i precedes j, p( *j, *i ) must be false.

Definition at line 204 of file Search.h.

◆ BinarySearch() [3/3]

template<class FI , class T , class BP1 , class BP2 >
FI pcl::BinarySearch ( FI  i,
FI  j,
const T &  v,
BP1  p1,
BP2  p2 
)
inlinenoexcept

Generic binary search algorithm.

Returns the first iterator k in the range [i,j) such that both p1( *k, v ) and p2( v, *k ) are false. Returns j if no such occurrence of v is found.

The sequence [i,j) must be ordered in ascending order: for every pair a,b in [i,j) such that i precedes j, both p1( *j, *i ) and p2( *j, *i ) must be false.

Definition at line 285 of file Search.h.

◆ BinarySearchLast() [1/2]

template<class FI , class T >
FI pcl::BinarySearchLast ( FI  i,
FI  j,
const T &  v 
)
inlinenoexcept

Generic binary search algorithm (last occurrence).

Returns the last iterator k in the range [i,j) such that *k == v. Returns j if no such occurrence of v is found.

The sequence [i,j) must be ordered in ascending order: for every pair a,b in [i,j) such that i precedes j, *j < *i must be false.

Definition at line 238 of file Search.h.

◆ BinarySearchLast() [2/2]

template<class FI , class T , class BP >
FI pcl::BinarySearchLast ( FI  i,
FI  j,
const T &  v,
BP  p 
)
inlinenoexcept

Generic binary search algorithm (last occurrence).

Returns the last iterator k in the range [i,j) such that both p( *k, v ) and p( v, *k ) are false. Returns j if no such occurrence of v is found.

The sequence [i,j) must be ordered in ascending order: for every pair a,b in [i,j) such that i precedes j, p( *j, *i ) must be false.

Definition at line 261 of file Search.h.

◆ InsertionPoint() [1/2]

template<class FI , class T >
FI pcl::InsertionPoint ( FI  i,
FI  j,
const T &  v 
)
inlinenoexcept

Generic insertion point algorithm.

Returns an iterator k in the range [i,j) such that:

  • for all a in [i,j) that precedes k, v < *a is false.
  • for all b in [i,j) that postcedes k, *b < v is false.

The sequence [i,j) must be ordered in ascending order: for every pair a,b in [i,j) such that i precedes j, *j < *i must be false.

The resulting iterator k corresponds to a location where the value v could be inserted in the [i,j) sequence without breaking the existing order of values, as defined by operator <.

Definition at line 326 of file Search.h.

Referenced by pcl::IndirectSortedArray< T, A >::Add(), and pcl::SortedArray< T, A >::Add().

◆ InsertionPoint() [2/2]

template<class FI , class T , class BP >
FI pcl::InsertionPoint ( FI  i,
FI  j,
const T &  v,
BP  p 
)
inlinenoexcept

Generic insertion point algorithm.

Returns an iterator k in the range [i,j) such that:

  • for all a in [i,j) that precedes k, p( v, *a ) is false.
  • for all b in [i,j) that postcedes k, p( *b, v ) is false.

The sequence [i,j) must be ordered in ascending order: for every pair a,b in [i,j) such that i precedes j, p( *j, *i ) must be false.

The resulting iterator k corresponds to a location where the value v could be inserted in the [i,j) sequence without breaking the existing order of values, as defined by the binary predicate p.

Definition at line 367 of file Search.h.

◆ LinearSearch() [1/2]

template<class FI , class T >
FI pcl::LinearSearch ( FI  i,
FI  j,
const T &  v 
)
inlinenoexcept

Generic linear search algorithm.

Returns the first iterator k in the range [i,j) such that *k == v. Returns j if no such occurrence of v is found.

Definition at line 91 of file Search.h.

Referenced by pcl::GenericVector< T >::Contains(), pcl::GenericMatrix< T >::Contains(), pcl::GenericVector< T >::Find(), and pcl::GenericMatrix< T >::Find().

◆ LinearSearch() [2/2]

template<class FI , class T , class BP >
FI pcl::LinearSearch ( FI  i,
FI  j,
const T &  v,
BP  p 
)
inlinenoexcept

Generic linear search algorithm.

Returns the first iterator k in the range [i,j) such that p( *k, v ) is true. Returns j if no such occurrence of v is found.

Definition at line 110 of file Search.h.

◆ LinearSearchLast() [1/2]

template<class BI , class T >
BI pcl::LinearSearchLast ( BI  i,
BI  j,
const T &  v 
)
inlinenoexcept

Generic linear search algorithm (last occurrence).

Returns the last iterator k in the range [i,j) such that *k == v. Returns j if no such occurrence of v is found.

Definition at line 129 of file Search.h.

Referenced by pcl::GenericVector< T >::FindLast(), and pcl::GenericMatrix< T >::FindLast().

◆ LinearSearchLast() [2/2]

template<class BI , class T , class BP >
BI pcl::LinearSearchLast ( BI  i,
BI  j,
const T &  v,
BP  p 
)
inlinenoexcept

Generic linear search algorithm (last occurrence).

Returns the last iterator k in the range [i,j) such that *k == v. Returns j if no such occurrence of v is found.

Definition at line 148 of file Search.h.

◆ Search() [1/2]

template<class FI1 , class FI2 >
FI1 pcl::Search ( FI1  i1,
FI1  j1,
FI2  i2,
FI2  j2 
)
inlinenoexcept

Returns the starting iterator of the first subsequence within the range [i1,j1) that is identical to the sequence [i2,j2) when compared element by element, or j1 if no such subsequence is found.

Definition at line 397 of file Search.h.

References pcl::Distance().

Referenced by pcl::IndirectArray< T, A >::SearchSubset(), pcl::ReferenceArray< T, A >::SearchSubset(), and pcl::Array< T, A >::SearchSubset().

◆ Search() [2/2]

template<class FI1 , class FI2 , class BP >
FI1 pcl::Search ( FI1  i1,
FI1  j1,
FI2  i2,
FI2  j2,
BP  p 
)
inlinenoexcept

Returns the starting iterator of the first subsequence within the range [i1,j1) that corresponds to the sequence [i2,j2) when the binary predicate p is applied element by element, or j1 if no such subsequence is found.

Definition at line 423 of file Search.h.

References pcl::Distance().

◆ SearchLast() [1/2]

template<class BI1 , class FI2 >
BI1 pcl::SearchLast ( BI1  i1,
BI1  j1,
FI2  i2,
FI2  j2 
)
inlinenoexcept

Returns the starting iterator of the last subsequence within the range [i1,j1) that is identical to the sequence [i2,j2) when compared element by element, or j1 if no such subsequence is found.

Definition at line 449 of file Search.h.

References pcl::Distance().

Referenced by pcl::IndirectArray< T, A >::SearchLastSubset(), pcl::ReferenceArray< T, A >::SearchLastSubset(), and pcl::Array< T, A >::SearchLastSubset().

◆ SearchLast() [2/2]

template<class BI1 , class FI2 , class BP >
BI1 pcl::SearchLast ( BI1  i1,
BI1  j1,
FI2  i2,
FI2  j2,
BP  p 
)
inlinenoexcept

Returns the starting iterator of the last subsequence within the range [i1,j1) that corresponds to the sequence [i2,j2) when the binary predicate p is applied element by element, or j1 if no such subsequence is found.

Definition at line 481 of file Search.h.

References pcl::Distance().