10 #ifndef EIGEN_TRANSPOSITIONS_H 11 #define EIGEN_TRANSPOSITIONS_H 48 template<
typename Derived>
58 Derived&
derived() {
return *
static_cast<Derived*
>(
this); }
59 const Derived&
derived()
const {
return *
static_cast<const Derived*
>(
this); }
62 template<
typename OtherDerived>
69 #ifndef EIGEN_PARSED_BY_DOXYGEN 81 inline Index
size()
const {
return indices().size(); }
84 inline const Index&
coeff(Index i)
const {
return indices().coeff(i); }
86 inline Index&
coeffRef(Index i) {
return indices().coeffRef(i); }
88 inline const Index&
operator()(Index i)
const {
return indices()(i); }
90 inline Index&
operator()(Index i) {
return indices()(i); }
92 inline const Index&
operator[](Index i)
const {
return indices()(i); }
94 inline Index&
operator[](Index i) {
return indices()(i); }
97 const IndicesType&
indices()
const {
return derived().indices(); }
99 IndicesType&
indices() {
return derived().indices(); }
104 indices().resize(newSize);
110 for(
int i = 0; i < indices().size(); ++i)
147 template<
int SizeAtCompileTime,
int MaxSizeAtCompileTime,
typename IndexType>
155 template<
int SizeAtCompileTime,
int MaxSizeAtCompileTime,
typename IndexType>
168 template<
typename OtherDerived>
170 : m_indices(other.indices()) {}
172 #ifndef EIGEN_PARSED_BY_DOXYGEN 179 template<
typename Other>
184 template<
typename OtherDerived>
187 return Base::operator=(other);
190 #ifndef EIGEN_PARSED_BY_DOXYGEN 207 const IndicesType&
indices()
const {
return m_indices; }
218 template<
int SizeAtCompileTime,
int MaxSizeAtCompileTime,
typename IndexType,
int _PacketAccess>
226 template<
int SizeAtCompileTime,
int MaxSizeAtCompileTime,
typename IndexType,
int PacketAccess>
228 :
public TranspositionsBase<Map<Transpositions<SizeAtCompileTime,MaxSizeAtCompileTime,IndexType>,PacketAccess> >
235 typedef typename IndicesType::Scalar
Index;
237 inline Map(
const Index* indicesPtr)
238 : m_indices(indicesPtr)
241 inline Map(
const Index* indicesPtr, Index size)
242 : m_indices(indicesPtr,size)
246 template<
typename OtherDerived>
249 return Base::operator=(other);
252 #ifndef EIGEN_PARSED_BY_DOXYGEN 258 m_indices = other.m_indices;
264 const IndicesType&
indices()
const {
return m_indices; }
275 template<
typename _IndicesType>
278 typedef typename _IndicesType::Scalar
Index;
283 template<
typename _IndicesType>
292 typedef typename IndicesType::Scalar
Index;
295 : m_indices(a_indices)
299 template<
typename OtherDerived>
302 return Base::operator=(other);
305 #ifndef EIGEN_PARSED_BY_DOXYGEN 317 const IndicesType&
indices()
const {
return m_indices; }
329 template<
typename Derived,
typename TranspositionsDerived>
336 (transpositions.
derived(), matrix.derived());
341 template<
typename Derived,
typename TranspositionDerived>
343 <TranspositionDerived, Derived,
OnTheLeft>
348 <TranspositionDerived, Derived,
OnTheLeft>
349 (transpositions.
derived(), matrix.derived());
354 template<
typename TranspositionType,
typename MatrixType,
int S
ide,
bool Transposed>
360 template<
typename TranspositionType,
typename MatrixType,
int S
ide,
bool Transposed>
362 :
public ReturnByValue<transposition_matrix_product_retval<TranspositionType, MatrixType, Side, Transposed> >
365 typedef typename TranspositionType::Index
Index;
368 : m_transpositions(tr), m_matrix(matrix)
371 inline int rows()
const {
return m_matrix.rows(); }
372 inline int cols()
const {
return m_matrix.cols(); }
374 template<
typename Dest>
inline void evalTo(Dest& dst)
const 376 const int size = m_transpositions.size();
382 for(
int k=(Transposed?size-1:0) ; Transposed?k>=0:k<size ; Transposed?--k:++k)
383 if((j=m_transpositions.coeff(k))!=k)
386 dst.row(k).swap(dst.row(j));
388 dst.col(k).swap(dst.col(j));
401 template<
typename TranspositionsDerived>
408 Transpose(
const TranspositionType& t) : m_transpositions(t) {}
410 inline int size()
const {
return m_transpositions.size(); }
414 template<
typename Derived>
friend 423 template<
typename Derived>
436 #endif // EIGEN_TRANSPOSITIONS_H
Index & operator()(Index i)
internal::traits< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::Scalar Scalar
Traits::IndicesType IndicesType
Derived & operator=(const TranspositionsBase< OtherDerived > &other)
internal::traits< Map > Traits
MatrixType::PlainObject ReturnType
Transpositions(const MatrixBase< Other > &a_indices)
A matrix or vector expression mapping an existing array of data.
Expression of the transpose of a matrix.
Traits::IndicesType IndicesType
Derived & operator=(const TranspositionsBase &other)
_IndicesType::Scalar Index
TranspositionsDerived TranspositionType
iterative scaling algorithm to equilibrate rows and column norms in matrices
const internal::permut_matrix_product_retval< PermutationDerived, Derived, OnTheRight > operator*(const MatrixBase< Derived > &matrix, const PermutationBase< PermutationDerived > &permutation)
TranspositionType::IndicesType IndicesType
Map(const Index *indicesPtr)
void evalTo(Dest &dst) const
Index & coeffRef(Index i)
Map(const Index *indicesPtr, Index size)
internal::traits< Transpositions > Traits
Traits::IndicesType IndicesType
Map & operator=(const TranspositionsBase< OtherDerived > &other)
const Index & operator[](Index i) const
IndicesType::Scalar Index
Traits::IndicesType IndicesType
Transpositions & operator=(const TranspositionsBase< OtherDerived > &other)
const IndicesType & indices() const
Matrix< Index, SizeAtCompileTime, 1, 0, MaxSizeAtCompileTime, 1 > IndicesType
Transpositions(const TranspositionsBase< OtherDerived > &other)
const TranspositionType & m_transpositions
const TranspositionType & m_transpositions
Transpose< TranspositionsBase > transpose() const
Transpositions & operator=(const Transpositions &other)
TranspositionsBase< Map > Base
Index & operator[](Index i)
const IndicesType & indices() const
Map & operator=(const Map &other)
TranspositionsBase< TranspositionsWrapper > Base
IndicesType::Scalar Index
MatrixType::Nested m_matrix
internal::traits< TranspositionsWrapper > Traits
IndicesType::Scalar Index
friend const internal::transposition_matrix_product_retval< TranspositionType, Derived, OnTheRight, true > operator*(const MatrixBase< Derived > &matrix, const Transpose &trt)
const IndicesType & indices() const
Transpose< TranspositionsBase > inverse() const
Map< const Matrix< Index, SizeAtCompileTime, 1, 0, MaxSizeAtCompileTime, 1 >, _PacketAccess > IndicesType
TranspositionType::Index Index
const IndicesType::Nested m_indices
const Derived & derived() const
const Index & coeff(Index i) const
const internal::transposition_matrix_product_retval< TranspositionType, Derived, OnTheLeft, true > operator*(const MatrixBase< Derived > &matrix) const
TranspositionsWrapper & operator=(const TranspositionsBase< OtherDerived > &other)
remove_all< typename MatrixType::Nested >::type MatrixTypeNestedCleaned
TranspositionsWrapper(IndicesType &a_indices)
Transpositions(Index size)
Transpositions(const Transpositions &other)
const IndicesType & indices() const
const T::Scalar * extract_data(const T &m)
The matrix class, also used for vectors and row-vectors.
Transpose(const TranspositionType &t)
Base class for all dense matrices, vectors, and expressions.
Represents a sequence of transpositions (row/column interchange)
IndicesType::Scalar Index
TranspositionsBase< Transpositions > Base
const Index & operator()(Index i) const
TranspositionsWrapper & operator=(const TranspositionsWrapper &other)
internal::traits< Derived > Traits
transposition_matrix_product_retval(const TranspositionType &tr, const MatrixType &matrix)