10 #ifndef EIGEN_SPARSE_PERMUTATION_H 11 #define EIGEN_SPARSE_PERMUTATION_H 19 template<
typename ExpressionType,
int S
ide,
bool Transposed>
37 template<
typename Dest,
typename PermutationType>
38 static inline void run(Dest& dst,
const PermutationType&
perm,
const ExpressionType& xpr)
43 SparseMatrix<Scalar,SrcStorageOrder,StorageIndex> tmp(mat.rows(), mat.cols());
45 for(
Index j=0;
j<mat.outerSize(); ++
j)
47 Index jp = perm.indices().coeff(
j);
48 sizes[((Side==
OnTheLeft) ^ Transposed) ? jp :
j] = StorageIndex(mat.innerVector(((Side==
OnTheRight) ^ Transposed) ? jp :
j).nonZeros());
51 for(
Index j=0;
j<mat.outerSize(); ++
j)
53 Index jp = perm.indices().coeff(
j);
56 for(
typename MatrixTypeCleaned::InnerIterator it(mat,jsrc); it; ++it)
57 tmp.insertByOuterInner(jdst,it.index()) = it.value();
72 for(
Index j=0;
j<mat.outerSize(); ++
j)
73 for(
typename MatrixTypeCleaned::InnerIterator it(mat,
j); it; ++it)
76 for(
Index j=0;
j<mat.outerSize(); ++
j)
77 for(
typename MatrixTypeCleaned::InnerIterator it(mat,
j); it; ++it)
78 tmp.insertByOuterInner(perm_cpy.
indices().coeff(it.index()),
j) = it.value();
95 template<
typename Lhs,
typename Rhs,
int ProductTag>
97 :
public evaluator<typename permutation_matrix_product<Rhs,OnTheLeft,false,SparseShape>::ReturnType>
110 ::new (static_cast<Base*>(
this)) Base(m_result);
118 template<
typename Lhs,
typename Rhs,
int ProductTag>
120 :
public evaluator<typename permutation_matrix_product<Lhs,OnTheRight,false,SparseShape>::ReturnType>
133 ::new (static_cast<Base*>(
this)) Base(m_result);
145 template<
typename SparseDerived,
typename PermDerived>
152 template<
typename SparseDerived,
typename PermDerived>
160 template<
typename SparseDerived,
typename PermutationType>
169 template<
typename SparseDerived,
typename PermutationType>
178 #endif // EIGEN_SPARSE_SELFADJOINTVIEW_H static void run(Dest &dst, const PermutationType &perm, const ExpressionType &xpr)
Expression of the product of two arbitrary matrices or vectors.
A versatible sparse matrix representation.
evaluator< PlainObject > Base
internal::conditional< MoveOuter, SparseMatrix< Scalar, SrcStorageOrder, StorageIndex >, SparseMatrix< Scalar, int(SrcStorageOrder)==RowMajor?ColMajor:RowMajor, StorageIndex > >::type ReturnType
std::vector< Array2i > sizes
Namespace containing all symbols from the Eigen library.
nested_eval< ExpressionType, 1 >::type MatrixType
const unsigned int RowMajorBit
Base class for permutations.
permutation_matrix_product< Lhs, OnTheRight, false, SparseShape >::ReturnType PlainObject
remove_all< MatrixType >::type MatrixTypeCleaned
EIGEN_DEVICE_FUNC const LhsNestedCleaned & lhs() const
product_evaluator(const XprType &xpr)
Base class of any sparse matrices or sparse expressions.
MatrixTypeCleaned::Scalar Scalar
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
idx_t idx_t idx_t idx_t idx_t * perm
InverseReturnType transpose() const
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorUInt128< uint64_t, uint64_t > operator*(const TensorUInt128< HL, LL > &lhs, const TensorUInt128< HR, LR > &rhs)
evaluator< PlainObject > Base
const Derived & derived() const
const IndicesType & indices() const
Product< Lhs, Rhs, AliasFreeProduct > XprType
const unsigned int EvalBeforeNestingBit
Map< Matrix< T, Dynamic, Dynamic, ColMajor >, 0, OuterStride<> > matrix(T *data, int rows, int cols, int stride)
MatrixTypeCleaned::StorageIndex StorageIndex
EIGEN_DEVICE_FUNC const RhsNestedCleaned & rhs() const
product_evaluator(const XprType &xpr)
EIGEN_DEVICE_FUNC Derived & derived()
Product< Lhs, Rhs, AliasFreeProduct > XprType
permutation_matrix_product< Rhs, OnTheLeft, false, SparseShape >::ReturnType PlainObject