11#ifndef EIGEN_TRANSPOSE_H
12#define EIGEN_TRANSPOSE_H
31template<
typename MatrixType>
35 typedef typename remove_reference<MatrixTypeNested>::type MatrixTypeNestedPlain;
37 RowsAtCompileTime = MatrixType::ColsAtCompileTime,
38 ColsAtCompileTime = MatrixType::RowsAtCompileTime,
39 MaxRowsAtCompileTime = MatrixType::MaxColsAtCompileTime,
40 MaxColsAtCompileTime = MatrixType::MaxRowsAtCompileTime,
43 Flags1 = Flags0 | FlagsLvalueBit,
51template<
typename MatrixType,
typename StorageKind>
class TransposeImpl;
54 :
public TransposeImpl<MatrixType,typename internal::traits<MatrixType>::StorageKind>
63 explicit inline Transpose(MatrixType& matrix) : m_matrix(matrix) {}
65 EIGEN_INHERIT_ASSIGNMENT_OPERATORS(
Transpose)
81 typename MatrixType::Nested m_matrix;
86template<typename MatrixType, bool HasDirectAccess = has_direct_access<MatrixType>::ret>
92template<
typename MatrixType>
101template<
typename XprType,
typename StorageKind>
114 typedef typename internal::TransposeImpl_base<MatrixType>::type Base;
115 using Base::coeffRef;
119 EIGEN_DEVICE_FUNC inline Index innerStride()
const {
return derived().nestedExpression().innerStride(); }
120 EIGEN_DEVICE_FUNC inline Index outerStride()
const {
return derived().nestedExpression().outerStride(); }
129 EIGEN_DEVICE_FUNC inline const Scalar* data()
const {
return derived().nestedExpression().data(); }
133 inline const Scalar& coeffRef(Index
rowId, Index
colId)
const
135 return derived().nestedExpression().coeffRef(
colId,
rowId);
139 inline const Scalar& coeffRef(Index index)
const
141 return derived().nestedExpression().coeffRef(index);
164template<
typename Derived>
176template<
typename Derived>
202template<
typename Derived>
215template<
typename MatrixType,
216 bool IsSquare = (MatrixType::RowsAtCompileTime == MatrixType::ColsAtCompileTime) && MatrixType::RowsAtCompileTime!=Dynamic,
222template<
typename MatrixType>
224 static void run(MatrixType& m) {
230template<
typename MatrixType>
232 static void run(MatrixType& m) {
233 typedef typename MatrixType::Scalar Scalar;
234 typedef typename internal::packet_traits<typename MatrixType::Scalar>::type Packet;
238 for (Index i=0; i<PacketSize; ++i)
240 internal::ptranspose(A);
241 for (Index i=0; i<PacketSize; ++i)
246template<
typename MatrixType,
bool MatchPacketSize>
248 static void run(MatrixType& m) {
249 if (m.rows()==m.cols())
252 m = m.transpose().eval();
277template<
typename Derived>
280 eigen_assert((rows() == cols() || (RowsAtCompileTime == Dynamic && ColsAtCompileTime == Dynamic))
281 &&
"transposeInPlace() called on a non-square non-resizable matrix");
308template<
typename Derived>
311 derived() = adjoint().
eval();
314#ifndef EIGEN_NO_DEBUG
320template<
bool DestIsTransposed,
typename OtherDerived>
326template<
bool DestIsTransposed,
typename BinOp,
typename DerivedA,
typename DerivedB>
334template<
typename Scalar,
bool DestIsTransposed,
typename OtherDerived>
343template<
typename Scalar,
bool DestIsTransposed,
typename BinOp,
typename DerivedA,
typename DerivedB>
370 ::run(extract_data(
dst), other))
371 &&
"aliasing detected during transposition, use transposeInPlace() "
372 "or evaluate the rhs into a temporary using .eval()");
377template<
typename Derived,
typename OtherDerived>
385template<
typename Dst,
typename Src>
386void check_for_aliasing(
const Dst &
dst,
const Src &
src)
Generic expression where a coefficient-wise binary operator is applied to two expressions.
Definition CwiseBinaryOp.h:85
Base class for all dense matrices, vectors, and arrays.
Definition DenseBase.h:49
Base class for all dense matrices, vectors, and expressions.
Definition MatrixBase.h:50
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EvalReturnType eval() const
Definition DenseBase.h:405
Pseudo expression representing a solving operation.
Definition Solve.h:63
Definition Transpose.h:104
Expression of the transpose of a matrix.
Definition Transpose.h:55
EIGEN_DEVICE_FUNC internal::remove_all< typenameMatrixType::Nested >::type & nestedExpression()
Definition Transpose.h:78
EIGEN_DEVICE_FUNC const internal::remove_all< typenameMatrixType::Nested >::type & nestedExpression() const
Definition Transpose.h:73
const unsigned int PacketAccessBit
Short version: means the expression might be vectorized.
Definition Constants.h:88
const unsigned int LvalueBit
Means the expression has a coeffRef() method, i.e.
Definition Constants.h:138
const unsigned int RowMajorBit
for a matrix, this means that the storage order is row-major.
Definition Constants.h:61
The type used to identify a dense storage.
Definition Constants.h:490
Definition Transpose.h:88
Definition BlasUtil.h:257
Definition Transpose.h:365
Definition Transpose.h:322
Definition Transpose.h:336
Definition CoreEvaluators.h:82
Definition XprHelper.h:445
Definition DenseCoeffsBase.h:631
Definition Transpose.h:220
Definition XprHelper.h:628
Definition DenseCoeffsBase.h:643
Definition GenericPacketMath.h:90
Definition ForwardDeclarations.h:17