10#ifndef EIGEN_TRANSPOSITIONS_H
11#define EIGEN_TRANSPOSITIONS_H
15template<
typename Derived>
22 typedef typename Traits::IndicesType IndicesType;
23 typedef typename IndicesType::Scalar StorageIndex;
27 Derived& derived() {
return *
static_cast<Derived*
>(
this); }
29 const Derived& derived()
const {
return *
static_cast<const Derived*
>(
this); }
32 template<
typename OtherDerived>
65 const IndicesType&
indices()
const {
return derived().indices(); }
68 IndicesType&
indices() {
return derived().indices(); }
79 for(StorageIndex i = 0; i <
indices().size(); ++i)
116template<
int SizeAtCompileTime,
int MaxSizeAtCompileTime,
typename _StorageIndex>
118 :
traits<PermutationMatrix<SizeAtCompileTime,MaxSizeAtCompileTime,_StorageIndex> >
154template<
int SizeAtCompileTime,
int MaxSizeAtCompileTime,
typename _StorageIndex>
161 typedef typename Traits::IndicesType IndicesType;
162 typedef typename IndicesType::Scalar StorageIndex;
167 template<
typename OtherDerived>
169 : m_indices(other.
indices()) {}
172 template<
typename Other>
177 template<
typename OtherDerived>
190 const IndicesType&
indices()
const {
return m_indices; }
197 IndicesType m_indices;
202template<
int SizeAtCompileTime,
int MaxSizeAtCompileTime,
typename _StorageIndex,
int _PacketAccess>
204 :
traits<PermutationMatrix<SizeAtCompileTime,MaxSizeAtCompileTime,_StorageIndex> >
207 typedef _StorageIndex StorageIndex;
212template<
int SizeAtCompileTime,
int MaxSizeAtCompileTime,
typename _StorageIndex,
int PacketAccess>
214 :
public TranspositionsBase<Map<Transpositions<SizeAtCompileTime,MaxSizeAtCompileTime,_StorageIndex>,PacketAccess> >
220 typedef typename Traits::IndicesType IndicesType;
221 typedef typename IndicesType::Scalar StorageIndex;
232 template<
typename OtherDerived>
238 #ifndef EIGEN_PARSED_BY_DOXYGEN
244 m_indices = other.m_indices;
251 const IndicesType&
indices()
const {
return m_indices; }
259 IndicesType m_indices;
263template<
typename _IndicesType>
265 :
traits<PermutationWrapper<_IndicesType> >
271template<
typename _IndicesType>
279 typedef typename Traits::IndicesType IndicesType;
280 typedef typename IndicesType::Scalar StorageIndex;
287 template<
typename OtherDerived>
295 const IndicesType&
indices()
const {
return m_indices; }
303 typename IndicesType::Nested m_indices;
310template<
typename MatrixDerived,
typename TranspositionsDerived>
312const Product<MatrixDerived, TranspositionsDerived, AliasFreeProduct>
322template<
typename TranspositionsDerived,
typename MatrixDerived>
324const Product<TranspositionsDerived, MatrixDerived, AliasFreeProduct>
336template<
typename Derived>
343template<
typename TranspositionsDerived>
347 typedef typename TranspositionType::IndicesType IndicesType;
350 explicit Transpose(
const TranspositionType& t) : m_transpositions(t) {}
352 EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
353 Index size()
const EIGEN_NOEXCEPT {
return m_transpositions.size(); }
354 EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
355 Index rows()
const EIGEN_NOEXCEPT {
return m_transpositions.size(); }
356 EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
357 Index cols()
const EIGEN_NOEXCEPT {
return m_transpositions.size(); }
361 template<
typename OtherDerived>
friend
370 template<
typename OtherDerived>
378 const TranspositionType&
nestedExpression()
const {
return m_transpositions; }
381 const TranspositionType& m_transpositions;
EIGEN_DEVICE_FUNC void resize(Index newSize)
Only plain matrices/arrays, not expressions, may be resized; therefore the only useful resize methods...
Definition DenseBase.h:246
Map & operator=(const Map &other)
This is a special case of the templated operator=.
Definition Transpositions.h:242
EIGEN_DEVICE_FUNC IndicesType & indices()
Definition Transpositions.h:255
EIGEN_DEVICE_FUNC const IndicesType & indices() const
const version of indices().
Definition Transpositions.h:251
Map & operator=(const TranspositionsBase< OtherDerived > &other)
Copies the other transpositions into *this.
Definition Transpositions.h:233
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:50
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived & operator=(const MatrixBase &other)
Special case of the template operator=, in order to prevent the compiler from generating a default op...
Definition Assign.h:55
friend const Product< OtherDerived, Transpose, AliasFreeProduct > operator*(const MatrixBase< OtherDerived > &matrix, const Transpose &trt)
Definition Transpositions.h:363
const Product< Transpose, OtherDerived, AliasFreeProduct > operator*(const MatrixBase< OtherDerived > &matrix) const
Definition Transpositions.h:372
Expression of the transpose of a matrix.
Definition Transpose.h:54
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const internal::remove_all< MatrixTypeNested >::type & nestedExpression() const
Definition Transpose.h:76
Definition Transpositions.h:17
Transpose< TranspositionsBase > transpose() const
Definition Transpositions.h:109
void resize(Index newSize)
Resizes to given size.
Definition Transpositions.h:71
Eigen::Index Index
Definition Transpositions.h:24
EIGEN_DEVICE_FUNC Index size() const
Definition Transpositions.h:41
const StorageIndex & operator[](Index i) const
Direct access to the underlying index vector.
Definition Transpositions.h:59
EIGEN_DEVICE_FUNC Index cols() const
Definition Transpositions.h:47
EIGEN_DEVICE_FUNC Index rows() const
Definition Transpositions.h:44
const StorageIndex & operator()(Index i) const
Direct access to the underlying index vector.
Definition Transpositions.h:55
EIGEN_DEVICE_FUNC const IndicesType & indices() const
const version of indices().
Definition Transpositions.h:65
void setIdentity()
Sets *this to represents an identity transformation.
Definition Transpositions.h:77
StorageIndex & operator[](Index i)
Direct access to the underlying index vector.
Definition Transpositions.h:61
EIGEN_DEVICE_FUNC const StorageIndex & coeff(Index i) const
Direct access to the underlying index vector.
Definition Transpositions.h:51
Derived & operator=(const TranspositionsBase< OtherDerived > &other)
Copies the other transpositions into *this.
Definition Transpositions.h:33
StorageIndex & coeffRef(Index i)
Direct access to the underlying index vector.
Definition Transpositions.h:53
StorageIndex & operator()(Index i)
Direct access to the underlying index vector.
Definition Transpositions.h:57
EIGEN_DEVICE_FUNC IndicesType & indices()
Definition Transpositions.h:68
Transpose< TranspositionsBase > inverse() const
Definition Transpositions.h:105
Definition Transpositions.h:274
EIGEN_DEVICE_FUNC const IndicesType & indices() const
const version of indices().
Definition Transpositions.h:295
TranspositionsWrapper & operator=(const TranspositionsBase< OtherDerived > &other)
Copies the other transpositions into *this.
Definition Transpositions.h:288
EIGEN_DEVICE_FUNC IndicesType & indices()
Definition Transpositions.h:299
Represents a sequence of transpositions (row/column interchange)
Definition Transpositions.h:156
Transpositions(const MatrixBase< Other > &indices)
Generic constructor from expression of the transposition indices.
Definition Transpositions.h:173
EIGEN_DEVICE_FUNC const IndicesType & indices() const
const version of indices().
Definition Transpositions.h:190
Transpositions(Index size)
Constructs an uninitialized permutation matrix of given size.
Definition Transpositions.h:185
Transpositions & operator=(const TranspositionsBase< OtherDerived > &other)
Copies the other transpositions into *this.
Definition Transpositions.h:178
Transpositions(const TranspositionsBase< OtherDerived > &other)
Copy constructor.
Definition Transpositions.h:168
EIGEN_DEVICE_FUNC IndicesType & indices()
Definition Transpositions.h:193
Namespace containing all symbols from the Eigen library.
Definition LDLT.h:16
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition Meta.h:74
The type used to identify a permutation storage.
Definition Constants.h:519
Definition ForwardDeclarations.h:17