11 #ifndef EIGEN_PERMUTATIONMATRIX_H
12 #define EIGEN_PERMUTATIONMATRIX_H
48 template <
typename Derived>
54 #ifndef EIGEN_PARSED_BY_DOXYGEN
75 template <
typename OtherDerived>
82 template <
typename OtherDerived>
98 #ifndef EIGEN_PARSED_BY_DOXYGEN
99 template <
typename DenseDerived>
181 #ifndef EIGEN_PARSED_BY_DOXYGEN
183 template <
typename OtherDerived>
187 template <
typename Lhs,
typename Rhs>
190 for (
Index i = 0;
i <
rows(); ++
i)
indices().coeffRef(
i) = lhs.indices().coeff(rhs.indices().coeff(
i));
199 template <
typename Other>
208 template <
typename Other>
217 template <
typename Other>
236 while (
r <
n && mask[
r])
r++;
253 template <
int SizeAtCompileTime,
int MaxSizeAtCompileTime,
typename StorageIndex_>
256 Matrix<StorageIndex_, SizeAtCompileTime, SizeAtCompileTime, 0, MaxSizeAtCompileTime, MaxSizeAtCompileTime> > {
278 template <
int SizeAtCompileTime,
int MaxSizeAtCompileTime,
typename StorageIndex_>
280 :
public PermutationBase<PermutationMatrix<SizeAtCompileTime, MaxSizeAtCompileTime, StorageIndex_> > {
287 #ifndef EIGEN_PARSED_BY_DOXYGEN
301 template <
typename OtherDerived>
311 template <
typename Other>
315 template <
typename Other>
321 template <
typename Other>
328 template <
typename Other>
340 #ifndef EIGEN_PARSED_BY_DOXYGEN
341 template <
typename Other>
347 m_indices.coeffRef(other.derived().nestedExpression().indices().
coeff(
i)) =
i;
349 template <
typename Lhs,
typename Rhs>
360 template <
int SizeAtCompileTime,
int MaxSizeAtCompileTime,
typename StorageIndex_,
int PacketAccess_>
363 Matrix<StorageIndex_, SizeAtCompileTime, SizeAtCompileTime, 0, MaxSizeAtCompileTime, MaxSizeAtCompileTime> > {
371 template <
int SizeAtCompileTime,
int MaxSizeAtCompileTime,
typename StorageIndex_,
int PacketAccess_>
374 Map<PermutationMatrix<SizeAtCompileTime, MaxSizeAtCompileTime, StorageIndex_>, PacketAccess_> > {
379 #ifndef EIGEN_PARSED_BY_DOXYGEN
389 template <
typename Other>
391 return Base::operator=(other.
derived());
395 template <
typename Other>
397 return Base::operator=(tr.
derived());
400 #ifndef EIGEN_PARSED_BY_DOXYGEN
405 m_indices = other.m_indices;
419 template <
typename IndicesType_>
422 template <
typename IndicesType_>
429 RowsAtCompileTime = IndicesType_::SizeAtCompileTime,
430 ColsAtCompileTime = IndicesType_::SizeAtCompileTime,
431 MaxRowsAtCompileTime = IndicesType::MaxSizeAtCompileTime,
432 MaxColsAtCompileTime = IndicesType::MaxSizeAtCompileTime,
449 template <
typename IndicesType_>
455 #ifndef EIGEN_PARSED_BY_DOXYGEN
470 template <
typename MatrixDerived,
typename PermutationDerived>
478 template <
typename PermutationDerived,
typename MatrixDerived>
484 template <
typename PermutationType>
496 #ifndef EIGEN_PARSED_BY_DOXYGEN
499 RowsAtCompileTime = PermTraits::RowsAtCompileTime,
500 ColsAtCompileTime = PermTraits::ColsAtCompileTime,
501 MaxRowsAtCompileTime = PermTraits::MaxRowsAtCompileTime,
502 MaxColsAtCompileTime = PermTraits::MaxColsAtCompileTime
506 #ifndef EIGEN_PARSED_BY_DOXYGEN
507 template <
typename DenseDerived>
510 for (
Index i = 0;
i < derived().rows(); ++
i)
522 template <
typename OtherDerived>
530 template <
typename OtherDerived>
536 template <
typename Derived>
int i
Definition: BiCGSTAB_step_by_step.cpp:9
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
#define eigen_internal_assert(x)
Definition: Macros.h:916
#define EIGEN_DEVICE_FUNC
Definition: Macros.h:892
#define eigen_assert(x)
Definition: Macros.h:910
cout<< "Here is the matrix m:"<< endl<< m<< endl;Matrix< ptrdiff_t, 3, 1 > res
Definition: PartialRedux_count.cpp:3
Scalar Scalar int size
Definition: benchVecAdd.cpp:17
SCALAR Scalar
Definition: bench_gemm.cpp:45
EIGEN_DEVICE_FUNC Derived & setZero()
Definition: CwiseNullaryOp.h:554
void evalTo(MatrixBase< DenseDerived > &other) const
Definition: PermutationMatrix.h:508
DenseMatrixType toDenseMatrix() const
Definition: PermutationMatrix.h:518
friend const Product< OtherDerived, InverseType, AliasFreeProduct > operator*(const MatrixBase< OtherDerived > &matrix, const InverseType &trPerm)
Definition: PermutationMatrix.h:523
InverseImpl()
Definition: PermutationMatrix.h:490
PermutationType::DenseMatrixType DenseMatrixType
Definition: PermutationMatrix.h:497
PlainPermutationType eval() const
Definition: PermutationMatrix.h:516
Inverse< PermutationType > InverseType
Definition: PermutationMatrix.h:493
internal::traits< PermutationType > PermTraits
Definition: PermutationMatrix.h:487
const Product< InverseType, OtherDerived, AliasFreeProduct > operator*(const MatrixBase< OtherDerived > &matrix) const
Definition: PermutationMatrix.h:531
PermutationType::PlainPermutationType PlainPermutationType
Definition: PermutationMatrix.h:486
Scalar coeff(Index row, Index col) const
Expression of the inverse of another expression.
Definition: Inverse.h:43
PermutationBase< Map > Base
Definition: PermutationMatrix.h:375
IndicesType::Scalar StorageIndex
Definition: PermutationMatrix.h:381
IndicesType & indices()
Definition: PermutationMatrix.h:413
Map(const StorageIndex *indicesPtr, Index size)
Definition: PermutationMatrix.h:386
Map & operator=(const PermutationBase< Other > &other)
Definition: PermutationMatrix.h:390
Map & operator=(const Map &other)
Definition: PermutationMatrix.h:404
Map(const StorageIndex *indicesPtr)
Definition: PermutationMatrix.h:384
Traits::IndicesType IndicesType
Definition: PermutationMatrix.h:380
internal::traits< Map > Traits
Definition: PermutationMatrix.h:376
Map & operator=(const TranspositionsBase< Other > &tr)
Definition: PermutationMatrix.h:396
IndicesType m_indices
Definition: PermutationMatrix.h:416
const IndicesType & indices() const
Definition: PermutationMatrix.h:411
A matrix or vector expression mapping an existing array of data.
Definition: Map.h:96
Base class for all dense matrices, vectors, and expressions.
Definition: MatrixBase.h:52
const PermutationWrapper< const Derived > asPermutation() const
Definition: PermutationMatrix.h:537
The matrix class, also used for vectors and row-vectors.
Definition: Eigen/Eigen/src/Core/Matrix.h:186
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Scalar & coeffRef(Index rowId, Index colId)
Definition: PlainObjectBase.h:217
Base class for permutations.
Definition: PermutationMatrix.h:49
InverseReturnType transpose() const
Definition: PermutationMatrix.h:177
void assignProduct(const Lhs &lhs, const Rhs &rhs)
Definition: PermutationMatrix.h:188
void resize(Index newSize)
Definition: PermutationMatrix.h:119
Traits::IndicesType IndicesType
Definition: PermutationMatrix.h:55
EIGEN_DEVICE_FUNC Index rows() const
Definition: PermutationMatrix.h:90
Traits::StorageIndex StorageIndex
Definition: PermutationMatrix.h:63
IndicesType & indices()
Definition: PermutationMatrix.h:115
PlainPermutationType PlainObject
Definition: PermutationMatrix.h:68
constexpr EIGEN_DEVICE_FUNC Derived & derived()
Definition: EigenBase.h:49
EIGEN_DEVICE_FUNC Index cols() const
Definition: PermutationMatrix.h:93
Index determinant() const
Definition: PermutationMatrix.h:228
PermutationMatrix< IndicesType::SizeAtCompileTime, IndicesType::MaxSizeAtCompileTime, StorageIndex > PlainPermutationType
Definition: PermutationMatrix.h:67
Inverse< Derived > InverseReturnType
Definition: PermutationMatrix.h:70
EIGEN_DEVICE_FUNC Index size() const
Definition: PermutationMatrix.h:96
Matrix< StorageIndex, RowsAtCompileTime, ColsAtCompileTime, 0, MaxRowsAtCompileTime, MaxColsAtCompileTime > DenseMatrixType
Definition: PermutationMatrix.h:65
friend PlainPermutationType operator*(const InverseImpl< Other, PermutationStorage > &other, const PermutationBase &perm)
Definition: PermutationMatrix.h:218
Derived & applyTranspositionOnTheLeft(Index i, Index j)
Definition: PermutationMatrix.h:143
Derived & applyTranspositionOnTheRight(Index i, Index j)
Definition: PermutationMatrix.h:162
void setIdentity()
Definition: PermutationMatrix.h:122
@ MaxRowsAtCompileTime
Definition: PermutationMatrix.h:60
@ RowsAtCompileTime
Definition: PermutationMatrix.h:58
@ MaxColsAtCompileTime
Definition: PermutationMatrix.h:61
@ ColsAtCompileTime
Definition: PermutationMatrix.h:59
void evalTo(MatrixBase< DenseDerived > &other) const
Definition: PermutationMatrix.h:100
void Scalar
Definition: PermutationMatrix.h:71
void setIdentity(Index newSize)
Definition: PermutationMatrix.h:129
PlainPermutationType operator*(const InverseImpl< Other, PermutationStorage > &other) const
Definition: PermutationMatrix.h:209
Derived & operator=(const PermutationBase< OtherDerived > &other)
Definition: PermutationMatrix.h:76
EigenBase< Derived > Base
Definition: PermutationMatrix.h:51
internal::traits< Derived > Traits
Definition: PermutationMatrix.h:50
Derived & operator=(const TranspositionsBase< OtherDerived > &tr)
Definition: PermutationMatrix.h:83
InverseReturnType inverse() const
Definition: PermutationMatrix.h:172
DenseMatrixType toDenseMatrix() const
Definition: PermutationMatrix.h:110
const IndicesType & indices() const
Definition: PermutationMatrix.h:113
PlainPermutationType operator*(const PermutationBase< Other > &other) const
Definition: PermutationMatrix.h:200
void assignTranspose(const PermutationBase< OtherDerived > &other)
Definition: PermutationMatrix.h:184
Permutation matrix.
Definition: PermutationMatrix.h:280
Traits::IndicesType IndicesType
Definition: PermutationMatrix.h:288
PermutationMatrix & operator=(const TranspositionsBase< Other > &tr)
Definition: PermutationMatrix.h:329
PermutationMatrix(const PermutationBase< OtherDerived > &other)
Definition: PermutationMatrix.h:302
PermutationMatrix(const TranspositionsBase< Other > &tr)
Definition: PermutationMatrix.h:316
PermutationMatrix(const InverseImpl< Other, PermutationStorage > &other)
Definition: PermutationMatrix.h:342
internal::traits< PermutationMatrix > Traits
Definition: PermutationMatrix.h:282
const IndicesType & indices() const
Definition: PermutationMatrix.h:334
IndicesType & indices()
Definition: PermutationMatrix.h:336
PermutationMatrix()
Definition: PermutationMatrix.h:292
IndicesType m_indices
Definition: PermutationMatrix.h:356
PermutationMatrix(const MatrixBase< Other > &indices)
Definition: PermutationMatrix.h:312
const PermutationMatrix & Nested
Definition: PermutationMatrix.h:285
PermutationMatrix(Index size)
Definition: PermutationMatrix.h:296
PermutationMatrix(internal::PermPermProduct_t, const Lhs &lhs, const Rhs &rhs)
Definition: PermutationMatrix.h:350
Traits::StorageIndex StorageIndex
Definition: PermutationMatrix.h:289
PermutationMatrix & operator=(const PermutationBase< Other > &other)
Definition: PermutationMatrix.h:322
PermutationBase< PermutationMatrix > Base
Definition: PermutationMatrix.h:281
Class to view a vector of integers as a permutation matrix.
Definition: PermutationMatrix.h:450
PermutationWrapper(const IndicesType &indices)
Definition: PermutationMatrix.h:459
Traits::IndicesType IndicesType
Definition: PermutationMatrix.h:456
PermutationBase< PermutationWrapper > Base
Definition: PermutationMatrix.h:451
const internal::remove_all_t< typename IndicesType::Nested > & indices() const
Definition: PermutationMatrix.h:462
IndicesType::Nested m_indices
Definition: PermutationMatrix.h:465
internal::traits< PermutationWrapper > Traits
Definition: PermutationMatrix.h:452
Expression of the product of two arbitrary matrices or vectors.
Definition: Product.h:202
Definition: Transpositions.h:19
EIGEN_DEVICE_FUNC const StorageIndex & coeff(Index i) const
Definition: Transpositions.h:45
EIGEN_DEVICE_FUNC Index size() const
Definition: Transpositions.h:38
EIGEN_DEVICE_FUNC Derived & derived()
Definition: Transpositions.h:27
Definition: Transpositions.h:237
Eigen::Map< Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic, Eigen::ColMajor >, 0, Eigen::OuterStride<> > matrix(T *data, int rows, int cols, int stride)
Definition: common.h:85
static constexpr lastp1_t end
Definition: IndexedViewHelper.h:79
EIGEN_BLAS_FUNC() swap(int *n, RealScalar *px, int *incx, RealScalar *py, int *incy)
Definition: level1_impl.h:117
char char char int int * k
Definition: level2_impl.h:374
@ Lhs
Definition: TensorContractionMapper.h:20
@ Rhs
Definition: TensorContractionMapper.h:20
PermPermProduct_t
Definition: PermutationMatrix.h:21
@ PermPermProduct
Definition: PermutationMatrix.h:21
typename remove_all< T >::type remove_all_t
Definition: Meta.h:142
Namespace containing all symbols from the Eigen library.
Definition: bench_norm.cpp:70
EIGEN_DEVICE_FUNC const Product< MatrixDerived, PermutationDerived, AliasFreeProduct > operator*(const MatrixBase< MatrixDerived > &matrix, const PermutationBase< PermutationDerived > &permutation)
Definition: PermutationMatrix.h:471
Extend namespace for flags.
Definition: fsi_chan_precond_driver.cc:56
Definition: Eigen_Colamd.h:49
Definition: Constants.h:540
Definition: EigenBase.h:33
constexpr EIGEN_DEVICE_FUNC Derived & derived()
Definition: EigenBase.h:49
Eigen::Index Index
The interface type of indices.
Definition: EigenBase.h:43
Holds information about the various numeric (i.e. scalar) types allowed by Eigen.
Definition: NumTraits.h:217
Definition: Constants.h:564
Definition: Constants.h:528
EigenBase2EigenBase Kind
Definition: PermutationMatrix.h:545
Definition: AssignEvaluator.h:760
Definition: AssignEvaluator.h:757
PermutationStorage StorageKind
Definition: PermutationMatrix.h:364
Map< const Matrix< StorageIndex_, SizeAtCompileTime, 1, 0, MaxSizeAtCompileTime, 1 >, PacketAccess_ > IndicesType
Definition: PermutationMatrix.h:365
StorageIndex_ StorageIndex
Definition: PermutationMatrix.h:366
void Scalar
Definition: PermutationMatrix.h:367
PermutationStorage StorageKind
Definition: PermutationMatrix.h:257
Matrix< StorageIndex_, SizeAtCompileTime, 1, 0, MaxSizeAtCompileTime, 1 > IndicesType
Definition: PermutationMatrix.h:258
StorageIndex_ StorageIndex
Definition: PermutationMatrix.h:259
void Scalar
Definition: PermutationMatrix.h:260
IndicesType_::Scalar StorageIndex
Definition: PermutationMatrix.h:426
void Scalar
Definition: PermutationMatrix.h:425
PermutationStorage StorageKind
Definition: PermutationMatrix.h:424
IndicesType_ IndicesType
Definition: PermutationMatrix.h:427
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2