Eigen::internal::transposition_matrix_product< ExpressionType, Side, Transposed, ExpressionShape > Class Template Reference

#include <ProductEvaluators.h>

Public Types

typedef nested_eval< ExpressionType, 1 >::type MatrixType
 
typedef remove_all_t< MatrixTypeMatrixTypeCleaned
 

Static Public Member Functions

template<typename Dest , typename TranspositionType >
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void run (Dest &dst, const TranspositionType &tr, const ExpressionType &xpr)
 

Detailed Description

template<typename ExpressionType, int Side, bool Transposed, typename ExpressionShape>
class Eigen::internal::transposition_matrix_product< ExpressionType, Side, Transposed, ExpressionShape >

Internal helper class implementing the product between a permutation matrix and a matrix.

Member Typedef Documentation

◆ MatrixType

template<typename ExpressionType , int Side, bool Transposed, typename ExpressionShape >
typedef nested_eval<ExpressionType, 1>::type Eigen::internal::transposition_matrix_product< ExpressionType, Side, Transposed, ExpressionShape >::MatrixType

◆ MatrixTypeCleaned

template<typename ExpressionType , int Side, bool Transposed, typename ExpressionShape >
typedef remove_all_t<MatrixType> Eigen::internal::transposition_matrix_product< ExpressionType, Side, Transposed, ExpressionShape >::MatrixTypeCleaned

Member Function Documentation

◆ run()

template<typename ExpressionType , int Side, bool Transposed, typename ExpressionShape >
template<typename Dest , typename TranspositionType >
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void Eigen::internal::transposition_matrix_product< ExpressionType, Side, Transposed, ExpressionShape >::run ( Dest &  dst,
const TranspositionType &  tr,
const ExpressionType &  xpr 
)
inlinestatic
1071  {
1072  MatrixType mat(xpr);
1073  typedef typename TranspositionType::StorageIndex StorageIndex;
1074  const Index size = tr.size();
1075  StorageIndex j = 0;
1076 
1077  if (!is_same_dense(dst, mat)) dst = mat;
1078 
1079  for (Index k = (Transposed ? size - 1 : 0); Transposed ? k >= 0 : k < size; Transposed ? --k : ++k)
1080  if (Index(j = tr.coeff(k)) != k) {
1081  if (Side == OnTheLeft)
1082  dst.row(k).swap(dst.row(j));
1083  else if (Side == OnTheRight)
1084  dst.col(k).swap(dst.col(j));
1085  }
1086  }
Eigen::SparseMatrix< double > mat
Definition: EigenUnitTest.cpp:10
Side
Definition: Side.h:9
Scalar Scalar int size
Definition: benchVecAdd.cpp:17
MatrixXf MatrixType
Definition: benchmark-blocking-sizes.cpp:52
void swap(SparseMatrix &other)
Definition: SparseMatrix.h:829
@ OnTheLeft
Definition: Constants.h:331
@ OnTheRight
Definition: Constants.h:333
char char char int int * k
Definition: level2_impl.h:374
EIGEN_DEVICE_FUNC bool is_same_dense(const T1 &mat1, const T2 &mat2, std::enable_if_t< possibly_same_dense< T1, T2 >::value > *=0)
Definition: XprHelper.h:869
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:83
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2

References Eigen::internal::is_same_dense(), j, k, Eigen::OnTheLeft, Eigen::OnTheRight, size, and Eigen::SparseMatrix< Scalar_, Options_, StorageIndex_ >::swap().

Referenced by Eigen::internal::generic_product_impl< Lhs, Rhs, TranspositionsShape, MatrixShape, ProductTag >::evalTo(), Eigen::internal::generic_product_impl< Lhs, Rhs, MatrixShape, TranspositionsShape, ProductTag >::evalTo(), Eigen::internal::generic_product_impl< Lhs, Transpose< Rhs >, MatrixShape, TranspositionsShape, ProductTag >::evalTo(), and Eigen::internal::generic_product_impl< Transpose< Lhs >, Rhs, TranspositionsShape, MatrixShape, ProductTag >::evalTo().


The documentation for this class was generated from the following file: