52 #ifndef __PCL_Matrix_h
53 #define __PCL_Matrix_h
58 #include <pcl/Diagnostics.h>
63 #include <pcl/Memory.h>
65 #include <pcl/Rotate.h>
69 #ifndef __PCL_NO_MATRIX_STATISTICS
74 #if !defined( __PCL_NO_MATRIX_IMAGE_RENDERING ) && !defined( __PCL_NO_MATRIX_IMAGE_CONVERSION )
79 #if !defined( __PCL_NO_MATRIX_PHASE_MATRICES ) && !defined( __PCL_NO_VECTOR_INSTANTIATE )
88 #define PCL_VALID_KERNEL_SIZE( n ) (n ? Max( 3, n|1 ) : 0)
121 template <
typename T>
182 PCL_PRECONDITION( rows >= 0 && cols >= 0 )
183 m_data =
new Data( rows, cols );
195 PCL_PRECONDITION( rows >= 0 && cols >= 0 )
196 m_data =
new Data( rows, cols );
197 pcl::Fill( m_data->Begin(), m_data->End(), x );
213 template <
typename T1>
216 PCL_PRECONDITION( rows >= 0 && cols >= 0 )
217 m_data =
new Data( rows, cols );
222 const T1* __restrict__ k = a;
224 for ( ; i < j; ++i, ++k )
239 template <
typename T1>
241 const T1& a10,
const T1& a11 )
243 m_data =
new Data( 2, 2 );
260 template <
typename T1>
262 const T1& a10,
const T1& a11,
const T1& a12,
263 const T1& a20,
const T1& a21,
const T1& a22 )
265 m_data =
new Data( 3, 3 );
319 m_data =
new Data( rows, cols );
320 for (
int i = 0; i < m_data->Rows(); ++i, ++i0 )
321 for (
int j = 0; j < m_data->Cols(); ++j, ++j0 )
322 m_data->v[i][j] = x.m_data->v[i0][j0];
325 #ifndef __PCL_NO_MATRIX_IMAGE_CONVERSION
398 if ( m_data !=
nullptr )
411 if ( m_data->IsUnique() )
412 m_data->Deallocate();
415 Data* newData =
new Data( 0, 0 );
534 Data* newData =
new Data( m_data->Rows(), m_data->Cols() );
538 pcl::Fill( m_data->Begin(), m_data->End(), x );
542 #define IMPLEMENT_SCALAR_ASSIGN_OP( op ) \
545 block_iterator __restrict__ i = m_data->Begin(); \
546 const_block_iterator __restrict__ j = m_data->End(); \
548 for ( ; i < j; ++i ) \
553 Data* newData = new Data( m_data->Rows(), m_data->Cols() ); \
554 block_iterator __restrict__ i = newData->Begin(); \
555 const_block_iterator __restrict__ j = newData->End(); \
556 const_block_iterator __restrict__ k = m_data->Begin(); \
558 for ( ; i < j; ++i, ++k ) \
575 IMPLEMENT_SCALAR_ASSIGN_OP( + )
588 IMPLEMENT_SCALAR_ASSIGN_OP( - )
601 IMPLEMENT_SCALAR_ASSIGN_OP( * )
614 IMPLEMENT_SCALAR_ASSIGN_OP( / )
637 Data* newData =
new Data( m_data->Rows(), m_data->Cols() );
642 for ( ; i < j; ++i, ++k )
650 #undef IMPLEMENT_SCALAR_ASSIGN_OP
652 #ifndef __PCL_NO_MATRIX_ELEMENT_WISE_ARITHMETIC_OPERATIONS
654 #define IMPLEMENT_ELEMENT_WISE_ASSIGN_OP( op ) \
657 block_iterator __restrict__ i = m_data->Begin(); \
658 const_block_iterator __restrict__ j = pcl::Min( m_data->End(), \
659 m_data->Begin() + x.NumberOfElements() ); \
660 const_block_iterator __restrict__ k = x.m_data->Begin(); \
662 for ( ; i < j; ++i, ++k ) \
667 Data* newData = new Data( m_data->Rows(), m_data->Cols() ); \
668 block_iterator __restrict__ i = newData->Begin(); \
669 const_block_iterator __restrict__ j = pcl::Min( newData->End(), \
670 newData->Begin() + x.NumberOfElements() ); \
671 const_block_iterator __restrict__ k = x.m_data->Begin(); \
672 const_block_iterator __restrict__ t = m_data->Begin(); \
674 for ( ; i < j; ++i, ++k, ++t ) \
695 IMPLEMENT_ELEMENT_WISE_ASSIGN_OP( + )
712 IMPLEMENT_ELEMENT_WISE_ASSIGN_OP( - )
729 IMPLEMENT_ELEMENT_WISE_ASSIGN_OP( * )
746 IMPLEMENT_ELEMENT_WISE_ASSIGN_OP( / )
769 for ( ; i < j; ++i, ++k )
774 Data* newData =
new Data( m_data->Rows(), m_data->Cols() );
781 for ( ; i < j; ++i, ++k, ++t )
789 #undef IMPLEMENT_ELEMENT_WISE_ASSIGN_OP
805 for ( ; i < j; ++i, ++k )
828 Data* newData =
new Data( m_data->Rows(), m_data->Cols() );
833 for ( ; i < j; ++i, ++k )
852 for ( ; i < j; ++i, ++k )
875 Data* newData =
new Data( m_data->Rows(), m_data->Cols() );
880 for ( ; i < j; ++i, ++k )
899 for ( ; i < j; ++i, ++k )
922 Data* newData =
new Data( m_data->Rows(), m_data->Cols() );
927 for ( ; i < j; ++i, ++k )
939 return m_data->IsUnique();
948 return m_data == x.m_data;
962 Data* newData =
new Data( m_data->Rows(), m_data->Cols() );
967 for ( ; i < j; ++i, ++k )
980 return m_data->Rows();
989 return m_data->Cols();
1020 return m_data !=
nullptr;
1029 return Rows() == 0 || Cols() == 0;
1037 operator bool() const noexcept
1048 return m_data->NumberOfElements();
1057 return m_data->Size();
1069 return IsAliasOf( x ) || SameDimensions( x ) &&
pcl::Equal( Begin(), x.Begin(), x.End() );
1083 return !IsAliasOf( x ) &&
pcl::Compare( Begin(), End(), x.Begin(), x.End() ) < 0;
1092 return Rows() == x.Rows() && Cols() == x.Cols();
1106 if ( unlikely( IsAliasOf( x ) ) )
1108 if ( unlikely( NumberOfElements() != x.NumberOfElements() ) )
1114 for ( ; i < j; ++i, ++k )
1129 return m_data->Element( i, j );
1138 return m_data->Element( i, j );
1153 return m_data->v[i];
1164 return m_data->v[i];
1182 return m_data->Begin();
1196 return m_data->Begin();
1244 return m_data->End();
1259 return m_data->End();
1305 return m_data->v[i];
1308 #ifndef __PCL_NO_STL_COMPATIBLE_ITERATORS
1347 vector r( m_data->Cols() );
1348 for (
int j = 0; j < m_data->Cols(); ++j )
1349 r[j] = m_data->v[i][j];
1358 vector c( m_data->Rows() );
1359 for (
int i = 0; i < m_data->Rows(); ++i )
1360 c[i] = m_data->v[i][j];
1371 return ColumnVector( j );
1382 for (
int j = 0; j < m_data->Cols() && j < r.Length(); ++j )
1383 m_data->v[i][j] =
element( r[j] );
1394 for (
int i = 0; i < m_data->Rows() && i < c.Length(); ++i )
1395 m_data->v[i][j] =
element( c[i] );
1418 for (
int j = 0; j < r.
Length(); ++j )
1419 R.m_data->v[0][j] = r[j];
1431 for (
int i = 0; i < c.
Length(); ++i )
1432 C.m_data->v[i][0] = c[i];
1441 return FromColumnVector( c );
1453 for (
int i = 0; i < n; ++i )
1467 for (
int i = 0; i < m_data->Rows(); ++i )
1468 for (
int j = 0; j < m_data->Cols(); ++j )
1469 Tr.m_data->v[j][i] = m_data->v[i][j];
1507 pcl::Reverse( m_data->Begin(), m_data->End() );
1517 pcl::CopyReversed( Tf.m_data->End(), m_data->Begin(), m_data->End() );
1588 PCL_PRECONDITION( Rows() == 3 && Cols() == 3 )
1593 A0[2] =
element( A0[2] + A0[0]*dx + A0[1]*dy );
1594 A1[2] =
element( A1[2] + A1[0]*dx + A1[1]*dy );
1595 A2[2] =
element( A2[2] + A2[0]*dx + A2[1]*dy );
1609 Translate(
double( delta[0] ),
double( delta[1] ) );
1621 R.Translate( dx, dy );
1637 return Translated(
double( delta[0] ),
double( delta[1] ) );
1678 SinCos( phi, sphi, cphi );
1679 return RotationX( sphi, cphi );
1720 SinCos( phi, sphi, cphi );
1721 return RotationY( sphi, cphi );
1762 SinCos( phi, sphi, cphi );
1763 return RotationZ( sphi, cphi );
1791 PCL_PRECONDITION( Rows() == 3 && Cols() == 3 )
1795 double a10 = cphi*A1[0] + sphi*A2[0];
1796 double a11 = cphi*A1[1] + sphi*A2[1];
1797 double a12 = cphi*A1[2] + sphi*A2[2];
1798 double a20 = -sphi*A1[0] + cphi*A2[0];
1799 double a21 = -sphi*A1[1] + cphi*A2[1];
1800 double a22 = -sphi*A1[2] + cphi*A2[2];
1820 SinCos( phi, sphi, cphi );
1821 RotateX( sphi, cphi );
1832 R.RotateX( sphi, cphi );
1872 PCL_PRECONDITION( Rows() == 3 && Cols() == 3 )
1876 double a00 = cphi*A0[0] - sphi*A2[0];
1877 double a01 = cphi*A0[1] - sphi*A2[1];
1878 double a02 = cphi*A0[2] - sphi*A2[2];
1879 double a20 = sphi*A0[0] + cphi*A2[0];
1880 double a21 = sphi*A0[1] + cphi*A2[1];
1881 double a22 = sphi*A0[2] + cphi*A2[2];
1901 SinCos( phi, sphi, cphi );
1902 RotateY( sphi, cphi );
1913 R.RotateY( sphi, cphi );
1953 PCL_PRECONDITION( Rows() == 3 && Cols() == 3 )
1957 double a00 = cphi*A0[0] + sphi*A1[0];
1958 double a01 = cphi*A0[1] + sphi*A1[1];
1959 double a02 = cphi*A0[2] + sphi*A1[2];
1960 double a10 = -sphi*A0[0] + cphi*A1[0];
1961 double a11 = -sphi*A0[1] + cphi*A1[1];
1962 double a12 = -sphi*A0[2] + cphi*A1[2];
1982 SinCos( phi, sphi, cphi );
1983 RotateZ( sphi, cphi );
1994 R.RotateZ( sphi, cphi );
2027 for ( ; i < j; ++i )
2040 R.Truncate( f0, f1 );
2063 if ( v0 != f0 || v1 != f1 )
2072 double d = (double( f1 ) - double( f0 ))/(
double( v1 ) - double( v0 ));
2076 for ( ; i < j; ++i )
2082 for ( ; i < j; ++i )
2083 *i =
element( d*(*i - v0) + f0 );
2087 pcl::Fill( m_data->Begin(), m_data->End(), f0 );
2090 pcl::Fill( m_data->Begin(), m_data->End(),
pcl::Range( v0, f0, f1 ) );
2100 R.Rescale( f0, f1 );
2110 pcl::Sort( m_data->Begin(), m_data->End() );
2129 pcl::Sort( m_data->Begin(), m_data->End(),
2152 pcl::Sort( m_data->Begin(), m_data->End(), p );
2175 return (p != m_data->End()) ? p :
nullptr;
2195 return (p != m_data->End()) ? p :
nullptr;
2206 #ifndef __PCL_NO_MATRIX_STATISTICS
2215 return *
MinItem( m_data->Begin(), m_data->End() );
2231 p.y = int( d/m_data->Cols() );
2232 p.x = int( d%m_data->Cols() );
2246 return *
MaxItem( m_data->Begin(), m_data->End() );
2261 int d = m - m_data->Begin();
2262 p.y = d/m_data->Cols();
2263 p.x = d%m_data->Cols();
2277 return pcl::Sum( m_data->Begin(), m_data->End() );
2340 return pcl::Mean( m_data->Begin(), m_data->End() );
2396 return pcl::StdDev( m_data->Begin(), m_data->End() );
2406 return pcl::Median( m_data->Begin(), m_data->End() );
2423 double AvgDev(
double center )
const noexcept
2425 return pcl::AvgDev( m_data->Begin(), m_data->End(), center );
2462 return pcl::AvgDev( m_data->Begin(), m_data->End() );
2515 double MAD(
double center )
const
2517 return pcl::MAD( m_data->Begin(), m_data->End(), center );
2532 return pcl::MAD( m_data->Begin(), m_data->End() );
2591 double BiweightMidvariance(
double center,
double sigma,
int k = 9,
bool reducedLength =
false ) const noexcept
2627 double center =
Median();
2646 int k = 9,
bool reducedLength =
false ) const noexcept
2659 double center =
Median();
2740 return pcl::Sn( A.Begin(), A.End() );
2768 return pcl::Qn( A.Begin(), A.End() );
2783 return pcl::Hash64( m_data->Begin(), m_data->Size(), seed );
2796 return pcl::Hash32( m_data->Begin(), m_data->Size(), seed );
2824 template <
class S,
typename SP>
2825 S& ToSeparated( S& s, SP separator )
const
2830 s.Append( S( *i ) );
2834 s.Append( separator );
2835 s.Append( S( *i ) );
2864 template <
class S,
typename SP,
class AF>
2865 S& ToSeparated( S& s, SP separator, AF append )
const
2870 append( s, S( *i ) );
2877 append( s, S( *i ) );
2894 S& ToCommaSeparated( S& s )
const
2896 return ToSeparated( s,
',' );
2908 S& ToSpaceSeparated( S& s )
const
2910 return ToSeparated( s,
' ' );
2922 S& ToTabSeparated( S& s )
const
2924 return ToSeparated( s,
'\t' );
2927 #ifndef __PCL_NO_MATRIX_PHASE_MATRICES
2935 if ( B.Rows() != A.Rows() || B.Cols() != A.Cols() )
2936 throw Error(
"Invalid matrix dimensions in PhaseCorrelationMatrix()" );
2948 if ( B.Rows() != A.Rows() || B.Cols() != A.Cols() )
2949 throw Error(
"Invalid matrix dimensions in CrossPowerSpectrumMatrix()" );
2957 #ifndef __PCL_NO_MATRIX_IMAGE_RENDERING
2981 typename P::sample* __restrict__ v = *image;
2985 for ( ; i < j; ++i, ++v )
2986 *v = P::ToSample( *i );
3012 case 32: ToImage(
static_cast<Image&
>( *image ) );
break;
3013 case 64: ToImage(
static_cast<DImage&
>( *image ) );
break;
3018 case 32: ToImage(
static_cast<ComplexImage&
>( *image ) );
break;
3019 case 64: ToImage(
static_cast<DComplexImage&
>( *image ) );
break;
3024 case 8: ToImage(
static_cast<UInt8Image&
>( *image ) );
break;
3025 case 16: ToImage(
static_cast<UInt16Image&
>( *image ) );
break;
3026 case 32: ToImage(
static_cast<UInt32Image&
>( *image ) );
break;
3032 #ifndef __PCL_NO_MATRIX_IMAGE_CONVERSION
3078 if ( r == image.
Bounds() )
3081 const typename P::sample* __restrict__ v = image[channel];
3085 for ( ; i < j; ++i, ++v )
3086 P::FromSample( *i, *v );
3096 for (
int i = r.
y0; i < r.
y1; ++i )
3098 const typename P::sample* __restrict__ v = image.
PixelAddress( r.
x0, i, channel );
3100 for (
int j = 0; j < w; ++j )
3101 P::FromSample( *m++, *v++ );
3127 case 32:
return FromImage(
static_cast<const Image&
>( *image ), rect, channel );
3128 case 64:
return FromImage(
static_cast<const DImage&
>( *image ), rect, channel );
3133 case 32:
return FromImage(
static_cast<const ComplexImage&
>( *image ), rect, channel );
3134 case 64:
return FromImage(
static_cast<const DComplexImage&
>( *image ), rect, channel );
3139 case 8:
return FromImage(
static_cast<const UInt8Image&
>( *image ), rect, channel );
3140 case 16:
return FromImage(
static_cast<const UInt16Image&
>( *image ), rect, channel );
3141 case 32:
return FromImage(
static_cast<const UInt32Image&
>( *image ), rect, channel );
3160 block_iterator* v =
nullptr;
3164 Data(
int rows,
int cols )
3166 if ( rows > 0 && cols > 0 )
3167 Allocate( rows, cols );
3175 int Rows() const noexcept
3180 int Cols() const noexcept
3185 size_type NumberOfElements() const noexcept
3192 return NumberOfElements()*
sizeof( element );
3195 block_iterator Begin()
const
3197 block_iterator p = (v !=
nullptr) ? *v :
nullptr;
3198 if ( likely( std::is_scalar<element>::value ) )
3199 return reinterpret_cast<block_iterator
>( PCL_ASSUME_ALIGNED_32( p ) );
3203 block_iterator End() const noexcept
3205 return (v !=
nullptr) ? *v + NumberOfElements() : nullptr;
3208 element& Element(
int i,
int j )
const noexcept
3213 void Allocate(
int rows,
int cols )
3217 v =
new block_iterator[ n ];
3218 if ( likely( std::is_scalar<element>::value ) )
3220 *v =
reinterpret_cast<block_iterator
>( PCL_ALIGNED_MALLOC( Size(), 32 ) );
3221 if ( unlikely( *v ==
nullptr ) )
3226 throw std::bad_alloc();
3230 *v =
new element[ NumberOfElements() ];
3231 for (
int i = 1; i < n; ++i )
3237 PCL_PRECONDITION( refCount == 0 )
3240 if ( likely( std::is_scalar<element>::value ) )
3241 PCL_ALIGNED_FREE( *v );
3255 Data* m_data =
nullptr;
3261 void DetachFromData()
3263 if ( !m_data->Detach() )
3271 static bool Invert( block_iterator* Ai, const_block_iterator
const* A,
int n ) noexcept
3282 const_block_iterator __restrict__ A0 = A[0];
3283 const_block_iterator __restrict__ A1 = A[1];
3284 element d = A0[0]*A1[1] - A0[1]*A1[0];
3288 Ai[0][1] = -A0[1]/d;
3289 Ai[1][0] = -A1[0]/d;
3295 const_block_iterator __restrict__ A0 = A[0];
3296 const_block_iterator __restrict__ A1 = A[1];
3297 const_block_iterator __restrict__ A2 = A[2];
3298 element d1 = A1[1]*A2[2] - A1[2]*A2[1];
3299 element d2 = A1[2]*A2[0] - A1[0]*A2[2];
3300 element d3 = A1[0]*A2[1] - A1[1]*A2[0];
3301 element d = A0[0]*d1 + A0[1]*d2 + A0[2]*d3;
3305 Ai[0][1] = (A2[1]*A0[2] - A2[2]*A0[1])/d;
3306 Ai[0][2] = (A0[1]*A1[2] - A0[2]*A1[1])/d;
3308 Ai[1][1] = (A2[2]*A0[0] - A2[0]*A0[2])/d;
3309 Ai[1][2] = (A0[2]*A1[0] - A0[0]*A1[2])/d;
3311 Ai[2][1] = (A2[0]*A0[1] - A2[1]*A0[0])/d;
3312 Ai[2][2] = (A0[0]*A1[1] - A0[1]*A1[0])/d;
3330 template <
typename T>
inline
3333 if ( Rows() != Cols() || Rows() == 0 )
3334 throw Error(
"Invalid matrix inversion: Non-square or empty matrix." );
3343 if ( !Invert( Ai.m_data->v, m_data->v, Rows() ) )
3344 throw Error(
"Invalid matrix inversion: Singular matrix." );
3356 template <
typename T>
inline
3360 Transfer( Inverse() );
3363 if ( Rows() != Cols() || Rows() == 0 )
3364 throw Error(
"Invalid matrix inversion: Non-square or empty matrix." );
3388 template <
typename T>
inline
3391 if ( B.Rows() != A.Rows() || B.Cols() != A.Cols() )
3392 throw Error(
"Invalid matrix addition." );
3399 for ( ; i < j; ++i, ++k, ++t )
3409 template <
typename T>
inline
3417 for ( ; i < j; ++i, ++k )
3430 template <
typename T>
inline
3446 template <
typename T>
inline
3449 if ( B.Rows() != A.Rows() || B.Cols() != A.Cols() )
3450 throw Error(
"Invalid matrix subtraction." );
3457 for ( ; i < j; ++i, ++k, ++t )
3467 template <
typename T>
inline
3475 for ( ; i < j; ++i, ++k )
3489 template <
typename T>
inline
3497 for ( ; i < j; ++i, ++k )
3516 template <
typename T>
inline
3522 if ( B.Rows() != p )
3523 throw Error(
"Invalid matrix multiplication." );
3525 for (
int i = 0; i < n; ++i )
3526 for (
int j = 0; j < m; ++j )
3529 for (
int k = 0; k < p; ++k )
3530 rij += A[i][k] * B[k][j];
3548 template <
typename T>
inline
3554 throw Error(
"Invalid matrix-vector multiplication." );
3556 for (
int i = 0; i < m; ++i )
3559 for (
int j = 0; j < n; ++j )
3560 ri += A[i][j] * x[j];
3571 template <
typename T>
inline
3579 for ( ; i < j; ++i, ++k )
3592 template <
typename T>
inline
3605 template <
typename T>
inline
3613 for ( ; i < j; ++i, ++k )
3626 template <
typename T>
inline
3634 for ( ; i < j; ++i, ++k )
3646 template <
typename T>
inline
3654 for ( ; i < j; ++i, ++k )
3667 template <
typename T>
inline
3675 for ( ; i < j; ++i, ++k )
3682 #ifndef __PCL_NO_MATRIX_INSTANTIATE
3695 using I8Matrix = GenericMatrix<int8>;
3826 using F64Matrix = GenericMatrix<double>;
3855 using C32Matrix = GenericMatrix<Complex32>;
3864 using C64Matrix = GenericMatrix<Complex64>;
3879 using F80Matrix = GenericMatrix<long double>;
bool ParseSelection(Rect &rect, int &firstChannel, int &lastChannel) const noexcept
8-bit unsigned integer matrix.
32-bit floating point complex matrix.
64-bit floating point complex matrix.
8-bit signed integer matrix.
64-bit floating point real matrix.
Root base class of all PCL containers of objects.
A simple exception with an associated error message.
32-bit floating point real matrix.
64-bit floating point real matrix.
80-bit extended precision floating point real matrix.
32-bit floating point real matrix.
Implements a generic, two-dimensional, shared or local image.
sample * PixelAddress(int x, int y, int channel=0)
GenericImage & AllocateData(int width, int height, int numberOfChannels=1, color_space colorSpace=ColorSpace::Gray)
Generic dynamic matrix of arbitrary dimensions.
const_block_iterator End() const noexcept
double Modulus() const noexcept
element MaxElement(Point &p) const noexcept
int Cols() const noexcept
void Rescale(const element &f0=element(0), const element &f1=element(1))
static GenericMatrix UnitMatrix(int n)
static GenericMatrix RotationZ(double phi)
double Variance() const noexcept
double TrimmedMean(distance_type l=1, distance_type h=1) const noexcept
GenericMatrix Sqrt() const
void RotateZ(double sphi, double cphi)
GenericMatrix Sorted(BP p) const
uint64 Hash64(uint64 seed=0) const noexcept
vector ColVector(int j) const
void Truncate(const element &f0=element(0), const element &f1=element(1))
element MinElement() const noexcept
vector ColumnVector(int j) const
size_type Size() const noexcept
bool Contains(const element &x) const noexcept
GenericMatrix Transpose() const
const_block_iterator FindLast(const element &x) const noexcept
void Translate(double dx, double dy)
bool IsEmpty() const noexcept
GenericMatrix ReverseSorted() const
static GenericMatrix Translation(const V &delta)
static GenericMatrix RotationY(double sphi, double cphi)
void Transfer(GenericMatrix &&x)
element & Element(int i, int j)
GenericMatrix Flipped() const
GenericMatrix Translated(double dx, double dy) const
void SetColumn(int j, const V &c)
double StableAvgDev() const
TwoSidedEstimate TwoSidedAvgDev(double center) const noexcept
GenericMatrix(const T1 *a, int rows, int cols)
GenericMatrix(const GenericMatrix &x, int i0, int j0, int rows, int cols)
double StableModulus() const noexcept
block_iterator RowPtr(int i) noexcept
const_block_iterator ConstEnd() const noexcept
GenericMatrix RotatedY(double phi) const
void SetRow(int i, const V &r)
void ToImage(ImageVariant &image) const
GenericMatrix Rescaled(const element &f0=element(0), const element &f1=element(1)) const
const_block_iterator begin() const noexcept
static GenericMatrix RotationY(double phi)
bool SameElements(const GenericMatrix &x) const noexcept
uint64 Hash(uint64 seed=0) const noexcept
const_block_iterator ConstBegin() const noexcept
double Sum() const noexcept
void RotateY(double sphi, double cphi)
void RotateX(double sphi, double cphi)
TwoSidedEstimate TwoSidedMAD(double center) const
TwoSidedEstimate TwoSidedBiweightMidvariance(double center, const TwoSidedEstimate &sigma, int k=9, bool reducedLength=false) const noexcept
GenericMatrix Inverse() const
element MinElement(Point &p) const noexcept
vector RowVector(int i) const
double SumOfSquares() const noexcept
const_block_iterator Begin() const noexcept
double StdDev() const noexcept
const element & Element(int i, int j) const noexcept
GenericMatrix(const T1 &a00, const T1 &a01, const T1 &a10, const T1 &a11)
double StableSumOfSquares() const noexcept
bool IsValid() const noexcept
static GenericMatrix FromColumnVector(const vector &c)
int Columns() const noexcept
GenericMatrix RotatedX(double phi) const
GenericMatrix(const GenericImage< P > &image, const Rect &rect=Rect(0), int channel=-1)
GenericMatrix Sorted() const
GenericMatrix Translated(const V &delta) const
double StableMean() const noexcept
size_type NumberOfElements() const noexcept
GenericMatrix RotatedZ(double phi) const
double StableAvgDev(double center) const noexcept
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)
double AvgDev(double center) const noexcept
double BendMidvariance(double center, double beta=0.2) const
void ToImage(GenericImage< P > &image) const
static GenericMatrix RotationX(double phi)
TwoSidedEstimate TwoSidedAvgDev() const
GenericMatrix(const ImageVariant &image, const Rect &rect=Rect(0), int channel=-1)
GenericMatrix(const element &x, int rows, int cols)
GenericMatrix RotatedY(double sphi, double cphi) const
static GenericMatrix Translation(double dx, double dy)
const_block_iterator end() const noexcept
static GenericMatrix RotationX(double sphi, double cphi)
void Assign(const GenericMatrix &x)
block_iterator * DataPtr() noexcept
static GenericMatrix FromImage(const ImageVariant &image, const Rect &rect=Rect(0), int channel=-1)
static GenericMatrix FromRowVector(const vector &r)
uint32 Hash32(uint32 seed=0) const noexcept
static GenericMatrix FromImage(const GenericImage< P > &image, const Rect &rect=Rect(0), int channel=-1)
GenericMatrix(GenericMatrix &&x)
GenericMatrix(const GenericMatrix &x)
friend void Swap(GenericMatrix &x1, GenericMatrix &x2) noexcept
GenericMatrix(int rows, int cols)
element MaxElement() const noexcept
bool IsAliasOf(const GenericMatrix &x) const noexcept
double BendMidvariance(double beta=0.2) const
int Rows() const noexcept
static GenericMatrix FromColVector(const vector &c)
static GenericMatrix RotationZ(double sphi, double cphi)
double Mean() const noexcept
void Transfer(GenericMatrix &x)
double BiweightMidvariance(int k=9, bool reducedLength=false) const
double TrimmedMeanOfSquares(distance_type l=1, distance_type h=1) const noexcept
const element * const_block_iterator
TwoSidedEstimate TwoSidedMAD() const
double BiweightMidvariance(double center, double sigma, int k=9, bool reducedLength=false) const noexcept
bool IsUnique() const noexcept
const_block_iterator FindFirst(const element &x) const noexcept
GenericMatrix RotatedX(double sphi, double cphi) const
GenericMatrix RotatedZ(double sphi, double cphi) const
const_block_iterator Find(const element &x) const noexcept
GenericMatrix Abs() const
TwoSidedEstimate TwoSidedBiweightMidvariance(int k=9, bool reducedLength=false) const
GenericMatrix Sqr() const
void SetCol(int j, const V &c)
GenericMatrix Truncated(const element &f0=element(0), const element &f1=element(1)) const
bool SameDimensions(const GenericMatrix &x) const noexcept
double StableSum() const noexcept
void Translate(const V &delta)
double MAD(double center) const
A generic point in the two-dimensional space.
A generic rectangle in the two-dimensional space.
component y1
Vertical coordinate of the lower right corner.
component y0
Vertical coordinate of the upper left corner.
component x0
Horizontal coordinate of the upper left corner.
component Width() const noexcept
component Height() const noexcept
Generic vector of arbitrary length.
int Length() const noexcept
16-bit signed integer matrix.
32-bit signed integer matrix.
8-bit signed integer matrix.
32-bit signed integer matrix.
int Width() const noexcept
int Height() const noexcept
Rect Bounds() const noexcept
Acts like a union for all types of images in PCL, with optional class-wide ownership of transported i...
bool IsFloatSample() const noexcept
bool IsComplexSample() const noexcept
int BitsPerSample() const noexcept
ImageVariant & CreateFloatImage(int bitSize=32)
80-bit extended precision floating point real matrix.
64-bit floating point real matrix.
Thread-safe reference counter for copy-on-write data structures.
16-bit unsigned integer matrix.
32-bit unsigned integer matrix.
64-bit unsigned integer matrix.
8-bit unsigned integer matrix.
bool operator==(const Array< T, A > &x1, const Array< T, A > &x2) noexcept
bool operator<(const Array< T, A > &x1, const Array< T, A > &x2) noexcept
Complex< T1 > operator-(const Complex< T1 > &c1, const Complex< T2 > &c2) noexcept
Complex< T1 > operator*(const Complex< T1 > &c1, const Complex< T2 > &c2) noexcept
Complex< T1 > operator+(const Complex< T1 > &c1, const Complex< T2 > &c2) noexcept
Complex< T1 > operator/(const Complex< T1 > &c1, const Complex< T2 > &c2) noexcept
Complex< T1 > Pow(const Complex< T1 > &c, T2 x) noexcept
Complex< T > Sqrt(const Complex< T > &c) noexcept
T Abs(const Complex< T > &c) noexcept
uint64 Hash64(const void *data, size_type size, uint64 seed=0) noexcept
uint32 Hash32(const void *data, size_type size, uint32 seed=0) noexcept
GenericImage< P > operator^(const GenericImage< P > &image, T scalar)
void PCL_FUNC InPlaceGaussJordan(Matrix &A, Matrix &B)
void SinCos(T x, T &sx, T &cx) noexcept
void PhaseCorrelationMatrix(Complex< T > *__restrict__ i, const Complex< T > *__restrict__ j, const Complex< T > *__restrict__ a, const Complex< T > *__restrict__ b) noexcept
static GenericMatrix PhaseCorrelationMatrix(const GenericMatrix &A, const GenericMatrix &B)
void CrossPowerSpectrumMatrix(Complex< T > *__restrict__ i, const Complex< T > *__restrict__ j, const Complex< T > *__restrict__ a, const Complex< T > *__restrict__ b) noexcept
static GenericMatrix CrossPowerSpectrumMatrix(const GenericMatrix &A, const GenericMatrix &B)
void Swap(GenericPoint< T > &p1, GenericPoint< T > &p2) noexcept
unsigned long long uint64
FI LinearSearch(FI i, FI j, const T &v) noexcept
BI LinearSearchLast(BI i, BI j, const T &v) noexcept
double Qn(T *__restrict__ x, T *__restrict__ xn)
double BendMidvariance(const T *__restrict__ x, const T *__restrict__ xn, double center, double beta=0.2)
double StableModulus(const T *__restrict__ i, const T *__restrict__ j) noexcept
double MAD(const T *__restrict__ i, const T *__restrict__ j, double center, double eps=0)
double SumOfSquares(const T *__restrict__ i, const T *__restrict__ j) noexcept
double StableMean(const T *__restrict__ i, const T *__restrict__ j) noexcept
double TrimmedMean(const T *__restrict__ i, const T *__restrict__ j, distance_type l=1, distance_type h=1)
TwoSidedEstimate TwoSidedMAD(const T *__restrict__ i, const T *__restrict__ j, double center, double eps=0)
double StableSum(const T *__restrict__ i, const T *__restrict__ j) noexcept
double Variance(const T *__restrict__ i, const T *__restrict__ j, double center) noexcept
TwoSidedEstimate TwoSidedBiweightMidvariance(const T *__restrict__ x, const T *__restrict__ xn, double center, const TwoSidedEstimate &sigma, int k=9, bool reducedLength=false) noexcept
double Sum(const T *__restrict__ i, const T *__restrict__ j) noexcept
double StableSumOfSquares(const T *__restrict__ i, const T *__restrict__ j) noexcept
double BiweightMidvariance(const T *__restrict__ x, const T *__restrict__ xn, double center, double sigma, int k=9, bool reducedLength=false) noexcept
double StdDev(const T *__restrict__ i, const T *__restrict__ j, double center) noexcept
double TrimmedMeanOfSquares(const T *__restrict__ i, const T *__restrict__ j, distance_type l=1, distance_type h=1)
double AvgDev(const T *__restrict__ i, const T *__restrict__ j, double center) noexcept
double Median(const T *__restrict__ i, const T *__restrict__ j, double eps=0)
double Mean(const T *__restrict__ i, const T *__restrict__ j) noexcept
double StableAvgDev(const T *__restrict__ i, const T *__restrict__ j, double center) noexcept
TwoSidedEstimate TwoSidedAvgDev(const T *__restrict__ i, const T *__restrict__ j, double center) noexcept
double Modulus(const T *__restrict__ i, const T *__restrict__ j) noexcept
double Sn(T *__restrict__ x, T *__restrict__ xn)
constexpr const T & Min(const T &a, const T &b) noexcept
FI MinItem(FI i, FI j) noexcept
bool Equal(FI1 i1, FI2 i2, FI2 j2) noexcept
int Compare(FI1 i1, FI1 j1, FI2 i2, FI2 j2) noexcept
constexpr const T & Range(const T &x, const T &a, const T &b) noexcept
constexpr const T & Max(const T &a, const T &b) noexcept
FI MaxItem(FI i, FI j) noexcept
Two-sided descriptive statistical estimate.