PCL
|
Generic vector of arbitrary length. More...
#include <Vector.h>
Public Types | |
using | component = T |
using | const_iterator = const T * |
using | iterator = T * |
using | scalar = T |
Public Member Functions | |
GenericVector () | |
GenericVector (const component &x, int len) | |
GenericVector (const GenericVector &x) | |
template<typename T1 > | |
GenericVector (const GenericVector< T1 > &x) | |
template<typename T1 > | |
GenericVector (const T1 &x, const T1 &y, const T1 &z) | |
template<typename T1 > | |
GenericVector (const T1 &x, const T1 &y, const T1 &z, const T1 &t) | |
template<typename T1 > | |
GenericVector (const T1 *a, int len) | |
GenericVector (GenericVector &&x) | |
GenericVector (int len) | |
template<typename T1 > | |
GenericVector (std::initializer_list< T1 > c) | |
virtual | ~GenericVector () |
GenericVector | Abs () const |
double | Angle2D (const GenericVector &v) const noexcept |
double | Angle3D (const GenericVector &v) const noexcept |
double | Angle3D (const GenericVector &v, const GenericVector &n) const |
void | Assign (const GenericVector &x) |
iterator | At (int i) |
const_iterator | At (int i) const noexcept |
double | AvgDev () const |
double | AvgDev (double center) const noexcept |
iterator | Begin () |
iterator | begin () |
const_iterator | Begin () const noexcept |
const_iterator | begin () const noexcept |
double | BendMidvariance (double beta=0.2) const |
double | BendMidvariance (double center, double beta=0.2) const |
double | BiweightMidvariance (double center, double sigma, int k=9, bool reducedLength=false) const noexcept |
double | BiweightMidvariance (int k=9, bool reducedLength=false) const |
void | Clear () |
iterator | ComponentPtr (int i) noexcept |
const_iterator | ConstBegin () const noexcept |
const_iterator | ConstEnd () const noexcept |
bool | Contains (const component &x) const noexcept |
GenericVector | Cross (const GenericVector &v2) const |
iterator | DataPtr () noexcept |
scalar | Dot (const GenericVector &v) const noexcept |
iterator | End () |
iterator | end () |
const_iterator | End () const noexcept |
const_iterator | end () const noexcept |
void | EnsureUnique () |
int | Find (const component &x) const noexcept |
int | FindFirst (const component &x) const noexcept |
int | FindLast (const component &x) const noexcept |
uint64 | Hash (uint64 seed=0) const noexcept |
uint32 | Hash32 (uint32 seed=0) const noexcept |
uint64 | Hash64 (uint64 seed=0) const noexcept |
int | IndexOfLargestComponent () const noexcept |
int | IndexOfLastLargestComponent () const noexcept |
int | IndexOfLastSmallestComponent () const noexcept |
int | IndexOfLastSmallestNonzeroComponent () const noexcept |
int | IndexOfSmallestComponent () const noexcept |
int | IndexOfSmallestNonzeroComponent () const noexcept |
bool | IsAliasOf (const GenericVector &x) const noexcept |
bool | IsEmpty () const noexcept |
bool | IsUnique () const noexcept |
bool | IsValid () const noexcept |
scalar | L1Norm () const noexcept |
scalar | L2Norm () const noexcept |
int | Length () const noexcept |
double | MAD () const |
double | MAD (double center) const |
component | MaxComponent () const noexcept |
double | Mean () const |
double | Median () const |
component | MinComponent () const noexcept |
double | Modulus () const noexcept |
scalar | Norm () const noexcept |
scalar | Norm (double p) const noexcept |
operator bool () const noexcept | |
iterator | operator* () |
const_iterator | operator* () const noexcept |
GenericVector & | operator*= (const GenericVector &x) |
GenericVector & | operator*= (const scalar &x) |
GenericVector & | operator+= (const GenericVector &x) |
GenericVector & | operator+= (const scalar &x) |
GenericVector | operator- () const |
GenericVector & | operator-= (const GenericVector &x) |
GenericVector & | operator-= (const scalar &x) |
GenericVector & | operator/= (const GenericVector &x) |
GenericVector & | operator/= (const scalar &x) |
bool | operator< (const GenericVector &x) const noexcept |
GenericVector & | operator= (const GenericVector &x) |
GenericVector & | operator= (const scalar &x) |
GenericVector & | operator= (GenericVector &&x) |
bool | operator== (const GenericVector &x) const noexcept |
component & | operator[] (int i) |
const component & | operator[] (int i) const noexcept |
GenericVector & | operator^= (const scalar &x) |
component | OrderStatistic (int k) |
component | OrderStatistic (int k) const |
double | Qn () const |
void | ReverseSign () |
void | ReverseSort () |
GenericVector | ReverseSorted () const |
bool | SameLength (const GenericVector &x) const noexcept |
void | SetAbs () |
void | SetSqr () |
void | SetSqrt () |
void | SetUnit () |
size_type | Size () const noexcept |
double | Sn () const |
void | Sort () |
template<class BP > | |
void | Sort (BP p) |
GenericVector | Sorted () const |
template<class BP > | |
GenericVector | Sorted (BP p) const |
GenericVector | Sqr () const |
GenericVector | Sqrt () const |
double | StableAvgDev () const |
double | StableAvgDev (double center) const noexcept |
double | StableMean () const noexcept |
double | StableModulus () const noexcept |
double | StableSum () const noexcept |
double | StableSumOfSquares () const noexcept |
double | StdDev () const noexcept |
double | Sum () const noexcept |
double | SumOfSquares () const noexcept |
template<class S > | |
S & | ToCommaSeparated (S &s) const |
template<class S , typename SP > | |
S & | ToSeparated (S &s, SP separator) const |
template<class S , typename SP , class AF > | |
S & | ToSeparated (S &s, SP separator, AF append) const |
template<class S > | |
S & | ToSpaceSeparated (S &s) const |
template<typename T1 , typename T2 > | |
void | ToSpherical (T1 &lon, T2 &lat) const noexcept |
template<typename T1 , typename T2 > | |
void | ToSpherical2Pi (T1 &lon, T2 &lat) const noexcept |
template<class S > | |
S & | ToTabSeparated (S &s) const |
void | Transfer (GenericVector &&x) |
void | Transfer (GenericVector &x) |
double | TrimmedMean (distance_type l=1, distance_type h=1) const noexcept |
double | TrimmedMeanOfSquares (distance_type l=1, distance_type h=1) const noexcept |
TwoSidedEstimate | TwoSidedAvgDev () const |
TwoSidedEstimate | TwoSidedAvgDev (double center) const noexcept |
TwoSidedEstimate | TwoSidedBiweightMidvariance (double center, const TwoSidedEstimate &sigma, int k=9, bool reducedLength=false) const noexcept |
TwoSidedEstimate | TwoSidedBiweightMidvariance (int k=9, bool reducedLength=false) const |
TwoSidedEstimate | TwoSidedMAD () const |
TwoSidedEstimate | TwoSidedMAD (double center) const |
GenericVector | Unit () const |
double | Variance () const noexcept |
Static Public Member Functions | |
template<typename T1 > | |
static GenericVector | FromArray (const T1 *a, int len) |
template<typename T1 , typename T2 > | |
static GenericVector | FromSpherical (const T1 &lon, const T2 &lat) |
static GenericVector | FromSpherical (double slon, double clon, double slat, double clat) |
Friends | |
void | Swap (GenericVector &x1, GenericVector &x2) noexcept |
GenericVector is a lightweight template class implementing a vector of arbitrary length. This class provides the following main features:
using pcl::GenericVector< T >::component = T |
using pcl::GenericVector< T >::const_iterator = const T* |
using pcl::GenericVector< T >::iterator = T* |
using pcl::GenericVector< T >::scalar = T |
|
inline |
|
inline |
|
inline |
|
inline |
Constructs a vector and initializes it with component values taken from a static array.
a | Address of the first item of a static array for initialization of vector components. The array must provide at least len consecutive items. |
len | Number of vector components (≥ 0). |
|
inline |
Constructs a vector and initializes it with component values taken from the specified initializer list c.
This constructor is equivalent to:
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Constructs a vector and initializes it with component values taken from an instance x of a different vector template instantiation.
This constructor is equivalent to:
|
inlinevirtual |
|
inline |
|
inlinenoexcept |
Returns the angle between this vector and another vector v, with both vectors being defined in two-dimensional space.
The returned value is the angle between both vectors in radians, in the range [-pi,+pi].
|
inlinenoexcept |
Returns the angle between this vector and another vector v, with both vectors being defined in three-dimensional space.
The returned value is the angle between both vectors in radians, in the range [0,pi].
Definition at line 2221 of file Vector.h.
References pcl::ArcTan().
|
inline |
Returns the angle between this vector and another vector v, being both vectors defined in three-dimensional space, with sign determined by the direction of an additional 3D vector n.
The returned value is the angle between both vectors in radians, in the range [-pi,+pi]. The angle is positive if this vector is clockwise with respect to the direction of n, negative otherwise.
|
inline |
Assigns a vector x to this object.
If this instance and the specified source instance x reference different vector data, the data previously referenced by this object is dereferenced. If the previous data becomes unreferenced, it is destroyed and deallocated. Then the data being referenced by x is also referenced by this object.
If this instance and the specified source instance x already reference the same vector data, then this function does nothing.
|
inline |
|
inlinenoexcept |
|
inline |
Returns the average absolute deviation from the median.
The mean absolute deviation from the median is a well-known estimator of dispersion.
For vectors with less than two components, this function returns zero.
Definition at line 1394 of file Vector.h.
References pcl::AvgDev().
|
inlinenoexcept |
Returns the average absolute deviation with respect to the specified center value.
When the median of the vector elements is used as the center value, this function returns the average absolute deviation from the median, which is a well-known estimator of dispersion.
For vectors with less than two components, this function returns zero.
Definition at line 1357 of file Vector.h.
References pcl::AvgDev().
|
inline |
Returns a mutable vector iterator pointing to the first vector component, i.e. to the component at index 0 of this vector.
All vector components are guaranteed to be stored at consecutive locations addressable from the iterator returned by this function.
Before returning, this function ensures that this instance uniquely references its vector data.
Definition at line 1900 of file Vector.h.
Referenced by pcl::JPLEphemeris::ComputeState(), pcl::GenericVector< T >::Qn(), pcl::Histogram::Resample(), and pcl::GenericVector< T >::Sn().
|
inline |
|
inlinenoexcept |
|
inlinenoexcept |
STL-compatible iteration. Equivalent to Begin() const.
|
inline |
Returns a percentage bend midvariance (PBMV) with respect to the median.
beta | Rejection parameter in the [0,0.5] range. Higher values improve robustness to outliers (i.e., increase the breakdown point of the estimator) at the expense of a lower efficiency. The default value is beta=0.2. |
The square root of the percentage bend midvariance is a robust estimator of scale. With the default beta=0.2, its Gaussian efficiency is 67%. With beta=0.1, its efficiency is 85% but its breakdown is only 0.1.
For vectors with less than two components, this function returns zero.
References
Rand R. Wilcox (2017), Introduction to Robust Estimation and Hypothesis Testing, 4th Edition, Elsevier Inc., Section 3.12.3.
Definition at line 1641 of file Vector.h.
References pcl::BendMidvariance().
|
inline |
Returns a percentage bend midvariance (PBMV).
center | Reference center value. Normally, the median of the vector components should be used. |
beta | Rejection parameter in the [0,0.5] range. Higher values improve robustness to outliers (i.e., increase the breakdown point of the estimator) at the expense of a lower efficiency. The default value is beta=0.2. |
The square root of the percentage bend midvariance is a robust estimator of scale. With the default beta=0.2, its Gaussian efficiency is 67%. With beta=0.1, its efficiency is 85% but its breakdown is only 0.1.
For vectors with less than two components, this function returns zero.
References
Rand R. Wilcox (2017), Introduction to Robust Estimation and Hypothesis Testing, 4th Edition, Elsevier Inc., Section 3.12.3.
Definition at line 1617 of file Vector.h.
References pcl::BendMidvariance().
|
inlinenoexcept |
Returns the biweight midvariance (BWMV).
center | Reference center value. Normally, the median of the vector components should be used. |
sigma | A reference estimate of dispersion. Normally, the median absolute deviation from the median (MAD) of the vector components should be used. |
k | Rejection limit in sigma units. The default value is k=9. |
reducedLength | If true, reduce the sample size to exclude rejected vector components. This tends to approximate the true dispersion of the data more accurately for relatively small samples, or samples with large amounts of outliers. Note that this departs from the standard definition of biweight midvariance, where the total number of data items is used to scale the variance estimate. If false, use the full vector length, including rejected components, which gives a standard biweight midvariance estimate. |
The square root of the biweight midvariance is a robust estimator of scale. It is an efficient estimator with respect to many statistical distributions (about 87% Gaussian efficiency), and appears to have a breakdown point close to 0.5 (the same as MAD).
For vectors with less than two components, this function returns zero.
References
Rand R. Wilcox (2017), Introduction to Robust Estimation and Hypothesis Testing, 4th Edition, Elsevier Inc., Section 3.12.1.
Definition at line 1524 of file Vector.h.
References pcl::BiweightMidvariance().
|
inline |
Returns the biweight midvariance (BWMV) with respect to the median and the median absolute deviation from the median (MAD).
k | Rejection limit in sigma units. The default value is k=9. |
reducedLength | If true, reduce the sample size to exclude rejected vector components. This tends to approximate the true dispersion of the data more accurately for relatively small samples, or samples with large amounts of outliers. Note that this departs from the standard definition of biweight midvariance, where the total number of data items is used to scale the variance estimate. If false, use the full vector length, including rejected components, which gives a standard biweight midvariance estimate. |
The square root of the biweight midvariance is a robust estimator of scale. It is an efficient estimator with respect to many statistical distributions (about 87% Gaussian efficiency), and appears to have a breakdown point close to 0.5 (the same as MAD).
For vectors with less than two components, this function returns zero.
References
Rand R. Wilcox (2017), Introduction to Robust Estimation and Hypothesis Testing, 4th Edition, Elsevier Inc., Section 3.12.1.
Definition at line 1557 of file Vector.h.
References pcl::BiweightMidvariance(), pcl::MAD(), and pcl::Median().
|
inline |
|
inlinenoexcept |
Returns a pointer to the ith component in this vector.
All vector components are guaranteed to be stored at consecutive locations addressable from the iterator returned by this function.
This member function does not ensure that the data referenced by this vector is unique. See DataPtr() for more information on how to use this member function.
|
inlinenoexcept |
A synonym for Begin() const.
|
inlinenoexcept |
A synonym for End() const.
|
inlinenoexcept |
Returns true iff this vector contains the specified value x.
Definition at line 1028 of file Vector.h.
References pcl::LinearSearch().
|
inline |
Returns the cross product of this vector and a vector v2.
Definition at line 665 of file Vector.h.
References pcl::GenericVector< T >::Length().
|
inlinenoexcept |
Returns a pointer to the first component in this vector.
The returned pointer can be used as a common C array, where all vector components are guaranteed to be stored consecutively starting from the pointer returned by this function.
This member function does nothing to ensure that this instance uniquely references its vector data. Consequently, the caller must take into account that all modifications made to vector components accessed through the value returned by this function will apply to all instances sharing the same vector data.
This function can be used to perform fast operations on vector components avoiding the overhead caused by deep copies of vector data, when such copies are not necessary. Typically this happens when two or more threads work simultaneously on non-overlapping regions of the same vector.
|
inlinenoexcept |
Returns the dot product of this vector and a vector v.
|
inline |
Returns a mutable iterator past the last vector component, i.e. a pointer to a (nonexistent) component located at index=Length().
All vector components are guaranteed to be stored in reverse order at consecutive locations addressable from the iterator returned by this function.
Before returning, this function ensures that this instance uniquely references its vector data.
Definition at line 1959 of file Vector.h.
Referenced by pcl::GenericVector< T >::Qn(), pcl::Histogram::Resample(), and pcl::GenericVector< T >::Sn().
|
inline |
|
inlinenoexcept |
Returns an immutable iterator past the last vector component, i.e. a pointer to a (nonexistent) component located at index=Length().
All vector components are guaranteed to be stored in reverse order at consecutive locations addressable from the iterator returned by this function.
|
inlinenoexcept |
STL-compatible iteration. Equivalent to End() const.
|
inline |
|
inlinenoexcept |
Returns the index of the first vector element with the specified value x, or -1 if this vector does not contain such value.
Definition at line 999 of file Vector.h.
References pcl::LinearSearch().
|
inlinenoexcept |
|
inlinenoexcept |
Returns the index of the last vector element with the specified value x, or -1 if this vector does not contain such value.
Definition at line 1019 of file Vector.h.
References pcl::LinearSearchLast().
|
inlinestatic |
Returns a new vector initialized with component values taken from a static array.
a | Address of the first item of a static array for initialization of vector components. The array must provide at least len consecutive items. |
len | Number of vector components (≥ 0). |
|
inlinestatic |
Returns a three-component vector with rectangular coordinates computed from the specified spherical coordinates.
lon | Longitude in radians. |
lat | Latitude in radians. |
The returned vector contains the direction cosines for the specified position on the sphere. It is a unit vector (unit magnitude) pointing from the center of the sphere to the specified location.
Definition at line 2162 of file Vector.h.
References pcl::SinCos().
|
inlinestatic |
Returns a three-component vector with rectangular coordinates computed from spherical coordinates, given by their sines and cosines
slon | Sine of the longitude. |
clon | Cosine of the longitude. |
slat | Sine of the latitude. |
clat | Cosine of the latitude. |
The returned vector contains the direction cosines for the specified position on the sphere. It is a unit vector (unit magnitude) pointing from the center of the sphere to the specified location.
Definition at line 2143 of file Vector.h.
Referenced by pcl::Position::EclipticToEquatorial(), pcl::Position::EquatorialToEcliptic(), pcl::Position::GalacticToICRSEquatorial(), and pcl::Position::ICRSEquatorialToGalactic().
|
inlinenoexcept |
Returns a non-cryptographic hash value computed for this vector. This function is a synonym for Hash64().
Definition at line 1735 of file Vector.h.
References pcl::Hash64().
|
inlinenoexcept |
Returns a 32-bit non-cryptographic hash value computed for this vector.
This function calls pcl::Hash32() for the internal vector data.
The seed parameter can be used to generate repeatable hash values. It can also be set to a random value in compromised environments.
Definition at line 1726 of file Vector.h.
References pcl::Hash32().
|
inlinenoexcept |
Returns a 64-bit non-cryptographic hash value computed for this vector.
This function calls pcl::Hash64() for the internal vector data.
The seed parameter can be used to generate repeatable hash values. It can also be set to a random value in compromised environments.
Definition at line 1713 of file Vector.h.
References pcl::Hash64().
|
inlinenoexcept |
Returns the index of the largest vector component.
For empty vectors, this function returns zero. For vectors where the largest component occurs more than once, this function returns the index of the first occurrence.
Definition at line 1054 of file Vector.h.
References pcl::MaxItem().
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Returns the index of the smallest vector component.
For empty vectors, this function returns zero. For vectors where the smallest component occurs more than once, this function returns the index of the first occurrence.
Definition at line 1042 of file Vector.h.
References pcl::MinItem().
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Returns true only if this vector is valid. A vector is valid if it references an internal vector structure, even if it is an empty vector.
In general, all GenericVector objects are valid with only two exceptions:
An invalid vector object cannot be used and should be destroyed immediately. Invalid vectors are always destroyed automatically during move construction and move assignment operations.
|
inlinenoexcept |
Returns the L1 norm (or Manhattan norm) of this vector. The L1 norm is the sum of the absolute values of all vector components.
Definition at line 884 of file Vector.h.
References pcl::L1Norm().
|
inlinenoexcept |
Returns the L2 norm (or Euclidean norm) of this vector. The L2 norm is the square root of the sum of squared vector components.
Definition at line 893 of file Vector.h.
References pcl::L2Norm().
|
inlinenoexcept |
Returns the number of components in this vector. If this object is an empty vector, this member function returns zero.
Definition at line 1784 of file Vector.h.
Referenced by pcl::GenericVector< T >::Cross(), pcl::GenericChebyshevFit< Tx, Ty >::Evaluate(), pcl::UnidimensionalInterpolation< T >::Initialize(), pcl::GenericChebyshevFit< Tx, Ty >::NumberOfComponents(), pcl::GenericVector< T >::operator*=(), pcl::GenericVector< T >::operator+=(), pcl::GenericVector< T >::operator-=(), pcl::GenericVector< T >::operator/=(), pcl::GenericFFT< T >::operator<<(), pcl::GenericRealFFT< T >::operator<<(), pcl::GenericFFT< T >::operator>>(), pcl::GenericRealFFT< T >::operator>>(), pcl::Histogram::Resample(), and pcl::Histogram::SetHistogramData().
|
inline |
Returns the median absolute deviation from the median (MAD).
The MAD is a well-known robust estimator of scale.
For vectors with less than two components, this function returns zero.
Definition at line 1464 of file Vector.h.
References pcl::MAD().
|
inline |
Returns the median absolute deviation (MAD) with respect to the specified center value.
The MAD is a well-known robust estimator of scale.
For vectors with less than two components, this function returns zero.
Definition at line 1449 of file Vector.h.
References pcl::MAD().
|
inlinenoexcept |
Returns the value of the largest vector component. For empty vectors, this function returns zero conventionally.
Definition at line 1157 of file Vector.h.
Referenced by pcl::GenericChebyshevFit< Tx, Ty >::IsTruncated(), and pcl::GenericChebyshevFit< Tx, Ty >::TruncatedLength().
|
inline |
Returns the mean of the values in this vector. For empty vectors, this function returns zero.
Definition at line 1272 of file Vector.h.
References pcl::Mean().
|
inline |
Returns the median of the values in this vector.
For vectors of length < 2, this function returns zero conventionally.
Definition at line 1338 of file Vector.h.
References pcl::Median().
|
inlinenoexcept |
|
inlinenoexcept |
Returns the sum of the absolute values of all vector components. For empty vectors, this function returns zero.
Definition at line 1232 of file Vector.h.
References pcl::Modulus().
|
inlinenoexcept |
Returns the L2 norm (or Euclidean norm) of this vector. This function is a synonym for L2Norm().
Definition at line 902 of file Vector.h.
References pcl::L2Norm().
|
inlinenoexcept |
Returns the norm of this vector. For any real p > 0, the norm N of a vector v is given by:
N = sum( abs( x )^p )^(1/p)
for all vector components x of v.
Definition at line 875 of file Vector.h.
References pcl::Norm().
|
inlinenoexcept |
Returns true iff this vector is not empty. This operator is equivalent to:
|
inline |
|
inlinenoexcept |
Returns an immutable vector iterator pointing to the first vector component, i.e. to the component at index 0 of this vector.
This member function is a convenience alias to Begin() const.
|
inline |
Component-wise vector multiplication/assignment. Multiplies each component of this vector by the corresponding component of the specified vector x. Returns a reference to this object.
Before operating vector components, this function ensures that this instance uniquely references its vector data, generating a duplicate if necessary.
If the specified vectors are incompatible for component-wise operations (because the length of x is less than the length of this object), this function throws an appropriate Error exception.
Definition at line 482 of file Vector.h.
References pcl::GenericVector< T >::Length().
|
inline |
Multiplies all components of this vector by a constant scalar x. Returns a reference to this object.
Before multiplying all vector components by a constant value, this function ensures that this instance uniquely references its vector data, generating a duplicate if necessary.
|
inline |
Vector addition/assignment. Adds each component of the specified vector x to the corresponding component of this vector. Returns a reference to this object.
Before operating vector components, this function ensures that this instance uniquely references its vector data, generating a duplicate if necessary.
If the specified vectors are incompatible for component-wise operations (because the length of x is less than the length of this object), this function throws an appropriate Error exception.
Definition at line 428 of file Vector.h.
References pcl::GenericVector< T >::Length().
|
inline |
Adds a constant scalar x to all components of this vector. Returns a reference to this object.
Before adding a constant value to all vector components, this function ensures that this instance uniquely references its vector data, generating a duplicate if necessary.
|
inline |
|
inline |
Vector subtraction/assignment. Subtracts each component of the specified vector x from the corresponding component of this vector. Returns a reference to this object.
Before operating vector components, this function ensures that this instance uniquely references its vector data, generating a duplicate if necessary.
If the specified vectors are incompatible for component-wise operations (because the length of x is less than the length of this object), this function throws an appropriate Error exception.
Definition at line 455 of file Vector.h.
References pcl::GenericVector< T >::Length().
|
inline |
Subtracts a constant scalar x from all components of this vector. Returns a reference to this object.
Before subtracting a constant value from all vector components, this function ensures that this instance uniquely references its vector data, generating a duplicate if necessary.
|
inline |
Component-wise vector division/assignment. Divides each component of this vector by the corresponding component of the specified vector x. Returns a reference to this object.
Before operating vector components, this function ensures that this instance uniquely references its vector data, generating a duplicate if necessary.
If the specified vectors are incompatible for component-wise operations (because the length of x is less than the length of this object), this function throws an appropriate Error exception.
Definition at line 513 of file Vector.h.
References pcl::GenericVector< T >::Length().
|
inline |
Divides all components of this vector by a constant scalar x. Returns a reference to this object.
Before dividing all vector components by a constant value, this function ensures that this instance uniquely references its vector data, generating a duplicate if necessary.
|
inlinenoexcept |
Less than relational operator. Returns true if this vector is less than another vector x.
In this operator, vector comparisons are performed component-wise, irrespective of vector lengths, until either two vector components differ or until the end of one of the vectors is reached. In the latter case, the shortest vector is the lesser one.
Definition at line 1855 of file Vector.h.
References pcl::Compare().
|
inline |
|
inline |
Assigns a constant scalar x to all components of this vector. Returns a reference to this object.
Before assigning a constant value to all vector components, this function ensures that this instance uniquely references its vector data, generating a new vector data block if necessary.
|
inline |
Move assignment operator. Returns a reference to this object.
See the Transfer() member function for more information.
|
inlinenoexcept |
Equality operator. Returns true if this vector is equal to another vector x. Two vectors are equal if both have the same length and identical component values.
Definition at line 1841 of file Vector.h.
References pcl::Equal().
|
inline |
|
inlinenoexcept |
|
inline |
Raises all components of this vector to a constant scalar x. Returns a reference to this object.
Before raising all vector components to a constant value, this function ensures that this instance uniquely references its vector data, generating a duplicate if necessary.
|
inline |
Returns the kth order statistic of the sample in this vector.
Before selecting the specified vector component, this function ensures that this instance uniquely references its vector data, generating a duplicate if necessary.
The specified index k must be valid, that is, it must be in the range [0,Length()-1]. If a value of k outside the valid range is specified, or equivalently, if this function is called for an empty vector, this member function will invoke undefined behavior.
Definition at line 1180 of file Vector.h.
References pcl::Select().
Referenced by pcl::GenericVector< T >::OrderStatistic().
|
inline |
Returns the kth order statistic of the sample in this vector, without modifying this instance.
The specified index k must be valid, that is, it must be in the range [0,Length()-1]. If a value of k outside the valid range is specified, or equivalently, if this function is called for an empty vector, this member function will invoke undefined behavior.
This is a nondestructive selection routine that doesn't modify the order of existing vector components. To achieve that goal, this routine simply generates a temporary working vector as a copy of this object, then calls its OrderStatistic() member function to obtain the function's return value.
Definition at line 1203 of file Vector.h.
References pcl::GenericVector< T >::OrderStatistic().
|
inline |
Returns the Qn scale estimator of Rousseeuw and Croux:
Qn = c * first_quartile( |x_i - x_j| : i < j )
where first_quartile() is the order statistic of rank (n + 1)/4.
For vectors with less than two components, this function returns zero.
The constant c = 2.2219 must be used to make the Qn estimator converge to the standard deviation of a pure normal distribution. However, this implementation does not apply it (it uses c=1 implicitly), for consistency with other implementations of scale estimators.
References
P.J. Rousseeuw and C. Croux (1993), Alternatives to the Median Absolute Deviation, Journal of the American Statistical Association, Vol. 88, pp. 1273-1283.
Definition at line 1697 of file Vector.h.
References pcl::GenericVector< T >::Begin(), pcl::GenericVector< T >::End(), and pcl::Qn().
|
inline |
|
inline |
Sorts the components of this vector in reverse (descending) order.
Definition at line 953 of file Vector.h.
References pcl::Sort().
|
inline |
|
inlinenoexcept |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinenoexcept |
|
inline |
Returns the Sn scale estimator of Rousseeuw and Croux:
Sn = c * low_median( high_median( |x_i - x_j| ) )
where low_median() is the order statistic of rank (n + 1)/2, and high_median() is the order statistic of rank n/2 + 1.
For vectors with less than two components, this function returns zero.
The constant c = 1.1926 must be used to make the Sn estimator converge to the standard deviation of a pure normal distribution. However, this implementation does not apply it (it uses c=1 implicitly), for consistency with other implementations of scale estimators.
References
P.J. Rousseeuw and C. Croux (1993), Alternatives to the Median Absolute Deviation, Journal of the American Statistical Association, Vol. 88, pp. 1273-1283.
Definition at line 1669 of file Vector.h.
References pcl::GenericVector< T >::Begin(), pcl::GenericVector< T >::End(), and pcl::Sn().
|
inline |
Sorts the components of this vector in ascending order.
Definition at line 934 of file Vector.h.
References pcl::Sort().
Sorts the components of this vector in ascending order. Ordering of vector components is defined such that for any pair a, b of vector components, the specified binary predicate p( a, b ) is true if a precedes b.
Definition at line 977 of file Vector.h.
References pcl::Sort().
|
inline |
|
inline |
Returns a sorted copy of this vector, where ordering of vector components is defined by the specified binary predicate p. See Sort( BP p ).
|
inline |
|
inline |
|
inline |
Computes the average absolute deviation from the median using a numerically stable summation algorithm to minimize roundoff error.
The mean absolute deviation from the median is a well-known estimator of dispersion.
For vectors with less than two components, this function returns zero.
Definition at line 1412 of file Vector.h.
References pcl::StableAvgDev().
|
inlinenoexcept |
Computes the average absolute deviation with respect to the specified center value, using a numerically stable summation algorithm to minimize roundoff error.
When the median of the vector elements is used as the center value, this function returns the average absolute deviation from the median, which is a well-known estimator of dispersion.
For vectors with less than two components, this function returns zero.
Definition at line 1377 of file Vector.h.
References pcl::StableAvgDev().
|
inlinenoexcept |
Computes the mean of the values in this vector using a numerically stable summation algorithm to minimize roundoff error.
For empty vectors, this function returns zero.
Definition at line 1283 of file Vector.h.
References pcl::StableMean().
|
inlinenoexcept |
Computes the sum of the absolute values of all vector components using a numerically stable summation algorithm to minimize roundoff error.
For empty vectors, this function returns zero.
Definition at line 1243 of file Vector.h.
References pcl::StableModulus().
|
inlinenoexcept |
Computes the sum of vector components using a numerically stable summation algorithm to minimize roundoff error.
For empty vectors, this function returns zero.
Definition at line 1223 of file Vector.h.
References pcl::StableSum().
|
inlinenoexcept |
Returns the sum of the squares of all vector components using a numerically stable summation algorithm to minimize roundoff error.
For empty vectors, this function returns zero.
Definition at line 1263 of file Vector.h.
References pcl::StableSumOfSquares().
|
inlinenoexcept |
Returns the standard deviation from the mean for the values in this vector.
For vectors with less than two components, this function returns zero.
Definition at line 1328 of file Vector.h.
References pcl::StdDev().
|
inlinenoexcept |
Returns the sum of vector components. For empty vectors, this function returns zero.
Definition at line 1212 of file Vector.h.
References pcl::Sum().
Referenced by pcl::GenericChebyshevFit< Tx, Ty >::NumberOfTruncatedCoefficients().
|
inlinenoexcept |
Computes the sum of the squares of all vector components. For empty vectors, this function returns zero.
Definition at line 1252 of file Vector.h.
References pcl::SumOfSquares().
|
inline |
Generates a comma-separated sequence of string tokens. Returns a reference to the target string s.
This function is equivalent to:
|
inline |
Generates a sequence of string tokens separated with the specified separator string. Returns a reference to the target string s.
For each vector component, this function appends a string representation (known as a token) to the target string s. If the vector has more than one component, successive tokens are separated with the specified separator.
The string type S must have a meaningful Append() member function and type conversion semantics to transform a vector component to a string. The standard String and IsoString PCL classes provide the required functionality for most scalar types, although it is probably better to use String::ToSeparated() and IsoString::ToSeparated() instead of calling these functions directly.
|
inline |
Generates a sequence of string tokens separated with the specified separator string by calling an append function. Returns a reference to the target string s.
For each vector component x, this function appends a string representation (known as a token) to the target string s by calling the append function:
If the vector has more than one component, successive tokens are separated by calling:
The string type S must have type conversion semantics to transform a vector component to a string. The standard String and IsoString PCL classes provide the required functionality for most scalar types, although it is probably better to use String::ToSeparated() and IsoString::ToSeparated() instead of calling these functions directly.
|
inline |
Generates a space-separated sequence of string tokens. Returns a reference to the target string s.
This function is equivalent to:
|
inlinenoexcept |
Computes spherical coordinates from this three-component vector.
[out] | lon | Reference to a variable where the computed longitude in radians, in the range [-pi,+pi], will be stored. If the vector points to one pole, that is, if *lat is either -pi/2 or +pi/2, the computed longitude will be zero. |
[out] | lat | Reference to a variable where the computed latitude in radians, in the range [-pi/2,+pi/2], will be stored. |
This function requires a vector with at least three coordinates. For performance reasons, the vector length is not verified.
The returned coordinates lie on a sphere of unit radius, that is, only the direction of the input vector is taken into account, never its magnitude.
|
inlinenoexcept |
Computes spherical coordinates from this three-component vector.
This function is identical to ToSpherical(), but the output longitude component is normalized to the range [0,2pi) in radians.
Definition at line 2121 of file Vector.h.
References pcl::TwoPi().
|
inline |
Generates a tabulator-separated sequence of string tokens. Returns a reference to the target string s.
This function is equivalent to:
|
inline |
Transfers data from another vector x to this object.
Decrements the reference counter of the current vector data. If the data becomes unreferenced, it is destroyed and deallocated. The vector data referenced by the source object x is then transferred to this object, and the source object x is left as an invalid empty vector.
|
inline |
Transfers data from another vector x to this object.
Decrements the reference counter of the current vector data. If the data becomes unreferenced, it is destroyed and deallocated. The vector data referenced by the source object x is then transferred to this object, and the source object x is left as an invalid empty vector.
|
inlinenoexcept |
Computes the two-sided, asymmetric trimmed mean of the values in this vector. See pcl::TrimmedMean() for a complete description of the implemented algorithm with information on function parameters.
For empty vectors, this function returns zero.
Definition at line 1295 of file Vector.h.
References pcl::TrimmedMean().
|
inlinenoexcept |
Computes the two-sided, asymmetric trimmed mean of the squared values in this vector. See pcl::TrimmedMeanOfSquares() for a complete description of the implemented algorithm with information on function parameters.
For empty vectors, this function returns zero.
Definition at line 1307 of file Vector.h.
References pcl::TrimmedMeanOfSquares().
|
inline |
Returns the two-sided average absolute deviation from the median.
See AvgDev() for more information.
Definition at line 1433 of file Vector.h.
References pcl::TwoSidedAvgDev().
|
inlinenoexcept |
Returns the two-sided average absolute deviation with respect to the specified center value.
See AvgDev( double ) for more information.
Definition at line 1423 of file Vector.h.
References pcl::TwoSidedAvgDev().
|
inlinenoexcept |
Returns the two-sided biweight midvariance (BWMV).
center | Reference center value. Normally, the median of the vector components should be used. |
sigma | A two-sided reference estimate of dispersion. Normally, the two-sided median absolute deviation from the median (MAD) of the vector components should be used. See the TwoSidedMAD() member function. |
See BiweightMidvariance( double, double, int, bool ) for more information on the rest of parameters and references.
Definition at line 1577 of file Vector.h.
References pcl::TwoSidedBiweightMidvariance().
|
inline |
Returns the two-sided biweight midvariance (BWMV) with respect to the median and the two-sided median absolute deviation from the median (MAD).
See BiweightMidvariance( int, bool ) for more information and references.
Definition at line 1589 of file Vector.h.
References pcl::Median(), pcl::TwoSidedBiweightMidvariance(), and pcl::TwoSidedMAD().
|
inline |
Returns the two-sided median absolute deviation from the median (MAD).
See MAD() for more information.
Definition at line 1485 of file Vector.h.
References pcl::TwoSidedMAD().
|
inline |
Returns the two-sided median absolute deviation (MAD) with respect to the specified center value.
See MAD( double ) for more information.
Definition at line 1475 of file Vector.h.
References pcl::TwoSidedMAD().
|
inline |
|
inlinenoexcept |
Returns the variance from the mean for the values in this vector.
For vectors with less than two components, this function returns zero.
Definition at line 1317 of file Vector.h.
References pcl::Variance().
|
friend |