PCL
|
Generic dynamic matrix of arbitrary dimensions. More...
#include <Matrix.h>
Public Types | |
using | block_iterator = element * |
using | const_block_iterator = const element * |
using | element = T |
using | vector = GenericVector< element > |
Public Member Functions | |
GenericMatrix () | |
GenericMatrix (const element &x, int rows, int cols) | |
template<class P > | |
GenericMatrix (const GenericImage< P > &image, const Rect &rect=Rect(0), int channel=-1) | |
GenericMatrix (const GenericMatrix &x) | |
GenericMatrix (const GenericMatrix &x, int i0, int j0, int rows, int cols) | |
GenericMatrix (const ImageVariant &image, const Rect &rect=Rect(0), int channel=-1) | |
template<typename T1 > | |
GenericMatrix (const T1 &a00, const T1 &a01, const T1 &a02, const T1 &a10, const T1 &a11, const T1 &a12, const T1 &a20, const T1 &a21, const T1 &a22) | |
template<typename T1 > | |
GenericMatrix (const T1 &a00, const T1 &a01, const T1 &a10, const T1 &a11) | |
template<typename T1 > | |
GenericMatrix (const T1 *a, int rows, int cols) | |
GenericMatrix (GenericMatrix &&x) | |
GenericMatrix (int rows, int cols) | |
virtual | ~GenericMatrix () |
GenericMatrix | Abs () const |
void | Assign (const GenericMatrix &x) |
double | AvgDev () const |
double | AvgDev (double center) const noexcept |
block_iterator | Begin () |
block_iterator | begin () |
const_block_iterator | Begin () const noexcept |
const_block_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 () |
int | Cols () const noexcept |
int | Columns () const noexcept |
vector | ColumnVector (int j) const |
vector | ColVector (int j) const |
const_block_iterator | ConstBegin () const noexcept |
const_block_iterator | ConstEnd () const noexcept |
bool | Contains (const element &x) const noexcept |
block_iterator * | DataPtr () noexcept |
element & | Element (int i, int j) |
const element & | Element (int i, int j) const noexcept |
block_iterator | End () |
block_iterator | end () |
const_block_iterator | End () const noexcept |
const_block_iterator | end () const noexcept |
void | EnsureUnique () |
const_block_iterator | Find (const element &x) const noexcept |
const_block_iterator | FindFirst (const element &x) const noexcept |
const_block_iterator | FindLast (const element &x) const noexcept |
void | Flip () |
GenericMatrix | Flipped () const |
uint64 | Hash (uint64 seed=0) const noexcept |
uint32 | Hash32 (uint32 seed=0) const noexcept |
uint64 | Hash64 (uint64 seed=0) const noexcept |
GenericMatrix | Inverse () const |
void | Invert () |
bool | IsAliasOf (const GenericMatrix &x) const noexcept |
bool | IsEmpty () const noexcept |
bool | IsUnique () const noexcept |
bool | IsValid () const noexcept |
double | MAD () const |
double | MAD (double center) const |
element | MaxElement () const noexcept |
element | MaxElement (Point &p) const noexcept |
double | Mean () const noexcept |
double | Median () const |
element | MinElement () const noexcept |
element | MinElement (Point &p) const noexcept |
double | Modulus () const noexcept |
size_type | NumberOfElements () const noexcept |
operator bool () const noexcept | |
block_iterator | operator* () |
const_block_iterator | operator* () const noexcept |
GenericMatrix & | operator*= (const element &x) |
GenericMatrix & | operator*= (const GenericMatrix &x) |
GenericMatrix & | operator+= (const element &x) |
GenericMatrix & | operator+= (const GenericMatrix &x) |
GenericMatrix & | operator-= (const element &x) |
GenericMatrix & | operator-= (const GenericMatrix &x) |
GenericMatrix & | operator/= (const element &x) |
GenericMatrix & | operator/= (const GenericMatrix &x) |
bool | operator< (const GenericMatrix &x) const noexcept |
GenericMatrix & | operator= (const element &x) |
GenericMatrix & | operator= (const GenericMatrix &x) |
GenericMatrix & | operator= (GenericMatrix &&x) |
bool | operator== (const GenericMatrix &x) const noexcept |
block_iterator | operator[] (int i) |
const_block_iterator | operator[] (int i) const noexcept |
GenericMatrix & | operator^= (const element &x) |
GenericMatrix & | operator^= (const GenericMatrix &x) |
double | Qn () const |
void | Rescale (const element &f0=element(0), const element &f1=element(1)) |
GenericMatrix | Rescaled (const element &f0=element(0), const element &f1=element(1)) const |
void | ReverseSort () |
GenericMatrix | ReverseSorted () const |
GenericMatrix | RotatedX (double phi) const |
GenericMatrix | RotatedX (double sphi, double cphi) const |
GenericMatrix | RotatedY (double phi) const |
GenericMatrix | RotatedY (double sphi, double cphi) const |
GenericMatrix | RotatedZ (double phi) const |
GenericMatrix | RotatedZ (double sphi, double cphi) const |
void | RotateX (double phi) |
void | RotateX (double sphi, double cphi) |
void | RotateY (double phi) |
void | RotateY (double sphi, double cphi) |
void | RotateZ (double phi) |
void | RotateZ (double sphi, double cphi) |
block_iterator | RowPtr (int i) noexcept |
int | Rows () const noexcept |
vector | RowVector (int i) const |
bool | SameDimensions (const GenericMatrix &x) const noexcept |
bool | SameElements (const GenericMatrix &x) const noexcept |
void | SetAbs () |
template<class V > | |
void | SetCol (int j, const V &c) |
template<class V > | |
void | SetColumn (int j, const V &c) |
template<class V > | |
void | SetRow (int i, const V &r) |
void | SetSqr () |
void | SetSqrt () |
size_type | Size () const noexcept |
double | Sn () const |
void | Sort () |
template<class BP > | |
void | Sort (BP p) |
GenericMatrix | Sorted () const |
template<class BP > | |
GenericMatrix | Sorted (BP p) const |
GenericMatrix | Sqr () const |
GenericMatrix | 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 P > | |
void | ToImage (GenericImage< P > &image) const |
void | ToImage (ImageVariant &image) 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<class S > | |
S & | ToTabSeparated (S &s) const |
void | Transfer (GenericMatrix &&x) |
void | Transfer (GenericMatrix &x) |
template<class V > | |
void | Translate (const V &delta) |
void | Translate (double dx, double dy) |
template<class V > | |
GenericMatrix | Translated (const V &delta) const |
GenericMatrix | Translated (double dx, double dy) const |
GenericMatrix | Transpose () const |
double | TrimmedMean (distance_type l=1, distance_type h=1) const noexcept |
double | TrimmedMeanOfSquares (distance_type l=1, distance_type h=1) const noexcept |
void | Truncate (const element &f0=element(0), const element &f1=element(1)) |
GenericMatrix | Truncated (const element &f0=element(0), const element &f1=element(1)) const |
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 |
double | Variance () const noexcept |
Static Public Member Functions | |
static GenericMatrix | CrossPowerSpectrumMatrix (const GenericMatrix &A, const GenericMatrix &B) |
static GenericMatrix | FromColumnVector (const vector &c) |
static GenericMatrix | FromColVector (const vector &c) |
template<class P > | |
static GenericMatrix | FromImage (const GenericImage< P > &image, const Rect &rect=Rect(0), int channel=-1) |
static GenericMatrix | FromImage (const ImageVariant &image, const Rect &rect=Rect(0), int channel=-1) |
static GenericMatrix | FromRowVector (const vector &r) |
static GenericMatrix | PhaseCorrelationMatrix (const GenericMatrix &A, const GenericMatrix &B) |
static GenericMatrix | RotationX (double phi) |
static GenericMatrix | RotationX (double sphi, double cphi) |
static GenericMatrix | RotationY (double phi) |
static GenericMatrix | RotationY (double sphi, double cphi) |
static GenericMatrix | RotationZ (double phi) |
static GenericMatrix | RotationZ (double sphi, double cphi) |
template<class V > | |
static GenericMatrix | Translation (const V &delta) |
static GenericMatrix | Translation (double dx, double dy) |
static GenericMatrix | UnitMatrix (int n) |
Friends | |
void | Swap (GenericMatrix &x1, GenericMatrix &x2) noexcept |
GenericMatrix is a lightweight template class implementing a matrix of arbitrary size. This class provides the following main features:
using pcl::GenericMatrix< T >::block_iterator = element* |
using pcl::GenericMatrix< T >::const_block_iterator = const element* |
using pcl::GenericMatrix< T >::element = T |
using pcl::GenericMatrix< T >::vector = GenericVector<element> |
|
inline |
|
inline |
|
inline |
|
inline |
Constructs a matrix and initializes it with values from a static buffer.
a | Address of the first item of a static array for initialization of matrix elements. The array must provide at least rows x cols consecutive elements stored in row order (all elements of the first matrix row followed by all elements of the second row, and so on). |
rows | Number of matrix rows (≥ 0). |
cols | Number of matrix columns (≥ 0). |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Constructs a matrix as a copy of a rectangular subset of another matrix.
x | Source matrix from which this object will acquire element values. |
i0 | Starting row in x. Corresponds to the first (top) row of this matrix. |
j0 | Starting column in x. Corresponds to the first (leftmost) column of this matrix. |
rows | Number of matrix rows. |
cols | Number of matrix columns. |
If the specified submatrix is invalid, i.e. if the specified row or column don't exist, or if the specified number of rows and columns exceed the dimensions of the source matrix x, this constructor constrains the submatrix coordinates and dimensions to the nearest valid values, possibly constructing an empty matrix.
Definition at line 301 of file Matrix.h.
References pcl::GenericMatrix< T >::Cols(), pcl::Max(), pcl::Range(), and pcl::GenericMatrix< T >::Rows().
|
inline |
Constructs a matrix from image pixel samples.
This constructor converts pixel sample values to matrix elements for a rectangular region of a channel of the specified image.
image | Image from which matrix elements will be generated. |
rect | A rectangular region in image pixel coordinates, from which this matrix will be generated. If this parameter is not specified, or if an empty rectangle is specified, this function will perform the matrix conversion for the current rectangular selection in the image, that is, for image.SelectedRectangle(). |
channel | Channel index. Must be the zero-based index of an existing channel in the image, or an integer < 0. If this parameter is not specified, or if a negative integer is specified, this function will perform the matrix conversion for the currently selected channel in the image, that is, for image.SelectedChannel(). |
The newly created matrix is a representation of the intersection of the specified (or implicitly selected) rectangular region with the image for the scalar data type T of this matrix instantiation. All predefined pixel sample types are supported, including integer, real and complex pixels.
If there is no intersection between the rectangular region and the image, this constructor yields an empty matrix.
Note that if the source image is of a floating point type (either real or complex) and the scalar type T of this matrix instantiation is of an integer type, out-of-range matrix elements will be truncated to either zero or to the maximum integer value, if the corresponding source pixel sample is outside the normalized [0,1] range.
|
inline |
Constructs a matrix from image pixel samples.
This constructor converts pixel sample values to matrix elements for a rectangular region of a channel of the image transported by the specified ImageVariant.
If the specified ImageVariant object does not transport an image, this constructor yields an empty matrix.
Refer to the documentation for GenericMatrix::GenericMatrix( const GenericImage&, const Rect&, int ) for more information about the conversion performed by this constructor.
|
inlinevirtual |
|
inline |
|
inline |
Assigns a matrix x to this object.
If this instance and the specified source instance x reference different matrix 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 matrix data, then this function does nothing.
|
inline |
Returns the average absolute deviation from the median.
The mean absolute deviation from the median is a well-known estimator of dispersion.
For matrices with less than two elements, this function returns zero.
Definition at line 2442 of file Matrix.h.
References pcl::AvgDev().
|
inlinenoexcept |
Returns the average absolute deviation with respect to the specified center value.
When the median of the matrix 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 matrices with less than two elements, this function returns zero.
Definition at line 2405 of file Matrix.h.
References pcl::AvgDev().
|
inline |
Returns a pointer to the first matrix element, that is to the element at row 0 and column 0 of this matrix.
All matrix elements are guaranteed to be stored at consecutive locations addressable from the pointer returned by this function. Matrix elements are stored in row order: all elements of row 0 followed by all elements of row 1, and so on.
Before returning, this function ensures that this instance uniquely references its matrix data.
|
inline |
|
inlinenoexcept |
Returns a pointer to the immutable first matrix element, that is to the element at row 0 and column 0 of this matrix.
All matrix elements are guaranteed to be stored at consecutive locations addressable from the pointer returned by this function. Matrix elements are stored in row order: all elements of row 0 followed by all elements of row 1, and so on.
|
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 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 matrices with less than two elements, this function returns zero.
References
Rand R. Wilcox (2012), Introduction to Robust Estimation and Hypothesis Testing, 3rd Edition, Elsevier Inc., Section 3.12.3.
Definition at line 2691 of file Matrix.h.
References pcl::BendMidvariance().
|
inline |
Returns a percentage bend midvariance (PBMV).
center | Reference center value. Normally, the median of the matrix elements 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 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 matrices with less than two elements, 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 2667 of file Matrix.h.
References pcl::BendMidvariance().
|
inlinenoexcept |
Returns the biweight midvariance (BWMV).
center | Reference center value. Normally, the median of the matrix elements should be used. |
sigma | A reference estimate of dispersion. Normally, the median absolute deviation from the median (MAD) of the matrix elements 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 matrix elements. 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 number of matrix elements, including rejected elements, 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 matrices with less than two elements, 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 2573 of file Matrix.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 matrix elements. 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 number of matrix elements, including rejected elements, 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 matrices with less than two elements, 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 2607 of file Matrix.h.
References pcl::BiweightMidvariance(), pcl::MAD(), and pcl::Median().
|
inline |
|
inlinenoexcept |
Returns the number of columns in this matrix. If this object is an empty matrix, this member function returns zero.
Definition at line 969 of file Matrix.h.
Referenced by pcl::GenericMatrix< T >::GenericMatrix().
|
inlinenoexcept |
|
inline |
|
inline |
Returns a vector with the matrix elements at the specified column j.
This member function is an alias for ColumnVector().
|
inlinenoexcept |
A synonym for Begin() const.
|
inlinenoexcept |
A synonym for End() const.
|
inlinenoexcept |
Returns true iff this matrix contains the specified value x.
Definition at line 2183 of file Matrix.h.
References pcl::LinearSearch().
|
inlinenoexcept |
Returns a pointer to a pointer to the first element in this matrix.
The returned pointer can be used as a common C array, where all matrix rows are guaranteed to be addressable through consecutive pointers starting from the pointer returned by this function.
This member function does nothing to ensure that this instance uniquely references its matrix data. Consequently, the caller must take into account that all modifications made to matrix elements accessed through the value returned by this function will apply to all instances sharing the same matrix data.
This function can be used to perform fast operations on matrix elements, avoiding the overhead caused by deep copies of matrix data, when such copies are not necessary. Typically this happens when two or more threads work simultaneously on non-overlapping regions of the same matrix.
|
inline |
|
inlinenoexcept |
|
inline |
Returns a pointer past the last matrix element, that is a pointer to an (nonexistent) element located at row=Rows()-1 and column=Cols().
All matrix elements are guaranteed to be stored in reverse order at consecutive locations addressable from the pointer returned by this function. Matrix elements are stored in row order (all elements of row n followed by all elements of row n-1, and so on).
Before returning, this function ensures that this instance uniquely references its matrix data.
|
inline |
|
inlinenoexcept |
Returns a pointer past the last immutable matrix element, that is a pointer to an immutable (and nonexistent) element located at row=Rows()-1 and column=Cols().
All matrix elements are guaranteed to be stored in reverse order at consecutive locations addressable from the pointer returned by this function. Matrix elements are stored in row order (all elements of row n followed by all elements of row n-1, and so on).
|
inlinenoexcept |
STL-compatible iteration. Equivalent to End() const.
|
inline |
|
inlinenoexcept |
Returns a pointer to the first immutable matrix element with the specified value x, or nullptr if this matrix does not contain such value.
Definition at line 2154 of file Matrix.h.
References pcl::LinearSearch().
|
inlinenoexcept |
|
inlinenoexcept |
Returns a pointer to the last immutable matrix element with the specified value x, or nullptr if this matrix does not contain such value.
Definition at line 2174 of file Matrix.h.
References pcl::LinearSearchLast().
|
inline |
|
inline |
|
inlinestatic |
|
inlinestatic |
This member function is an alias for FromColumnVector().
|
inlinestatic |
Creates a matrix from image pixel samples.
This static member function converts pixel sample values to matrix elements for a rectangular region of a channel of the specified image.
image | Image from which matrix elements will be generated. |
rect | A rectangular region in image pixel coordinates, from which the returned matrix will be generated. If this parameter is not specified, or if an empty rectangle is specified, this function will perform the matrix conversion for the current rectangular selection in the image, that is, for image.SelectedRectangle(). |
channel | Channel index. Must be the zero-based index of an existing channel in the image, or an integer < 0. If this parameter is not specified, or if a negative integer is specified, this function will perform the matrix conversion for the currently selected channel in the image, that is, for image.SelectedChannel(). |
The returned matrix is a representation of the intersection of the specified (or implicitly selected) rectangular region with the image for the scalar data type T of this matrix instantiation. All predefined pixel sample types are supported, including integer, real and complex pixels.
If there is no intersection between the rectangular region and the image, or if an invalid channel index is specified, this function returns an empty matrix.
Note that if the source image is of a floating point type (either real or complex) and the scalar type T of this matrix instantiation is of an integer type, out-of-range matrix elements will be truncated to either zero or to the maximum integer value, if the corresponding source pixel sample is outside the normalized [0,1] range.
Definition at line 3054 of file Matrix.h.
References pcl::ImageGeometry::Bounds(), and pcl::AbstractImage::ParseSelection().
|
inlinestatic |
Creates a matrix from image pixel samples.
This static member function converts pixel sample values to matrix elements for a rectangular region of a channel of the image transported by the specified ImageVariant.
If the specified ImageVariant object does not transport an image, this member function returns an empty matrix.
Refer to the documentation for FromImage( const GenericImage&, const Rect&, int ) for more information about the conversion performed by this member function.
Definition at line 3103 of file Matrix.h.
References pcl::ImageVariant::BitsPerSample(), pcl::ImageVariant::IsComplexSample(), and pcl::ImageVariant::IsFloatSample().
|
inlinestatic |
|
inlinenoexcept |
Returns a non-cryptographic hash value computed for this matrix. This function is a synonym for Hash64().
Definition at line 2785 of file Matrix.h.
References pcl::Hash64().
|
inlinenoexcept |
Returns a 32-bit non-cryptographic hash value computed for this matrix.
This function calls pcl::Hash32() for the internal matrix 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 2776 of file Matrix.h.
References pcl::Hash32().
|
inlinenoexcept |
Returns a 64-bit non-cryptographic hash value computed for this matrix.
This function calls pcl::Hash64() for the internal matrix 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 2763 of file Matrix.h.
References pcl::Hash64().
|
inline |
Returns the inverse of this matrix.
When a square matrix is multiplied by its inverse, the result is the identity matrix. Non-square matrices do not have inverses.
If this is an empty or non-square matrix, or if it is singular (i.e. if its determinant is zero or insignificant), then this function throws the appropriate Error exception.
|
inline |
Inverts this matrix.
When a square matrix is multiplied by its inverse, the result is the identity matrix. Non-square matrices do not have inverses.
If this is an empty or non-square matrix, or if it is singular (i.e. if its determinant is zero or insignificant), then this function throws the appropriate Error exception.
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Returns true only if this matrix is valid. A matrix is valid if it references an internal matrix structure, even if it is an empty matrix.
In general, all GenericMatrix objects are valid with only two exceptions:
An invalid matrix object cannot be used and should be destroyed immediately. Invalid matrices are always destroyed automatically during move construction and move assignment operations.
|
inline |
Returns the median absolute deviation from the median (MAD).
The MAD is a well-known robust estimator of scale.
For matrices with less than two elements, this function returns zero.
Definition at line 2512 of file Matrix.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 matrices with less than two elements, this function returns zero.
Definition at line 2497 of file Matrix.h.
References pcl::MAD().
|
inlinenoexcept |
Returns the value of the maximum element in this matrix. For empty matrices, this function returns zero.
Definition at line 2225 of file Matrix.h.
References pcl::MaxItem().
|
inlinenoexcept |
Returns the value of the maximum element in this matrix and its coordinates in the specified point p. For empty matrices, this function returns zero and assigns zero to the point coordinates.
Definition at line 2238 of file Matrix.h.
References pcl::MaxItem().
|
inlinenoexcept |
Returns the mean of the element values in this matrix.
For empty matrices, this function returns zero.
Definition at line 2320 of file Matrix.h.
References pcl::Mean().
|
inline |
Returns the median of element values in this matrix.
For matrices with less than two elements, this function returns zero.
Definition at line 2386 of file Matrix.h.
References pcl::Median().
|
inlinenoexcept |
Returns the value of the minimum element in this matrix. For empty matrices, this function returns zero.
Definition at line 2194 of file Matrix.h.
References pcl::MinItem().
|
inlinenoexcept |
Returns the value of the minimum element in this matrix and its coordinates in the specified point p. For empty matrices, this function returns zero and assigns zero to the point coordinates.
Definition at line 2207 of file Matrix.h.
References pcl::MinItem().
|
inlinenoexcept |
Returns the sum of the absolute values of all matrix elements.
For empty matrices, this function returns zero.
Definition at line 2278 of file Matrix.h.
References pcl::Modulus().
|
inlinenoexcept |
|
inlinenoexcept |
Returns true iff this matrix is not empty. This operator is equivalent to:
|
inline |
|
inlinenoexcept |
Returns a pointer to the immutable first matrix element, that is to the element at row 0 and column 0 of this matrix.
This member function is a convenience alias to Begin() const.
|
inline |
Multiplies all elements of this matrix by a constant scalar x. Returns a reference to this object.
Before multiplying all matrix elements by a constant value, this function ensures that this instance uniquely references its matrix data, generating a duplicate if necessary.
|
inline |
Performs the element-wise multiplication of a matrix x with this matrix. Returns a reference to this object.
The specified operand matrix x should have at least the same number of elements as this matrix. Otherwise the operation will be aborted upon reaching the end of the operand matrix, but no exception will be thrown.
This function ensures that this instance uniquely references its matrix data before the element-wise multiplication operation, generating a duplicate if necessary.
|
inline |
Adds a constant scalar x to all elements of this matrix. Returns a reference to this object.
Before adding a constant value to all matrix elements, this function ensures that this instance uniquely references its matrix data, generating a duplicate if necessary.
|
inline |
Performs the element-wise addition of a matrix x to this matrix. Returns a reference to this object.
The specified operand matrix x should have at least the same number of elements as this matrix. Otherwise the operation will be aborted upon reaching the end of the operand matrix, but no exception will be thrown.
This function ensures that this instance uniquely references its matrix data before the element-wise addition operation, generating a duplicate if necessary.
|
inline |
Subtracts a constant scalar x from all elements of this matrix. Returns a reference to this object.
Before subtracting a constant value from all matrix elements, this function ensures that this instance uniquely references its matrix data, generating a duplicate if necessary.
|
inline |
Performs the element-wise subtraction of a matrix x to this matrix. Returns a reference to this object.
The specified operand matrix x should have at least the same number of elements as this matrix. Otherwise the operation will be aborted upon reaching the end of the operand matrix, but no exception will be thrown.
This function ensures that this instance uniquely references its matrix data before the element-wise subtraction operation, generating a duplicate if necessary.
|
inline |
Divides all elements of this matrix by a constant scalar x. Returns a reference to this object.
Before dividing all matrix elements by a constant value, this function ensures that this instance uniquely references its matrix data, generating a duplicate if necessary.
|
inline |
Performs the element-wise division of this matrix by a matrix x. Returns a reference to this object.
The specified operand matrix x should have at least the same number of elements as this matrix. Otherwise the operation will be aborted upon reaching the end of the operand matrix, but no exception will be thrown.
This function ensures that this instance uniquely references its matrix data before the element-wise division operation, generating a duplicate if necessary.
|
inlinenoexcept |
Less than relational operator. Returns true if this matrix is less than another matrix x.
In this operator, matrix comparisons are performed element-wise, irrespective of matrix dimensions, until either two matrix elements differ, or until the end of one of the matrices is reached. In the latter case the shortest matrix is the lesser one.
Definition at line 1063 of file Matrix.h.
References pcl::Compare().
|
inline |
Assigns a constant scalar x to all elements of this matrix. Returns a reference to this object.
Before assigning a constant value to all matrix elements, this function ensures that this instance uniquely references its matrix data, generating a new matrix data block if necessary.
|
inline |
Copy assignment operator. Returns a reference to this object.
If this instance and the specified source instance x reference different matrix 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 matrix data, then this function does nothing.
|
inline |
|
inlinenoexcept |
Equality operator. Returns true if this matrix is equal to another matrix x.
Matrix comparisons are performed element-wise. Two matrices are equal if both have the same dimensions and identical element values.
Definition at line 1049 of file Matrix.h.
References pcl::Equal().
|
inline |
Returns a pointer to the first matrix element of row i.
All elements in row i are guaranteed to be stored at consecutive locations addressable from the pointer returned by this function.
Before returning, this function ensures that this instance uniquely references its matrix data.
|
inlinenoexcept |
|
inline |
Raises all elements of this matrix to a constant scalar x. Returns a reference to this object.
Before raising all matrix elements to a constant value, this function ensures that this instance uniquely references its matrix data, generating a duplicate if necessary.
|
inline |
Performs the element-wise exponentiation of this matrix by a matrix x. Returns a reference to this object.
The specified matrix x must have at least the same number of elements as this matrix. Otherwise an Error exception will be thrown.
This function ensures that this instance uniquely references its matrix data before the element-wise raise operation, generating a duplicate if necessary.
|
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 matrices with less than two elements, 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.
|
inline |
Rescales all matrix elements to the specified range.
f0 | Lower bound of the rescaling range. If not specified, the default value is zero. |
f1 | Upper bound of the rescaling range. If not specified, the default value is one. |
The rescaling operation is as follows. if m and M are the minimum and maximum element values in this matrix, respectively, then for each matrix element s, its rescaled value r is given by:
r = f0 + (s - m)*(f1 - f0)/(M - m)
|
inline |
|
inline |
Sorts the elements of this matrix in reverse (descending) order.
Definition at line 2108 of file Matrix.h.
References pcl::Sort().
|
inline |
|
inline |
Returns a rotated copy of this 3x3 matrix about the X axis by the specified rotation angle phi in radians. See RotateX( double ).
|
inline |
Returns a rotated copy of this 3x3 matrix about the X axis by a rotation angle given by its sine sphi and cosine cphi. See RotateX( double, double ).
|
inline |
Returns a rotated copy of this 3x3 matrix about the Y axis by the specified rotation angle phi in radians. See RotateY( double ).
|
inline |
Returns a rotated copy of this 3x3 matrix about the Y axis by a rotation angle given by its sine sphi and cosine cphi. See RotateY( double, double ).
|
inline |
Returns a rotated copy of this 3x3 matrix about the Z axis by the specified rotation angle phi in radians. See RotateZ( double ).
|
inline |
Returns a rotated copy of this 3x3 matrix about the Z axis by a rotation angle given by its sine sphi and cosine cphi. See RotateZ( double, double ).
|
inline |
Rotates this 3x3 matrix about the X axis by the specified angle phi in radians.
Calling this function is equivalent to:
Definition at line 1799 of file Matrix.h.
References pcl::SinCos().
|
inline |
Rotates this 3x3 matrix about the X axis.
sphi | Sine of the rotation angle. |
cphi | Cosine of the rotation angle. |
Positive rotation angles apply anticlockwise rotations about the X axis, as seen looking towards the origin from positive x. The applied transformation can be represented by the matrix:
1 0 0 0 +cphi +sphi 0 -sphi +cphi
If this matrix has dimensions different from 3 rows and 3 columns, this function invokes undefined behavior. For the sake of performance, this condition is not explicitly verified.
|
inline |
Rotates this 3x3 matrix about the Y axis by the specified angle phi in radians.
Calling this function is equivalent to:
Definition at line 1880 of file Matrix.h.
References pcl::SinCos().
|
inline |
Rotates this 3x3 matrix about the Y axis.
sphi | Sine of the rotation angle. |
cphi | Cosine of the rotation angle. |
Positive rotation angles apply anticlockwise rotations about the Y axis, as seen looking towards the origin from positive y. The applied transformation can be represented by the matrix:
+cphi 0 -sphi 0 1 0 +sphi 0 +cphi
If this matrix has dimensions different from 3 rows and 3 columns, this function invokes undefined behavior. For the sake of performance, this condition is not explicitly verified.
|
inline |
Rotates this 3x3 matrix about the Z axis by the specified angle phi in radians.
Calling this function is equivalent to:
Definition at line 1961 of file Matrix.h.
References pcl::SinCos().
|
inline |
Rotates this 3x3 matrix about the Z axis.
sphi | Sine of the rotation angle. |
cphi | Cosine of the rotation angle. |
Positive rotation angles apply anticlockwise rotations about the Z axis, as seen looking towards the origin from positive z. The applied transformation can be represented by the matrix:
+cphi +sphi 0 -sphi +cphi 0 0 0 1
If this matrix has dimensions different from 3 rows and 3 columns, this function invokes undefined behavior. For the sake of performance, this condition is not explicitly verified.
|
inlinestatic |
Returns a 3x3 rotation matrix about the X axis by the specified angle phi in radians.
Calling this function is equivalent to:
Definition at line 1657 of file Matrix.h.
References pcl::SinCos().
|
inlinestatic |
Returns a 3x3 rotation matrix about the X axis.
sphi | Sine of the rotation angle. |
cphi | Cosine of the rotation angle. |
Positive rotation angles apply anticlockwise rotations about the X axis, as seen looking towards the origin from positive x.
The returned matrix is:
1 0 0 0 +cphi +sphi 0 -sphi +cphi
|
inlinestatic |
Returns a 3x3 rotation matrix about the Y axis by the specified angle phi in radians.
Calling this function is equivalent to:
Definition at line 1699 of file Matrix.h.
References pcl::SinCos().
|
inlinestatic |
Returns a 3x3 rotation matrix about the Y axis.
sphi | Sine of the rotation angle. |
cphi | Cosine of the rotation angle. |
Positive rotation angles apply anticlockwise rotations about the Y axis, as seen looking towards the origin from positive y.
The returned matrix is:
+cphi 0 -sphi 0 1 0 +sphi 0 +cphi
|
inlinestatic |
Returns a 3x3 rotation matrix about the Z axis by the specified angle phi in radians.
Calling this function is equivalent to:
Definition at line 1741 of file Matrix.h.
References pcl::SinCos().
|
inlinestatic |
Returns a 3x3 rotation matrix about the Z axis.
sphi | Sine of the rotation angle. |
cphi | Cosine of the rotation angle. |
Positive rotation angles apply anticlockwise rotations about the Z axis, as seen looking towards the origin from positive z.
The returned matrix is:
+cphi +sphi 0 -sphi +cphi 0 0 0 1
|
inlinenoexcept |
Returns a pointer to the first matrix element of row i.
All elements in row i are guaranteed to be stored at consecutive locations addressable from the pointer returned by this function.
This member function does not ensure that the data referenced by this matrix is unique. See DataPtr() for more information on how to use this member function.
|
inlinenoexcept |
Returns the number of rows in this matrix. If this object is an empty matrix, this member function returns zero.
Definition at line 960 of file Matrix.h.
Referenced by pcl::GenericMatrix< T >::GenericMatrix(), pcl::GenericFFT2D< T >::operator<<(), pcl::GenericRealFFT2D< T >::operator<<(), pcl::GenericFFT2D< T >::operator>>(), and pcl::GenericRealFFT2D< T >::operator>>().
|
inline |
|
inlinenoexcept |
|
inlinenoexcept |
Returns true iff this matrix has the same elements as another matrix x.
In this member function, matrix comparisons are performed element-wise, irrespective of matrix dimensions. Note that two matrices can have exactly the same elements even if their dimensions, i.e. their number of rows and columns, are different. Only the number and order of elements are relevant for this comparison.
|
inline |
|
inline |
Assigns the components of a vector c to the corresponding elements of a matrix column i.
This member function is an alias for SetColumn().
|
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 matrices with less than two elements, 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.
|
inline |
Sorts the elements of this matrix in ascending order.
Definition at line 2089 of file Matrix.h.
References pcl::Sort().
Sorts the elements of this matrix in ascending order. Ordering of matrix elements is defined such that for any pair a, b of matrix elements, the specified binary predicate p( a, b ) is true if a precedes b.
Definition at line 2131 of file Matrix.h.
References pcl::Sort().
|
inline |
|
inline |
Returns a sorted copy of this matrix, where ordering of matrix elements 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 matrices with less than two elements, this function returns zero.
Definition at line 2460 of file Matrix.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 matrix 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 matrices with less than two elements, this function returns zero.
Definition at line 2425 of file Matrix.h.
References pcl::StableAvgDev().
|
inlinenoexcept |
Computes the mean of the element values in this matrix using a numerically stable summation algorithm to minimize roundoff error.
For empty matrices, this function returns zero.
Definition at line 2331 of file Matrix.h.
References pcl::StableMean().
|
inlinenoexcept |
Computes the sum of the absolute values of all matrix elements using a numerically stable summation algorithm to minimize roundoff error.
For empty matrices, this function returns zero.
Definition at line 2289 of file Matrix.h.
References pcl::StableModulus().
|
inlinenoexcept |
Computes the sum of all matrix elements using a numerically stable summation algorithm to minimize roundoff error.
For empty matrices, this function returns zero.
Definition at line 2268 of file Matrix.h.
References pcl::StableSum().
|
inlinenoexcept |
Computes the sum of the squares of all matrix elements using a numerically stable summation algorithm to minimize roundoff error.
For empty matrices, this function returns zero.
Definition at line 2310 of file Matrix.h.
References pcl::StableSumOfSquares().
|
inlinenoexcept |
Returns the standard deviation from the mean for the values in this matrix.
For matrices with less than two elements, this function returns zero.
Definition at line 2376 of file Matrix.h.
References pcl::StdDev().
|
inlinenoexcept |
Returns the sum of all matrix elements.
For empty matrices, this function returns zero.
Definition at line 2257 of file Matrix.h.
References pcl::Sum().
|
inlinenoexcept |
Returns the sum of the squares of all matrix elements.
For empty matrices, this function returns zero.
Definition at line 2299 of file Matrix.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 |
Renders this matrix as an image.
The contents of the specified image will be replaced with a grayscale rendition of this matrix, where the value of each pixel sample will be proportional to its corresponding matrix component counterpart.
Note that if this matrix has out-of-range values for the pixel sample type of the target image, pixel saturation will occur at either the white or black points, or both. This only happens when the target image is of an integer type and this matrix contains floating point values outside the normalized [0,1] range.
If the target image is of a floating-point type (either real or complex) and this matrix also stores floating point values, the output image may require a rescaling or normalization operation to constrain all pixel values to the normalized [0,1] range after calling this member function.
Definition at line 2960 of file Matrix.h.
References pcl::GenericImage< P >::AllocateData().
|
inline |
Renders this matrix as an image.
The contents of the image transported by the specified ImageVariant object will be replaced with a grayscale rendition of this matrix, where the value of each pixel sample will be proportional to its corresponding matrix component counterpart.
If the specified ImageVariant does not transport an image, a new one will be created in 32-bit floating point format.
Also take into account the information given for ToImage( GenericImage& ), relative to out-of-range values, which is entirely applicable to this member function.
Definition at line 2986 of file Matrix.h.
References pcl::ImageVariant::BitsPerSample(), pcl::ImageVariant::CreateFloatImage(), pcl::ImageVariant::IsComplexSample(), and pcl::ImageVariant::IsFloatSample().
|
inline |
Generates a sequence of string tokens separated with the specified separator string. Returns a reference to the target string s.
For each matrix element, this function appends a string representation (known as a token) to the target string s. If the matrix contains more than one element, 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 matrix element 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 matrix element x, this function appends a string representation (known as a token) to the target string s by calling the append function:
If the matrix has more than one element, successive tokens are separated by calling:
The string type S must have type conversion semantics to transform a matrix element 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:
|
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 matrix x to this object.
Decrements the reference counter of the current matrix data. If the data becomes unreferenced, it is destroyed and deallocated. The matrix data referenced by the source object x is then transferred to this object, and the source object x is left empty.
|
inline |
Transfers data from another matrix x to this object.
Decrements the reference counter of the current matrix data. If the data becomes unreferenced, it is destroyed and deallocated. The matrix data referenced by the source object x is then transferred to this object, and the source object x is left empty.
|
inline |
Translates this 3x3 matrix by the specified translation vector delta.
See Translation( const V& ) for detailed information on the expected properties of the type V.
|
inline |
Translates this 3x3 matrix.
dx | Translation increment on the X axis. |
dy | Translation increment on the Y axis. |
This function multiplies this matrix by the translation matrix:
1 0 dx 0 1 dy 0 0 1
If this matrix has dimensions different from 3 rows and 3 columns, this function invokes undefined behavior. For the sake of performance, this condition is not explicitly verified.
|
inline |
Returns a translated copy of this 3x3 matrix by the specified translation vector delta.
See Translation( const V& ) for detailed information on the expected properties of the type V.
|
inline |
Returns a translated copy of this 3x3 matrix by the specified increments dx and dy on the X and Y axes, respectively. See Translate().
|
inlinestatic |
Returns a 3x3 translation matrix for the specified translation vector delta.
The type V is expected to provide the array subscript operator:
C V::operator []( int i ) const
where the type C must have conversion-to-double semantics. The subindex i will be either 0 or 1 for the translation increments on the X and Y axes, respectively.
|
inlinestatic |
Returns a 3x3 translation matrix.
dx | Translation increment on the X axis. |
dy | Translation increment on the Y axis. |
The returned matrix is:
1 0 dx 0 1 dy 0 0 1
|
inline |
|
inlinenoexcept |
Computes the two-sided, asymmetric trimmed mean of the values in this matrix. See pcl::TrimmedMean() for a complete description of the implemented algorithm with information on function parameters.
For empty matrices, this function returns zero.
Definition at line 2343 of file Matrix.h.
References pcl::TrimmedMean().
|
inlinenoexcept |
Computes the two-sided, asymmetric trimmed mean of the squared values in this matrix. See pcl::TrimmedMeanOfSquares() for a complete description of the implemented algorithm with information on function parameters.
For empty matrices, this function returns zero.
Definition at line 2355 of file Matrix.h.
References pcl::TrimmedMeanOfSquares().
|
inline |
Truncates all matrix elements to the specified range.
f0 | Lower bound of the truncation range. If not specified, the default value is zero. |
f1 | Upper bound of the truncation range. If not specified, the default value is one. |
After calling this member function, all matrix elements will be within the [f0,f1] range.
|
inline |
Returns a truncated copy of this matrix. See Truncate().
|
inline |
Returns the two-sided average absolute deviation from the median.
See AvgDev() for more information.
Definition at line 2481 of file Matrix.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 2471 of file Matrix.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 2627 of file Matrix.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 2639 of file Matrix.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 2533 of file Matrix.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 2523 of file Matrix.h.
References pcl::TwoSidedMAD().
|
inlinestatic |
|
inlinenoexcept |
Returns the variance from the mean for the values in this matrix.
For matrices with less than two elements, this function returns zero.
Definition at line 2365 of file Matrix.h.
References pcl::Variance().
|
friend |