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;
26 Derived& derived() {
return *
static_cast<Derived*
>(
this); }
27 const Derived& derived()
const {
return *
static_cast<const Derived*
>(
this); }
30 template<
typename OtherDerived>
37 #ifndef EIGEN_PARSED_BY_DOXYGEN 56 inline const StorageIndex&
coeff(Index i)
const {
return indices().coeff(i); }
69 const IndicesType&
indices()
const {
return derived().indices(); }
71 IndicesType&
indices() {
return derived().indices(); }
82 for(StorageIndex i = 0; i <
indices().size(); ++i)
119 template<
int SizeAtCompileTime,
int MaxSizeAtCompileTime,
typename _StorageIndex>
121 :
traits<PermutationMatrix<SizeAtCompileTime,MaxSizeAtCompileTime,_StorageIndex> >
157 template<
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;
220 template<
int SizeAtCompileTime,
int MaxSizeAtCompileTime,
typename _StorageIndex,
int _PacketAccess>
222 :
traits<PermutationMatrix<SizeAtCompileTime,MaxSizeAtCompileTime,_StorageIndex> >
225 typedef _StorageIndex StorageIndex;
230 template<
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;
241 explicit inline Map(
const StorageIndex* indicesPtr)
242 : m_indices(indicesPtr)
246 : m_indices(indicesPtr,size)
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;
279 template<
typename _IndicesType>
281 :
traits<PermutationWrapper<_IndicesType> >
287 template<
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 typename IndicesType::Nested m_indices;
335 template<
typename MatrixDerived,
typename TranspositionsDerived>
342 (matrix.derived(), transpositions.derived());
347 template<
typename TranspositionsDerived,
typename MatrixDerived>
354 (transpositions.derived(), matrix.derived());
361 template<
typename Derived>
368 template<
typename TranspositionsDerived>
371 typedef TranspositionsDerived TranspositionType;
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;
407 #endif // EIGEN_TRANSPOSITIONS_H Definition: PermutationMatrix.h:483
Index size() const
Definition: Transpositions.h:49
Expression of the product of two arbitrary matrices or vectors.
Definition: Product.h:71
Derived & operator=(const TranspositionsBase< OtherDerived > &other)
Copies the other transpositions into *this.
Definition: Transpositions.h:31
Eigen::Index Index
Definition: Transpositions.h:24
A matrix or vector expression mapping an existing array of data.
Definition: Map.h:88
IndicesType & indices()
Definition: Transpositions.h:324
Expression of the transpose of a matrix.
Definition: Transpose.h:52
The type used to identify a permutation storage.
Definition: Constants.h:500
Derived & operator=(const TranspositionsBase &other)
This is a special case of the templated operator=.
Definition: Transpositions.h:41
Namespace containing all symbols from the Eigen library.
Definition: bench_norm.cpp:85
Transpositions(const TranspositionsBase< OtherDerived > &other)
Copy constructor.
Definition: Transpositions.h:171
Transpositions & operator=(const Transpositions &other)
This is a special case of the templated operator=.
Definition: Transpositions.h:196
StorageIndex & coeffRef(Index i)
Direct access to the underlying index vector.
Definition: Transpositions.h:58
Transpose< TranspositionsBase > inverse() const
Definition: Transpositions.h:108
Index rows() const
Definition: Transpositions.h:51
const StorageIndex & coeff(Index i) const
Direct access to the underlying index vector.
Definition: Transpositions.h:56
const IndicesType & indices() const
const version of indices().
Definition: Transpositions.h:209
const Product< Transpose, OtherDerived, AliasFreeProduct > operator*(const MatrixBase< OtherDerived > &matrix) const
Definition: Transpositions.h:394
const StorageIndex & operator[](Index i) const
Direct access to the underlying index vector.
Definition: Transpositions.h:64
void setIdentity()
Sets *this to represents an identity transformation.
Definition: Transpositions.h:80
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:33
Transpositions(Index size)
Constructs an uninitialized permutation matrix of given size.
Definition: Transpositions.h:205
IndicesType & indices()
Definition: Transpositions.h:271
Map & operator=(const TranspositionsBase< OtherDerived > &other)
Copies the other transpositions into *this.
Definition: Transpositions.h:251
Map & operator=(const Map &other)
This is a special case of the templated operator=.
Definition: Transpositions.h:260
void resize(Index newSize)
Resizes to given size.
Definition: Transpositions.h:74
const IndicesType & indices() const
const version of indices().
Definition: Transpositions.h:268
EIGEN_DEVICE_FUNC const Product< MatrixDerived, PermutationDerived, AliasFreeProduct > operator*(const MatrixBase< MatrixDerived > &matrix, const PermutationBase< PermutationDerived > &permutation)
Definition: PermutationMatrix.h:543
Transpositions(const MatrixBase< Other > &indices)
Generic constructor from expression of the transposition indices.
Definition: Transpositions.h:182
Transpose< TranspositionsBase > transpose() const
Definition: Transpositions.h:112
StorageIndex & operator()(Index i)
Direct access to the underlying index vector.
Definition: Transpositions.h:62
Definition: BandTriangularSolver.h:13
IndicesType & indices()
Definition: Transpositions.h:71
Transpositions & operator=(const TranspositionsBase< OtherDerived > &other)
Copies the other transpositions into *this.
Definition: Transpositions.h:187
StorageIndex & operator[](Index i)
Direct access to the underlying index vector.
Definition: Transpositions.h:66
TranspositionsWrapper & operator=(const TranspositionsBase< OtherDerived > &other)
Copies the other transpositions into *this.
Definition: Transpositions.h:304
const IndicesType & indices() const
const version of indices().
Definition: Transpositions.h:321
friend const Product< OtherDerived, Transpose, AliasFreeProduct > operator*(const MatrixBase< OtherDerived > &matrix, const Transpose &trt)
Definition: Transpositions.h:385
The type used to identify a permutation storage.
Definition: Constants.h:503
const IndicesType & indices() const
const version of indices().
Definition: Transpositions.h:69
const StorageIndex & operator()(Index i) const
Direct access to the underlying index vector.
Definition: Transpositions.h:60
Transpositions(const Transpositions &other)
Standard copy constructor.
Definition: Transpositions.h:177
Definition: Transpositions.h:16
The matrix class, also used for vectors and row-vectors.
Definition: Matrix.h:178
Base class for all dense matrices, vectors, and expressions.
Definition: MatrixBase.h:48
Index cols() const
Definition: Transpositions.h:53
Represents a sequence of transpositions (row/column interchange)
Definition: Transpositions.h:158
IndicesType & indices()
Definition: Transpositions.h:211
TranspositionsWrapper & operator=(const TranspositionsWrapper &other)
This is a special case of the templated operator=.
Definition: Transpositions.h:313