Matrix Functions

These function apply to matrices (and also Matrix expression) and can return a matrix expression of a particular defined type, like in the matrix multiplication or a vector, like in the matrix-vector product or a scalar like in the Similarity vector-matrix product. More...

Functions

template<class T, unsigned int D, unsigned int D2, class R1, class R2>
Expr< BinaryOp< AddOp< T >,
SMatrix< T, D, D2, R1 >,
SMatrix< T, D, D2, R2 >,
T >, T, D, D2, typename AddPolicy<
T, D, D2, R1, R2 >::RepType > 
ROOT::Math::operator+ (const SMatrix< T, D, D2, R1 > &lhs, const SMatrix< T, D, D2, R2 > &rhs)
 Addition of two matrices C = A+B returning a matrix expression.
template<class A, class T, unsigned int D, unsigned int D2, class R>
Expr< BinaryOpCopyR< AddOp<
T >, SMatrix< T, D, D2, R >,
Constant< A >, T >, T, D,
D2, R > 
ROOT::Math::operator+ (const SMatrix< T, D, D2, R > &lhs, const A &rhs)
 Addition element by element of matrix and a scalar C(i,j) = A(i,j) + s returning a matrix expression.
template<class A, class T, unsigned int D, unsigned int D2, class R>
Expr< BinaryOpCopyL< AddOp<
T >, Constant< A >, SMatrix<
T, D, D2, R >, T >, T, D,
D2, R > 
ROOT::Math::operator+ (const A &lhs, const SMatrix< T, D, D2, R > &rhs)
 Addition element by element of matrix and a scalar C(i,j) = s + A(i,j) returning a matrix expression.
template<class T, unsigned int D, unsigned int D2, class R1, class R2>
Expr< BinaryOp< MinOp< T >,
SMatrix< T, D, D2, R1 >,
SMatrix< T, D, D2, R2 >,
T >, T, D, D2, typename AddPolicy<
T, D, D2, R1, R2 >::RepType > 
ROOT::Math::operator- (const SMatrix< T, D, D2, R1 > &lhs, const SMatrix< T, D, D2, R2 > &rhs)
 Subtraction of two matrices C = A-B returning a matrix expression.
template<class A, class T, unsigned int D, unsigned int D2, class R>
Expr< BinaryOpCopyR< MinOp<
T >, SMatrix< T, D, D2, R >,
Constant< A >, T >, T, D,
D2, R > 
ROOT::Math::operator- (const SMatrix< T, D, D2, R > &lhs, const A &rhs)
 Subtraction of a scalar and a matrix (element wise) B(i,j) = A(i,j) - s returning a matrix expression.
template<class A, class T, unsigned int D, unsigned int D2, class R>
Expr< BinaryOpCopyL< MinOp<
T >, Constant< A >, SMatrix<
T, D, D2, R >, T >, T, D,
D2, R > 
ROOT::Math::operator- (const A &lhs, const SMatrix< T, D, D2, R > &rhs)
 Subtraction of a scalar and a matrix (element wise) B(i,j) = s - A(i,j) returning a matrix expression.
template<class T, unsigned int D, unsigned int D2, class R1, class R2>
Expr< BinaryOp< MulOp< T >,
SMatrix< T, D, D2, R1 >,
SMatrix< T, D, D2, R2 >,
T >, T, D, D2, typename AddPolicy<
T, D, D2, R1, R2 >::RepType > 
ROOT::Math::Times (const SMatrix< T, D, D2, R1 > &lhs, const SMatrix< T, D, D2, R2 > &rhs)
 Element by element matrix multiplication C(i,j) = A(i,j)*B(i,j) returning a matrix expression.
template<class A, class T, unsigned int D, unsigned int D2, class R>
Expr< BinaryOpCopyR< MulOp<
T >, SMatrix< T, D, D2, R >,
Constant< A >, T >, T, D,
D2, R > 
ROOT::Math::operator * (const SMatrix< T, D, D2, R > &lhs, const A &rhs)
 Multiplication (element wise) of a matrix and a scalar, B(i,j) = A(i,j) * s returning a matrix expression.
template<class A, class T, unsigned int D, unsigned int D2, class R>
Expr< BinaryOpCopyL< MulOp<
T >, Constant< A >, SMatrix<
T, D, D2, R >, T >, T, D,
D2, R > 
ROOT::Math::operator * (const A &lhs, const SMatrix< T, D, D2, R > &rhs)
 Multiplication (element wise) of a matrix and a scalar, B(i,j) = s * A(i,j) returning a matrix expression.
template<class T, unsigned int D, unsigned int D2, class R1, class R2>
Expr< BinaryOp< DivOp< T >,
SMatrix< T, D, D2, R1 >,
SMatrix< T, D, D2, R2 >,
T >, T, D, D2, typename AddPolicy<
T, D, D2, R1, R2 >::RepType > 
ROOT::Math::Div (const SMatrix< T, D, D2, R1 > &lhs, const SMatrix< T, D, D2, R2 > &rhs)
 Division (element wise) of two matrices of the same dimensions: C(i,j) = A(i,j) / B(i,j) returning a matrix expression.
template<class A, class T, unsigned int D, unsigned int D2, class R>
Expr< BinaryOpCopyR< DivOp<
T >, SMatrix< T, D, D2, R >,
Constant< A >, T >, T, D,
D2, R > 
ROOT::Math::operator/ (const SMatrix< T, D, D2, R > &lhs, const A &rhs)
 Division (element wise) of a matrix and a scalar, B(i,j) = A(i,j) / s returning a matrix expression.
template<class A, class T, unsigned int D, unsigned int D2, class R>
Expr< BinaryOpCopyL< DivOp<
T >, Constant< A >, SMatrix<
T, D, D2, R >, T >, T, D,
D2, R > 
ROOT::Math::operator/ (const A &lhs, const SMatrix< T, D, D2, R > &rhs)
 Division (element wise) of a matrix and a scalar, B(i,j) = s / A(i,j) returning a matrix expression.
template<class T, unsigned int D1, unsigned int D2, class R>
VecExpr< VectorMatrixRowOp<
SMatrix< T, D1, D2, R >,
SVector< T, D2 >, D2 >, T,
D1 > 
ROOT::Math::operator * (const SMatrix< T, D1, D2, R > &lhs, const SVector< T, D2 > &rhs)
 Matrix * Vector multiplication $ a(i) = \sum_{j} M(i,j) * b(j) $ returning a vector expression.
template<class T, unsigned int D1, unsigned int D, unsigned int D2, class R1, class R2>
Expr< MatrixMulOp< SMatrix<
T, D1, D, R1 >, SMatrix<
T, D, D2, R2 >, T, D >, T,
D1, D2, typename MultPolicy<
T, R1, R2 >::RepType > 
ROOT::Math::operator * (const SMatrix< T, D1, D, R1 > &lhs, const SMatrix< T, D, D2, R2 > &rhs)
 Matrix * Matrix multiplication , $ C(i,j) = \sum_{k} A(i,k) * B(k,j)$ returning a matrix expression.
template<class T, unsigned int D1, unsigned int D2, class R>
Expr< TransposeOp< SMatrix<
T, D1, D2, R >, T, D1, D2 >,
T, D2, D1, typename TranspPolicy<
T, D1, D2, R >::RepType > 
ROOT::Math::Transpose (const SMatrix< T, D1, D2, R > &rhs)
 Matrix Transpose B(i,j) = A(j,i) returning a matrix expression.
template<class T, unsigned int D, class R>
ROOT::Math::Similarity (const SMatrix< T, D, D, R > &lhs, const SVector< T, D > &rhs)
 Similarity Vector - Matrix Product: v^T * A * v returning a scalar value of type T $ s = \sum_{i,j} v(i) * A(i,j) * v(j)$.
template<class T, unsigned int D1, unsigned int D2, class R>
SMatrix< T, D1, D1, MatRepSym<
T, D1 > > 
ROOT::Math::Similarity (const SMatrix< T, D1, D2, R > &lhs, const SMatrix< T, D2, D2, MatRepSym< T, D2 > > &rhs)
 Similarity Matrix Product : B = U * A * U^T for A symmetric returning a symmetric matrix expression: $ B(i,j) = \sum_{k,l} U(i,k) * A(k,l) * U(j,l) $.
template<class T, unsigned int D1, unsigned int D2, class R>
SMatrix< T, D2, D2, MatRepSym<
T, D2 > > 
ROOT::Math::SimilarityT (const SMatrix< T, D1, D2, R > &lhs, const SMatrix< T, D1, D1, MatRepSym< T, D1 > > &rhs)
 Transpose Similarity Matrix Product : B = U^T * A * U for A symmetric returning a symmetric matrix expression: $ B(i,j) = \sum_{k,l} U(k,i) * A(k,l) * U(l,j) $.
template<class T, unsigned int D, unsigned int D2, class R>
Expr< UnaryOp< Minus< T >,
SMatrix< T, D, D2, R >, T >,
T, D, D2, R > 
ROOT::Math::operator- (const SMatrix< T, D, D2, R > &rhs)
 Unary - operator B = - A returning a matrix expression.
template<class T, unsigned int D, unsigned int D2, class R>
Expr< UnaryOp< Fabs< T >,
SMatrix< T, D, D2, R >, T >,
T, D, D2, R > 
ROOT::Math::fabs (const SMatrix< T, D, D2, R > &rhs)
 abs of a matrix m2(i,j) = | m1(i,j) | returning a matrix epression
template<class T, unsigned int D, unsigned int D2, class R>
Expr< UnaryOp< Sqr< T >, SMatrix<
T, D, D2, R >, T >, T, D,
D2, R > 
ROOT::Math::sqr (const SMatrix< T, D, D2, R > &rhs)
 square of a matrix B(i,j) = A(i,j)*A(i,j) returning a matrix expression
template<class T, unsigned int D, unsigned int D2, class R>
Expr< UnaryOp< Sqrt< T >,
SMatrix< T, D, D2, R >, T >,
T, D, D2, R > 
ROOT::Math::sqrt (const SMatrix< T, D, D2, R > &rhs)
 square root of a matrix (element by element) m2(i,j) = sqrt ( m1(i,j) ) returning a matrix expression

Detailed Description

These function apply to matrices (and also Matrix expression) and can return a matrix expression of a particular defined type, like in the matrix multiplication or a vector, like in the matrix-vector product or a scalar like in the Similarity vector-matrix product.


Function Documentation

template<class T, unsigned int D, unsigned int D2, class R1, class R2>
Expr<BinaryOp<DivOp<T>, SMatrix<T,D,D2,R1>, SMatrix<T,D,D2,R2>, T>, T, D, D2, typename AddPolicy<T,D,D2,R1,R2>::RepType> ROOT::Math::Div const SMatrix< T, D, D2, R1 > &  lhs,
const SMatrix< T, D, D2, R2 > &  rhs
[inline]
 

Division (element wise) of two matrices of the same dimensions: C(i,j) = A(i,j) / B(i,j) returning a matrix expression.

Definition at line 896 of file BinaryOperators.h.

template<class T, unsigned int D, unsigned int D2, class R>
Expr<UnaryOp<Fabs<T>, SMatrix<T,D,D2,R>, T>, T, D, D2, R> ROOT::Math::fabs const SMatrix< T, D, D2, R > &  rhs  )  [inline]
 

abs of a matrix m2(i,j) = | m1(i,j) | returning a matrix epression

Definition at line 176 of file UnaryOperators.h.

template<class T, unsigned int D1, unsigned int D, unsigned int D2, class R1, class R2>
Expr<MatrixMulOp<SMatrix<T,D1,D,R1>, SMatrix<T,D,D2,R2>,T,D>, T, D1, D2, typename MultPolicy<T,R1,R2>::RepType> ROOT::Math::operator * const SMatrix< T, D1, D, R1 > &  lhs,
const SMatrix< T, D, D2, R2 > &  rhs
[inline]
 

Matrix * Matrix multiplication , $ C(i,j) = \sum_{k} A(i,k) * B(k,j)$ returning a matrix expression.

Definition at line 364 of file MatrixFunctions.h.

template<class T, unsigned int D1, unsigned int D2, class R>
VecExpr<VectorMatrixRowOp<SMatrix<T,D1,D2,R>,SVector<T,D2>, D2>, T, D1> ROOT::Math::operator * const SMatrix< T, D1, D2, R > &  lhs,
const SVector< T, D2 > &  rhs
[inline]
 

Matrix * Vector multiplication $ a(i) = \sum_{j} M(i,j) * b(j) $ returning a vector expression.

Definition at line 189 of file MatrixFunctions.h.

template<class A, class T, unsigned int D, unsigned int D2, class R>
Expr<BinaryOpCopyL<MulOp<T>, Constant<A>, SMatrix<T,D,D2,R>, T>, T, D, D2, R> ROOT::Math::operator * const A &  lhs,
const SMatrix< T, D, D2, R > &  rhs
[inline]
 

Multiplication (element wise) of a matrix and a scalar, B(i,j) = s * A(i,j) returning a matrix expression.

Definition at line 725 of file BinaryOperators.h.

template<class A, class T, unsigned int D, unsigned int D2, class R>
Expr<BinaryOpCopyR<MulOp<T>, SMatrix<T,D,D2,R>, Constant<A>, T>, T, D, D2, R> ROOT::Math::operator * const SMatrix< T, D, D2, R > &  lhs,
const A &  rhs
[inline]
 

Multiplication (element wise) of a matrix and a scalar, B(i,j) = A(i,j) * s returning a matrix expression.

Definition at line 707 of file BinaryOperators.h.

template<class A, class T, unsigned int D, unsigned int D2, class R>
Expr<BinaryOpCopyL<AddOp<T>, Constant<A>, SMatrix<T,D,D2,R>, T>, T, D, D2, R> ROOT::Math::operator+ const A &  lhs,
const SMatrix< T, D, D2, R > &  rhs
[inline]
 

Addition element by element of matrix and a scalar C(i,j) = s + A(i,j) returning a matrix expression.

Definition at line 246 of file BinaryOperators.h.

template<class A, class T, unsigned int D, unsigned int D2, class R>
Expr<BinaryOpCopyR<AddOp<T>, SMatrix<T,D,D2,R>, Constant<A>, T>, T, D, D2, R> ROOT::Math::operator+ const SMatrix< T, D, D2, R > &  lhs,
const A &  rhs
[inline]
 

Addition element by element of matrix and a scalar C(i,j) = A(i,j) + s returning a matrix expression.

Definition at line 229 of file BinaryOperators.h.

template<class T, unsigned int D, unsigned int D2, class R1, class R2>
Expr<BinaryOp<AddOp<T>, SMatrix<T,D,D2,R1>, SMatrix<T,D,D2,R2>, T>, T, D, D2, typename AddPolicy<T,D,D2,R1,R2>::RepType > ROOT::Math::operator+ const SMatrix< T, D, D2, R1 > &  lhs,
const SMatrix< T, D, D2, R2 > &  rhs
[inline]
 

Addition of two matrices C = A+B returning a matrix expression.

Definition at line 175 of file BinaryOperators.h.

template<class T, unsigned int D, unsigned int D2, class R>
Expr<UnaryOp<Minus<T>, SMatrix<T,D,D2,R>, T>, T, D, D2,R> ROOT::Math::operator- const SMatrix< T, D, D2, R > &  rhs  )  [inline]
 

Unary - operator B = - A returning a matrix expression.

Definition at line 101 of file UnaryOperators.h.

template<class A, class T, unsigned int D, unsigned int D2, class R>
Expr<BinaryOpCopyL<MinOp<T>, Constant<A>, SMatrix<T,D,D2,R>, T>, T, D, D2, R> ROOT::Math::operator- const A &  lhs,
const SMatrix< T, D, D2, R > &  rhs
[inline]
 

Subtraction of a scalar and a matrix (element wise) B(i,j) = s - A(i,j) returning a matrix expression.

Definition at line 491 of file BinaryOperators.h.

template<class A, class T, unsigned int D, unsigned int D2, class R>
Expr<BinaryOpCopyR<MinOp<T>, SMatrix<T,D,D2,R>, Constant<A>, T>, T, D, D2, R> ROOT::Math::operator- const SMatrix< T, D, D2, R > &  lhs,
const A &  rhs
[inline]
 

Subtraction of a scalar and a matrix (element wise) B(i,j) = A(i,j) - s returning a matrix expression.

Definition at line 473 of file BinaryOperators.h.

template<class T, unsigned int D, unsigned int D2, class R1, class R2>
Expr<BinaryOp<MinOp<T>, SMatrix<T,D,D2,R1>, SMatrix<T,D,D2,R2>, T>, T, D, D2, typename AddPolicy<T,D,D2,R1,R2>::RepType> ROOT::Math::operator- const SMatrix< T, D, D2, R1 > &  lhs,
const SMatrix< T, D, D2, R2 > &  rhs
[inline]
 

Subtraction of two matrices C = A-B returning a matrix expression.

Definition at line 419 of file BinaryOperators.h.

template<class A, class T, unsigned int D, unsigned int D2, class R>
Expr<BinaryOpCopyL<DivOp<T>, Constant<A>, SMatrix<T,D,D2,R>, T>, T, D, D2, R> ROOT::Math::operator/ const A &  lhs,
const SMatrix< T, D, D2, R > &  rhs
[inline]
 

Division (element wise) of a matrix and a scalar, B(i,j) = s / A(i,j) returning a matrix expression.

Definition at line 968 of file BinaryOperators.h.

template<class A, class T, unsigned int D, unsigned int D2, class R>
Expr<BinaryOpCopyR<DivOp<T>, SMatrix<T,D,D2,R>, Constant<A>, T>, T, D, D2, R> ROOT::Math::operator/ const SMatrix< T, D, D2, R > &  lhs,
const A &  rhs
[inline]
 

Division (element wise) of a matrix and a scalar, B(i,j) = A(i,j) / s returning a matrix expression.

Definition at line 950 of file BinaryOperators.h.

template<class T, unsigned int D1, unsigned int D2, class R>
SMatrix<T,D1,D1,MatRepSym<T,D1> > ROOT::Math::Similarity const SMatrix< T, D1, D2, R > &  lhs,
const SMatrix< T, D2, D2, MatRepSym< T, D2 > > &  rhs
[inline]
 

Similarity Matrix Product : B = U * A * U^T for A symmetric returning a symmetric matrix expression: $ B(i,j) = \sum_{k,l} U(i,k) * A(k,l) * U(j,l) $.

Definition at line 714 of file MatrixFunctions.h.

References ROOT::Math::Transpose().

template<class T, unsigned int D, class R>
T ROOT::Math::Similarity const SMatrix< T, D, D, R > &  lhs,
const SVector< T, D > &  rhs
[inline]
 

Similarity Vector - Matrix Product: v^T * A * v returning a scalar value of type T $ s = \sum_{i,j} v(i) * A(i,j) * v(j)$.

Definition at line 641 of file MatrixFunctions.h.

References ROOT::Math::Dot().

template<class T, unsigned int D1, unsigned int D2, class R>
SMatrix<T,D2,D2,MatRepSym<T,D2> > ROOT::Math::SimilarityT const SMatrix< T, D1, D2, R > &  lhs,
const SMatrix< T, D1, D1, MatRepSym< T, D1 > > &  rhs
[inline]
 

Transpose Similarity Matrix Product : B = U^T * A * U for A symmetric returning a symmetric matrix expression: $ B(i,j) = \sum_{k,l} U(k,i) * A(k,l) * U(l,j) $.

Definition at line 764 of file MatrixFunctions.h.

References ROOT::Math::Transpose().

template<class T, unsigned int D, unsigned int D2, class R>
Expr<UnaryOp<Sqr<T>, SMatrix<T,D,D2,R>, T>, T, D, D2, R> ROOT::Math::sqr const SMatrix< T, D, D2, R > &  rhs  )  [inline]
 

square of a matrix B(i,j) = A(i,j)*A(i,j) returning a matrix expression

Definition at line 251 of file UnaryOperators.h.

template<class T, unsigned int D, unsigned int D2, class R>
Expr<UnaryOp<Sqrt<T>, SMatrix<T,D,D2,R>, T>, T, D, D2, R> ROOT::Math::sqrt const SMatrix< T, D, D2, R > &  rhs  )  [inline]
 

square root of a matrix (element by element) m2(i,j) = sqrt ( m1(i,j) ) returning a matrix expression

Definition at line 325 of file UnaryOperators.h.

template<class T, unsigned int D, unsigned int D2, class R1, class R2>
Expr<BinaryOp<MulOp<T>, SMatrix<T,D,D2,R1>, SMatrix<T,D,D2,R2>, T>, T, D, D2, typename AddPolicy<T,D,D2,R1,R2>::RepType> ROOT::Math::Times const SMatrix< T, D, D2, R1 > &  lhs,
const SMatrix< T, D, D2, R2 > &  rhs
[inline]
 

Element by element matrix multiplication C(i,j) = A(i,j)*B(i,j) returning a matrix expression.

This is not a matrix-matrix multiplication and works only for matrices of the same dimensions.

Definition at line 653 of file BinaryOperators.h.

template<class T, unsigned int D1, unsigned int D2, class R>
Expr<TransposeOp<SMatrix<T,D1,D2,R>,T,D1,D2>, T, D2, D1, typename TranspPolicy<T,D1,D2,R>::RepType> ROOT::Math::Transpose const SMatrix< T, D1, D2, R > &  rhs  )  [inline]
 

Matrix Transpose B(i,j) = A(j,i) returning a matrix expression.

Definition at line 516 of file MatrixFunctions.h.

Referenced by ROOT::Math::Similarity(), and ROOT::Math::SimilarityT().


Generated on Fri Jun 29 11:35:50 2007 for SMatrix by  doxygen 1.4.6