116 || (PlainObjectType::IsVectorAtCompileTime &&
119 int(PlainObjectType::RowsAtCompileTime) ==
int(Expression::ColsAtCompileTime)) &&
122 int(PlainObjectType::ColsAtCompileTime) ==
int(Expression::RowsAtCompileTime)))),
123 YOU_MIXED_MATRICES_OF_DIFFERENT_SIZES)
128 if (PlainObjectType::RowsAtCompileTime == 1) {
132 }
else if (PlainObjectType::ColsAtCompileTime == 1) {
142 const bool transpose = PlainObjectType::IsVectorAtCompileTime && (
rows != expr.rows());
144 const bool row_major = ((PlainObjectType::Flags)&
RowMajorBit) != 0;
145 const bool expr_row_major = (Expression::Flags &
RowMajorBit) != 0;
146 const bool storage_differs = (row_major != expr_row_major);
148 const bool swap_stride = (
transpose != storage_differs);
152 const Index expr_outer_actual =
resolveOuterStride(expr_inner_actual, expr.outerStride(), expr.rows(), expr.cols(),
153 Expression::IsVectorAtCompileTime != 0, expr_row_major);
157 const bool row_vector = (
rows == 1);
158 const bool col_vector = (
cols == 1);
159 const Index inner_stride =
160 ((!row_major && row_vector) || (row_major && col_vector))
161 ? (StrideType::InnerStrideAtCompileTime > 0 ?
Index(StrideType::InnerStrideAtCompileTime) : 1)
162 : swap_stride ? expr_outer_actual
167 const Index outer_stride =
168 ((!row_major && col_vector) || (row_major && row_vector))
169 ? (StrideType::OuterStrideAtCompileTime > 0 ?
Index(StrideType::OuterStrideAtCompileTime)
171 : swap_stride ? expr_inner_actual
175 const bool inner_valid = (StrideType::InnerStrideAtCompileTime ==
Dynamic) ||
181 const bool outer_valid =
182 (StrideType::OuterStrideAtCompileTime ==
Dynamic) ||
184 PlainObjectType::IsVectorAtCompileTime != 0, row_major) == outer_stride);
189 internal::construct_at<Base>(
this, expr.data(),
rows,
cols);
191 (StrideType::InnerStrideAtCompileTime == 0) ? 0 : inner_stride);
#define eigen_assert(x)
Definition: Macros.h:910
#define EIGEN_STATIC_ASSERT(X, MSG)
Definition: StaticAssert.h:26
#define EIGEN_PREDICATE_SAME_MATRIX_SIZE(TYPE0, TYPE1)
Definition: StaticAssert.h:66
int rows
Definition: Tutorial_commainit_02.cpp:1
int cols
Definition: Tutorial_commainit_02.cpp:1
internal::traits< Derived >::PlainObjectType PlainObjectType
Definition: Ref.h:69
static EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index resolveInnerStride(Index inner)
Definition: Ref.h:100
static EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index resolveOuterStride(Index inner, Index outer, Index rows, Index cols, bool isVectorAtCompileTime, bool isRowMajor)
Definition: Ref.h:103
const unsigned int RowMajorBit
Definition: Constants.h:70
EIGEN_DEVICE_FUNC T * construct_at(T *p, Args &&... args)
Definition: Memory.h:1321
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:83
void transpose()
Definition: skew_symmetric_matrix3.cpp:135