10 #ifndef EIGEN_TRANSPOSITIONS_H
11 #define EIGEN_TRANSPOSITIONS_H
15 template<
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>
79 for(StorageIndex i = 0; i <
indices().size(); ++i)
116 template<
int SizeAtCompileTime,
int MaxSizeAtCompileTime,
typename _StorageIndex>
118 :
traits<PermutationMatrix<SizeAtCompileTime,MaxSizeAtCompileTime,_StorageIndex> >
154 template<
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>
197 IndicesType m_indices;
202 template<
int SizeAtCompileTime,
int MaxSizeAtCompileTime,
typename _StorageIndex,
int _PacketAccess>
204 :
traits<PermutationMatrix<SizeAtCompileTime,MaxSizeAtCompileTime,_StorageIndex> >
207 typedef _StorageIndex StorageIndex;
212 template<
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;
223 explicit inline Map(
const StorageIndex* indicesPtr)
224 : m_indices(indicesPtr)
227 inline Map(
const StorageIndex* indicesPtr,
Index size)
228 : m_indices(indicesPtr,size)
232 template<
typename OtherDerived>
235 return Base::operator=(other);
238 #ifndef EIGEN_PARSED_BY_DOXYGEN
244 m_indices = other.m_indices;
251 const IndicesType&
indices()
const {
return m_indices; }
259 IndicesType m_indices;
263 template<
typename _IndicesType>
265 :
traits<PermutationWrapper<_IndicesType> >
271 template<
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;
310 template<
typename MatrixDerived,
typename TranspositionsDerived>
312 const Product<MatrixDerived, TranspositionsDerived, AliasFreeProduct>
317 (matrix.derived(), transpositions.derived());
322 template<
typename TranspositionsDerived,
typename MatrixDerived>
324 const Product<TranspositionsDerived, MatrixDerived, AliasFreeProduct>
329 (transpositions.derived(), matrix.derived());
336 template<
typename Derived>
343 template<
typename TranspositionsDerived>
346 typedef TranspositionsDerived TranspositionType;
347 typedef typename TranspositionType::IndicesType IndicesType;
350 explicit Transpose(
const TranspositionType& t) : m_transpositions(t) {}
353 Index size()
const {
return m_transpositions.size(); }
355 Index rows()
const {
return m_transpositions.size(); }
357 Index cols()
const {
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;
386 #endif // EIGEN_TRANSPOSITIONS_H
EIGEN_DEVICE_FUNC Index rows() const
Definition: Transpositions.h:44
Transpose< TranspositionsBase > inverse() const
Definition: Transpositions.h:105
Definition: Transpositions.h:17
const StorageIndex & operator()(Index i) const
Definition: Transpositions.h:55
Namespace containing all symbols from the Eigen library.
Definition: LDLT.h:16
Eigen::Index Index
Definition: Transpositions.h:24
StorageIndex & operator[](Index i)
Definition: Transpositions.h:61
EIGEN_DEVICE_FUNC const Product< MatrixDerived, PermutationDerived, AliasFreeProduct > operator*(const MatrixBase< MatrixDerived > &matrix, const PermutationBase< PermutationDerived > &permutation)
Definition: PermutationMatrix.h:515
friend const Product< OtherDerived, Transpose, AliasFreeProduct > operator*(const MatrixBase< OtherDerived > &matrix, const Transpose &trt)
Definition: Transpositions.h:363
Map & operator=(const Map &other)
Definition: Transpositions.h:242
TranspositionsWrapper & operator=(const TranspositionsBase< OtherDerived > &other)
Definition: Transpositions.h:288
Transpose< TranspositionsBase > transpose() const
Definition: Transpositions.h:109
Represents a sequence of transpositions (row/column interchange)
Definition: Transpositions.h:156
EIGEN_DEVICE_FUNC Index cols() const
Definition: Transpositions.h:47
Expression of the transpose of a matrix.
Definition: Transpose.h:54
void resize(Index newSize)
Definition: Transpositions.h:71
EIGEN_DEVICE_FUNC IndicesType & indices()
Definition: Transpositions.h:255
Transpositions(Index size)
Definition: Transpositions.h:185
EIGEN_DEVICE_FUNC IndicesType & indices()
Definition: Transpositions.h:299
Transpositions(const MatrixBase< Other > &indices)
Definition: Transpositions.h:173
Transpositions(const TranspositionsBase< OtherDerived > &other)
Definition: Transpositions.h:168
EIGEN_DEVICE_FUNC Index size() const
Definition: Transpositions.h:41
Expression of the product of two arbitrary matrices or vectors.
Definition: Product.h:75
EIGEN_DEVICE_FUNC const IndicesType & indices() const
Definition: Transpositions.h:190
EIGEN_DEVICE_FUNC IndicesType & indices()
Definition: Transpositions.h:193
EIGEN_DEVICE_FUNC const StorageIndex & coeff(Index i) const
Definition: Transpositions.h:51
Map & operator=(const TranspositionsBase< OtherDerived > &other)
Definition: Transpositions.h:233
A matrix or vector expression mapping an existing array of data.
Definition: Map.h:96
EIGEN_DEVICE_FUNC Map(PointerArgType dataPtr, const StrideType &stride=StrideType())
Definition: Map.h:129
Definition: Constants.h:512
EIGEN_DEVICE_FUNC const IndicesType & indices() const
Definition: Transpositions.h:251
EIGEN_DEVICE_FUNC const IndicesType & indices() const
Definition: Transpositions.h:295
const Product< Transpose, OtherDerived, AliasFreeProduct > operator*(const MatrixBase< OtherDerived > &matrix) const
Definition: Transpositions.h:372
Transpositions & operator=(const TranspositionsBase< OtherDerived > &other)
Definition: Transpositions.h:178
Definition: Constants.h:515
void setIdentity()
Definition: Transpositions.h:77
The matrix class, also used for vectors and row-vectors.
Definition: Matrix.h:180
Base class for all dense matrices, vectors, and expressions.
Definition: MatrixBase.h:50
Derived & operator=(const TranspositionsBase< OtherDerived > &other)
Definition: Transpositions.h:33
const StorageIndex & operator[](Index i) const
Definition: Transpositions.h:59
StorageIndex & operator()(Index i)
Definition: Transpositions.h:57
Definition: Transpositions.h:274
StorageIndex & coeffRef(Index i)
Definition: Transpositions.h:53
EIGEN_DEVICE_FUNC IndicesType & indices()
Definition: Transpositions.h:68
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const internal::remove_all< MatrixTypeNested >::type & nestedExpression() const
Definition: Transpose.h:76
EIGEN_DEVICE_FUNC const IndicesType & indices() const
Definition: Transpositions.h:65
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:42