10#ifndef EIGEN_TRANSPOSITIONS_H
11#define EIGEN_TRANSPOSITIONS_H
44template<
typename Derived>
51 typedef typename Traits::IndicesType IndicesType;
52 typedef typename IndicesType::Scalar StorageIndex;
55 Derived& derived() {
return *
static_cast<Derived*
>(
this); }
56 const Derived& derived()
const {
return *
static_cast<const Derived*
>(
this); }
59 template<
typename OtherDerived>
66 #ifndef EIGEN_PARSED_BY_DOXYGEN
98 const IndicesType&
indices()
const {
return derived().indices(); }
100 IndicesType&
indices() {
return derived().indices(); }
111 for(StorageIndex i = 0; i <
indices().size(); ++i)
148template<
int SizeAtCompileTime,
int MaxSizeAtCompileTime,
typename _StorageIndex>
150 :
traits<PermutationMatrix<SizeAtCompileTime,MaxSizeAtCompileTime,_StorageIndex> >
157template<
int SizeAtCompileTime,
int MaxSizeAtCompileTime,
typename _StorageIndex>
164 typedef typename Traits::IndicesType IndicesType;
165 typedef typename IndicesType::Scalar StorageIndex;
170 template<
typename OtherDerived>
172 : m_indices(other.
indices()) {}
174 #ifndef EIGEN_PARSED_BY_DOXYGEN
181 template<
typename Other>
186 template<
typename OtherDerived>
189 return Base::operator=(other);
192 #ifndef EIGEN_PARSED_BY_DOXYGEN
198 m_indices = other.m_indices;
209 const IndicesType&
indices()
const {
return m_indices; }
215 IndicesType m_indices;
220template<
int SizeAtCompileTime,
int MaxSizeAtCompileTime,
typename _StorageIndex,
int _PacketAccess>
222 :
traits<PermutationMatrix<SizeAtCompileTime,MaxSizeAtCompileTime,_StorageIndex> >
225 typedef _StorageIndex StorageIndex;
230template<
int SizeAtCompileTime,
int MaxSizeAtCompileTime,
typename _StorageIndex,
int PacketAccess>
232 :
public TranspositionsBase<Map<Transpositions<SizeAtCompileTime,MaxSizeAtCompileTime,_StorageIndex>,PacketAccess> >
238 typedef typename Traits::IndicesType IndicesType;
239 typedef typename IndicesType::Scalar StorageIndex;
250 template<
typename OtherDerived>
253 return Base::operator=(other);
256 #ifndef EIGEN_PARSED_BY_DOXYGEN
262 m_indices = other.m_indices;
268 const IndicesType&
indices()
const {
return m_indices; }
275 IndicesType m_indices;
279template<
typename _IndicesType>
281 :
traits<PermutationWrapper<_IndicesType> >
287template<
typename _IndicesType>
295 typedef typename Traits::IndicesType IndicesType;
296 typedef typename IndicesType::Scalar StorageIndex;
303 template<
typename OtherDerived>
306 return Base::operator=(other);
309 #ifndef EIGEN_PARSED_BY_DOXYGEN
315 m_indices = other.m_indices;
321 const IndicesType&
indices()
const {
return m_indices; }
328 const typename IndicesType::Nested m_indices;
335template<
typename MatrixDerived,
typename TranspositionsDerived>
337const Product<MatrixDerived, TranspositionsDerived, AliasFreeProduct>
338operator*(
const MatrixBase<MatrixDerived> &matrix,
339 const TranspositionsBase<TranspositionsDerived>& transpositions)
341 return Product<MatrixDerived, TranspositionsDerived, AliasFreeProduct>
342 (matrix.derived(), transpositions.derived());
347template<
typename TranspositionsDerived,
typename MatrixDerived>
349const Product<TranspositionsDerived, MatrixDerived, AliasFreeProduct>
350operator*(
const TranspositionsBase<TranspositionsDerived> &transpositions,
351 const MatrixBase<MatrixDerived>& matrix)
353 return Product<TranspositionsDerived, MatrixDerived, AliasFreeProduct>
354 (transpositions.derived(), matrix.derived());
361template<
typename Derived>
368template<
typename TranspositionsDerived>
372 typedef typename TranspositionType::IndicesType IndicesType;
375 explicit Transpose(
const TranspositionType& t) : m_transpositions(t) {}
377 Index size()
const {
return m_transpositions.size(); }
378 Index rows()
const {
return m_transpositions.size(); }
379 Index cols()
const {
return m_transpositions.size(); }
383 template<
typename OtherDerived>
friend
392 template<
typename OtherDerived>
399 const TranspositionType&
nestedExpression()
const {
return m_transpositions; }
402 const TranspositionType& m_transpositions;
Map & operator=(const Map &other)
This is a special case of the templated operator=.
Definition Transpositions.h:260
IndicesType & indices()
Definition Transpositions.h:271
const IndicesType & indices() const
const version of indices().
Definition Transpositions.h:268
Map & operator=(const TranspositionsBase< OtherDerived > &other)
Copies the other transpositions into *this.
Definition Transpositions.h:251
A matrix or vector expression mapping an existing array of data.
Definition Map.h:91
Pseudo expression representing a solving operation.
Definition Solve.h:63
friend const Product< OtherDerived, Transpose, AliasFreeProduct > operator*(const MatrixBase< OtherDerived > &matrix, const Transpose &trt)
Definition Transpositions.h:385
const Product< Transpose, OtherDerived, AliasFreeProduct > operator*(const MatrixBase< OtherDerived > &matrix) const
Definition Transpositions.h:394
Expression of the transpose of a matrix.
Definition Transpose.h:55
EIGEN_DEVICE_FUNC const internal::remove_all< typenameMatrixType::Nested >::type & nestedExpression() const
Definition Transpose.h:73
Definition Transpositions.h:46
const IndicesType & indices() const
const version of indices().
Definition Transpositions.h:98
Transpose< TranspositionsBase > transpose() const
Definition Transpositions.h:141
IndicesType & indices()
Definition Transpositions.h:100
void resize(Index newSize)
Resizes to given size.
Definition Transpositions.h:103
Eigen::Index Index
Definition Transpositions.h:53
const StorageIndex & operator[](Index i) const
Direct access to the underlying index vector.
Definition Transpositions.h:93
Index size() const
Definition Transpositions.h:78
const StorageIndex & operator()(Index i) const
Direct access to the underlying index vector.
Definition Transpositions.h:89
Derived & operator=(const TranspositionsBase &other)
This is a special case of the templated operator=.
Definition Transpositions.h:70
Index rows() const
Definition Transpositions.h:80
void setIdentity()
Sets *this to represents an identity transformation.
Definition Transpositions.h:109
StorageIndex & operator[](Index i)
Direct access to the underlying index vector.
Definition Transpositions.h:95
const StorageIndex & coeff(Index i) const
Direct access to the underlying index vector.
Definition Transpositions.h:85
Derived & operator=(const TranspositionsBase< OtherDerived > &other)
Copies the other transpositions into *this.
Definition Transpositions.h:60
Index cols() const
Definition Transpositions.h:82
StorageIndex & coeffRef(Index i)
Direct access to the underlying index vector.
Definition Transpositions.h:87
StorageIndex & operator()(Index i)
Direct access to the underlying index vector.
Definition Transpositions.h:91
Transpose< TranspositionsBase > inverse() const
Definition Transpositions.h:137
Definition Transpositions.h:290
TranspositionsWrapper & operator=(const TranspositionsWrapper &other)
This is a special case of the templated operator=.
Definition Transpositions.h:313
TranspositionsWrapper & operator=(const TranspositionsBase< OtherDerived > &other)
Copies the other transpositions into *this.
Definition Transpositions.h:304
IndicesType & indices()
Definition Transpositions.h:324
const IndicesType & indices() const
const version of indices().
Definition Transpositions.h:321
Represents a sequence of transpositions (row/column interchange)
Definition Transpositions.h:159
Transpositions & operator=(const Transpositions &other)
This is a special case of the templated operator=.
Definition Transpositions.h:196
Transpositions(const MatrixBase< Other > &indices)
Generic constructor from expression of the transposition indices.
Definition Transpositions.h:182
IndicesType & indices()
Definition Transpositions.h:211
const IndicesType & indices() const
const version of indices().
Definition Transpositions.h:209
Transpositions(Index size)
Constructs an uninitialized permutation matrix of given size.
Definition Transpositions.h:205
Transpositions & operator=(const TranspositionsBase< OtherDerived > &other)
Copies the other transpositions into *this.
Definition Transpositions.h:187
Transpositions(const TranspositionsBase< OtherDerived > &other)
Copy constructor.
Definition Transpositions.h:171
Transpositions(const Transpositions &other)
Standard copy constructor.
Definition Transpositions.h:177
The type used to identify a permutation storage.
Definition Constants.h:502
Definition ForwardDeclarations.h:17