PCL
Matrix Operators

This section includes scalar-to-matrix and matrix-to-matrix arithmetic operator functions that are not members of the GenericMatrix template class. More...

Functions

template<typename T >
GenericMatrix< T > pcl::operator* (const GenericMatrix< T > &A, const GenericMatrix< T > &B)
 
template<typename T >
GenericVector< T > pcl::operator* (const GenericMatrix< T > &A, const GenericVector< T > &x)
 
template<typename T >
GenericMatrix< T > pcl::operator* (const GenericMatrix< T > &A, const T &x)
 
template<typename T >
GenericMatrix< T > pcl::operator* (const T &x, const GenericMatrix< T > &A)
 
template<typename T >
GenericMatrix< T > pcl::operator+ (const GenericMatrix< T > &A, const GenericMatrix< T > &B)
 
template<typename T >
GenericMatrix< T > pcl::operator+ (const GenericMatrix< T > &A, const T &x)
 
template<typename T >
GenericMatrix< T > pcl::operator+ (const T &x, const GenericMatrix< T > &A)
 
template<typename T >
GenericMatrix< T > pcl::operator- (const GenericMatrix< T > &A, const GenericMatrix< T > &B)
 
template<typename T >
GenericMatrix< T > pcl::operator- (const GenericMatrix< T > &A, const T &x)
 
template<typename T >
GenericMatrix< T > pcl::operator- (const T &x, const GenericMatrix< T > &A)
 
template<typename T >
GenericMatrix< T > pcl::operator/ (const GenericMatrix< T > &A, const T &x)
 
template<typename T >
GenericMatrix< T > pcl::operator/ (const T &x, const GenericMatrix< T > &A)
 
template<typename T >
GenericMatrix< T > pcl::operator^ (const GenericMatrix< T > &A, const T &x)
 
template<typename T >
GenericMatrix< T > pcl::operator^ (const T &x, const GenericMatrix< T > &A)
 

Detailed Description

Function Documentation

◆ operator*() [1/4]

template<typename T >
GenericMatrix<T> pcl::operator* ( const GenericMatrix< T > &  A,
const GenericMatrix< T > &  B 
)
inline

Returns the product of two matrices A and B.

If the specified matrices are incompatible for matrix multiplication (because the number of rows in B is not equal to the number of columns in A), this function throws an appropriate Error exception.

Bear in mind that matrix multiplication has O(N^3) complexity. This is relevant to multiply large matrices.

Definition at line 3499 of file Matrix.h.

◆ operator*() [2/4]

template<typename T >
GenericVector<T> pcl::operator* ( const GenericMatrix< T > &  A,
const GenericVector< T > &  x 
)
inline

Returns the product of a matrix A by a vector x.

If the specified objects are incompatible for multiplication (because the number of components in x is not equal to the number of columns in A), this function throws the appropriate Error exception.

The result of the product of a matrix with m rows and n columns by a vector of n components is a vector of m components.

Definition at line 3531 of file Matrix.h.

◆ operator*() [3/4]

template<typename T >
GenericMatrix<T> pcl::operator* ( const GenericMatrix< T > &  A,
const T &  x 
)
inline

Returns the product of a matrix A and a scalar x.

Definition at line 3554 of file Matrix.h.

◆ operator*() [4/4]

template<typename T >
GenericMatrix<T> pcl::operator* ( const T &  x,
const GenericMatrix< T > &  A 
)
inline

Returns the product of a scalar x and a matrix A.

This function exists to implement the commutative property of scalar-to-matrix multiplication. It is equivalent to A * x.

Definition at line 3575 of file Matrix.h.

◆ operator+() [1/3]

template<typename T >
GenericMatrix<T> pcl::operator+ ( const GenericMatrix< T > &  A,
const GenericMatrix< T > &  B 
)
inline

Returns the sum of two matrices A and B.

If the specified matrices are incompatible for matrix addition (because their dimensions are different), this function throws an Error exception.

Definition at line 3371 of file Matrix.h.

◆ operator+() [2/3]

template<typename T >
GenericMatrix<T> pcl::operator+ ( const GenericMatrix< T > &  A,
const T &  x 
)
inline

Returns the sum of a matrix A and a scalar x.

Definition at line 3392 of file Matrix.h.

◆ operator+() [3/3]

template<typename T >
GenericMatrix<T> pcl::operator+ ( const T &  x,
const GenericMatrix< T > &  A 
)
inline

Returns the sum of a scalar x and a matrix A.

This function exists to implement the commutative property of scalar-to-matrix addition. It is equivalent to A + x.

Definition at line 3413 of file Matrix.h.

◆ operator-() [1/3]

template<typename T >
GenericMatrix<T> pcl::operator- ( const GenericMatrix< T > &  A,
const GenericMatrix< T > &  B 
)
inline

Returns the result of subtracting a matrix B from another matrix A.

If the specified matrices are incompatible for matrix subtraction (because their dimensions are different), this function throws an Error exception.

Definition at line 3429 of file Matrix.h.

◆ operator-() [2/3]

template<typename T >
GenericMatrix<T> pcl::operator- ( const GenericMatrix< T > &  A,
const T &  x 
)
inline

Returns the subtraction of a scalar x from a matrix A.

Definition at line 3450 of file Matrix.h.

◆ operator-() [3/3]

template<typename T >
GenericMatrix<T> pcl::operator- ( const T &  x,
const GenericMatrix< T > &  A 
)
inline

Returns the subtraction of a matrix A from a scalar x.

This function exists because scalar-to-matrix subtraction is not a commutative operation. A - x is not equal to x - A (the resulting matrix elements have the same magnitudes but opposite signs).

Definition at line 3472 of file Matrix.h.

◆ operator/() [1/2]

template<typename T >
GenericMatrix<T> pcl::operator/ ( const GenericMatrix< T > &  A,
const T &  x 
)
inline

Returns the result of dividing a matrix A by a scalar x.

Definition at line 3588 of file Matrix.h.

◆ operator/() [2/2]

template<typename T >
GenericMatrix<T> pcl::operator/ ( const T &  x,
const GenericMatrix< T > &  A 
)
inline

Returns the result of dividing a scalar x by a matrix A.

This function exists because scalar-to-matrix division is not a commutative operation. A/x is not equal to x/A.

Definition at line 3609 of file Matrix.h.

◆ operator^() [1/2]

template<typename T >
GenericMatrix<T> pcl::operator^ ( const GenericMatrix< T > &  A,
const T &  x 
)
inline

Returns the result of raising a matrix A to a scalar x.

Definition at line 3629 of file Matrix.h.

◆ operator^() [2/2]

template<typename T >
GenericMatrix<T> pcl::operator^ ( const T &  x,
const GenericMatrix< T > &  A 
)
inline

Returns the result of raising a scalar x to a matrix A.

This function exists because scalar-to-matrix exponentiation is not a commutative operation. A^x is not equal to x^A.

Definition at line 3650 of file Matrix.h.