13 #ifndef EIGEN_COREEVALUATORS_H 14 #define EIGEN_COREEVALUATORS_H 22 template<
typename StorageKind>
83 template<typename T, typename Shape = typename evaluator_traits<T>::Shape >
85 static const bool value =
false;
93 EIGEN_DEVICE_FUNC
explicit evaluator(
const T& xpr) : Base(xpr) {}
108 template<
typename ExpressionType>
126 template<
typename Derived>
135 IsRowMajor = PlainObjectType::IsRowMajor,
136 IsVectorAtCompileTime = PlainObjectType::IsVectorAtCompileTime,
137 RowsAtCompileTime = PlainObjectType::RowsAtCompileTime,
138 ColsAtCompileTime = PlainObjectType::ColsAtCompileTime,
147 m_outerStride(IsVectorAtCompileTime ? 0
148 :
int(IsRowMajor) ? ColsAtCompileTime
154 EIGEN_DEVICE_FUNC
explicit evaluator(
const PlainObjectType&
m)
155 : m_data(m.
data()), m_outerStride(IsVectorAtCompileTime ? 0 : m.outerStride())
164 return m_data[row * m_outerStride.value() +
col];
166 return m_data[row + col * m_outerStride.value()];
172 return m_data[index];
179 return const_cast<Scalar*
>(m_data)[row * m_outerStride.value() +
col];
181 return const_cast<Scalar*
>(m_data)[row + col * m_outerStride.value()];
187 return const_cast<Scalar*
>(m_data)[index];
190 template<
int LoadMode,
typename PacketType>
195 return ploadt<PacketType, LoadMode>(m_data + row * m_outerStride.value() +
col);
197 return ploadt<PacketType, LoadMode>(m_data + row + col * m_outerStride.value());
200 template<
int LoadMode,
typename PacketType>
204 return ploadt<PacketType, LoadMode>(m_data + index);
207 template<
int StoreMode,
typename PacketType>
212 return pstoret<Scalar, PacketType, StoreMode>
213 (
const_cast<Scalar*
>(m_data) + row * m_outerStride.value() +
col,
x);
215 return pstoret<Scalar, PacketType, StoreMode>
216 (
const_cast<Scalar*
>(m_data) + row + col * m_outerStride.value(),
x);
219 template<
int StoreMode,
typename PacketType>
223 return pstoret<Scalar, PacketType, StoreMode>(
const_cast<Scalar*
>(m_data) + index, x);
231 :
int(IsRowMajor) ? ColsAtCompileTime
235 template<
typename Scalar,
int Rows,
int Cols,
int Options,
int MaxRows,
int MaxCols>
237 :
evaluator<PlainObjectBase<Matrix<Scalar, Rows, Cols, Options, MaxRows, MaxCols> > >
248 template<
typename Scalar,
int Rows,
int Cols,
int Options,
int MaxRows,
int MaxCols>
250 :
evaluator<PlainObjectBase<Array<Scalar, Rows, Cols, Options, MaxRows, MaxCols> > >
263 template<
typename ArgType>
275 EIGEN_DEVICE_FUNC
explicit unary_evaluator(
const XprType&
t) : m_argImpl(t.nestedExpression()) {}
283 return m_argImpl.coeff(col, row);
289 return m_argImpl.coeff(index);
295 return m_argImpl.coeffRef(col, row);
301 return m_argImpl.coeffRef(index);
304 template<
int LoadMode,
typename PacketType>
308 return m_argImpl.template packet<LoadMode,PacketType>(
col,
row);
311 template<
int LoadMode,
typename PacketType>
315 return m_argImpl.template packet<LoadMode,PacketType>(index);
318 template<
int StoreMode,
typename PacketType>
322 m_argImpl.template writePacket<StoreMode,PacketType>(
col,
row,
x);
325 template<
int StoreMode,
typename PacketType>
329 m_argImpl.template writePacket<StoreMode,PacketType>(index,
x);
340 template<
typename Scalar,
typename NullaryOp,
346 template <
typename IndexType>
348 template <
typename IndexType>
351 template <
typename T,
typename IndexType> EIGEN_DEVICE_FUNC
EIGEN_STRONG_INLINE T
packetOp(
const NullaryOp& op, IndexType
i, IndexType
j)
const {
return op.template packetOp<T>(
i,
j); }
352 template <
typename T,
typename IndexType> EIGEN_DEVICE_FUNC
EIGEN_STRONG_INLINE T
packetOp(
const NullaryOp& op, IndexType
i)
const {
return op.template packetOp<T>(
i); }
355 template<
typename Scalar,
typename NullaryOp>
358 template <
typename IndexType>
360 template <
typename T,
typename IndexType> EIGEN_DEVICE_FUNC
EIGEN_STRONG_INLINE T
packetOp(
const NullaryOp& op, IndexType=0, IndexType=0)
const {
return op.template packetOp<T>(); }
363 template<
typename Scalar,
typename NullaryOp>
366 template <
typename IndexType>
368 template <
typename T,
typename IndexType> EIGEN_DEVICE_FUNC
EIGEN_STRONG_INLINE T
packetOp(
const NullaryOp& op, IndexType
i, IndexType
j=0)
const {
return op.template packetOp<T>(
i,
j); }
374 template<
typename Scalar,
typename NullaryOp>
377 template <
typename IndexType>
384 return op.template packetOp<T>(i+
j);
387 template <
typename IndexType>
389 template <
typename T,
typename IndexType>
393 template<
typename Scalar,
typename NullaryOp>
396 #if 0 && EIGEN_COMP_MSVC>0 414 template<
typename T>
struct nullary_wrapper_workaround_msvc {
415 nullary_wrapper_workaround_msvc(
const T&);
419 template<
typename Scalar,
typename NullaryOp>
422 template <
typename IndexType>
423 EIGEN_DEVICE_FUNC
EIGEN_STRONG_INLINE Scalar operator()(
const NullaryOp& op, IndexType
i, IndexType
j)
const {
429 template <
typename IndexType>
430 EIGEN_DEVICE_FUNC
EIGEN_STRONG_INLINE Scalar operator()(
const NullaryOp& op, IndexType i)
const {
437 template <
typename T,
typename IndexType>
438 EIGEN_DEVICE_FUNC
EIGEN_STRONG_INLINE T packetOp(
const NullaryOp& op, IndexType i, IndexType j)
const {
444 template <
typename T,
typename IndexType>
452 #endif // MSVC workaround 454 template<
typename NullaryOp,
typename PlainObjectType>
473 : m_functor(n.functor()), m_wrapper()
480 template <
typename IndexType>
484 return m_wrapper(m_functor, row, col);
487 template <
typename IndexType>
489 CoeffReturnType
coeff(IndexType index)
const 491 return m_wrapper(m_functor,index);
494 template<
int LoadMode,
typename PacketType,
typename IndexType>
498 return m_wrapper.template packetOp<PacketType>(m_functor,
row,
col);
501 template<
int LoadMode,
typename PacketType,
typename IndexType>
505 return m_wrapper.template packetOp<PacketType>(m_functor, index);
515 template<
typename UnaryOp,
typename ArgType>
531 : m_functor(op.functor()),
532 m_argImpl(op.nestedExpression())
543 return m_functor(m_argImpl.coeff(row, col));
549 return m_functor(m_argImpl.coeff(index));
552 template<
int LoadMode,
typename PacketType>
556 return m_functor.packetOp(m_argImpl.template packet<LoadMode, PacketType>(row, col));
559 template<
int LoadMode,
typename PacketType>
563 return m_functor.packetOp(m_argImpl.template packet<LoadMode, PacketType>(index));
574 template<
typename TernaryOp,
typename Arg1,
typename Arg2,
typename Arg3>
581 EIGEN_DEVICE_FUNC
explicit evaluator(
const XprType& xpr) : Base(xpr) {}
584 template<
typename TernaryOp,
typename Arg1,
typename Arg2,
typename Arg3>
598 Flags0 = (
int(Arg1Flags) |
int(Arg2Flags) |
int(Arg3Flags)) & (
600 | (
int(Arg1Flags) &
int(Arg2Flags) &
int(Arg3Flags) &
613 : m_functor(xpr.functor()),
614 m_arg1Impl(xpr.arg1()),
615 m_arg2Impl(xpr.arg2()),
616 m_arg3Impl(xpr.arg3())
627 return m_functor(m_arg1Impl.coeff(row, col), m_arg2Impl.coeff(row, col), m_arg3Impl.coeff(row, col));
633 return m_functor(m_arg1Impl.coeff(index), m_arg2Impl.coeff(index), m_arg3Impl.coeff(index));
636 template<
int LoadMode,
typename PacketType>
640 return m_functor.packetOp(m_arg1Impl.template packet<LoadMode,PacketType>(row, col),
641 m_arg2Impl.template packet<LoadMode,PacketType>(row, col),
642 m_arg3Impl.template packet<LoadMode,PacketType>(row, col));
645 template<
int LoadMode,
typename PacketType>
649 return m_functor.packetOp(m_arg1Impl.template packet<LoadMode,PacketType>(index),
650 m_arg2Impl.template packet<LoadMode,PacketType>(index),
651 m_arg3Impl.template packet<LoadMode,PacketType>(index));
664 template<
typename BinaryOp,
typename Lhs,
typename Rhs>
671 EIGEN_DEVICE_FUNC
explicit evaluator(
const XprType& xpr) : Base(xpr) {}
674 template<
typename BinaryOp,
typename Lhs,
typename Rhs>
687 Flags0 = (
int(LhsFlags) |
int(RhsFlags)) & (
689 | (
int(LhsFlags) &
int(RhsFlags) &
690 ( (StorageOrdersAgree ? LinearAccessBit : 0)
700 : m_functor(xpr.functor()),
701 m_lhsImpl(xpr.lhs()),
713 return m_functor(m_lhsImpl.coeff(row, col), m_rhsImpl.coeff(row, col));
719 return m_functor(m_lhsImpl.coeff(index), m_rhsImpl.coeff(index));
722 template<
int LoadMode,
typename PacketType>
726 return m_functor.packetOp(m_lhsImpl.template packet<LoadMode,PacketType>(row, col),
727 m_rhsImpl.template packet<LoadMode,PacketType>(row, col));
730 template<
int LoadMode,
typename PacketType>
734 return m_functor.packetOp(m_lhsImpl.template packet<LoadMode,PacketType>(index),
735 m_rhsImpl.template packet<LoadMode,PacketType>(index));
746 template<
typename UnaryOp,
typename ArgType>
761 : m_unaryOp(op.functor()),
762 m_argImpl(op.nestedExpression())
774 return m_unaryOp(m_argImpl.coeff(row, col));
780 return m_unaryOp(m_argImpl.coeff(index));
786 return m_unaryOp(m_argImpl.coeffRef(row, col));
792 return m_unaryOp(m_argImpl.coeffRef(index));
804 template<
typename Derived,
typename PlainObjectType>
807 template<
typename Derived,
typename PlainObjectType>
816 IsRowMajor = XprType::RowsAtCompileTime,
817 ColsAtCompileTime = XprType::ColsAtCompileTime,
822 : m_data(const_cast<PointerType>(map.
data())),
823 m_innerStride(map.innerStride()),
824 m_outerStride(map.outerStride())
827 PACKET_ACCESS_REQUIRES_TO_HAVE_INNER_STRIDE_FIXED_TO_1);
834 return m_data[col * colStride() + row * rowStride()];
840 return m_data[index * m_innerStride.value()];
846 return m_data[col * colStride() + row * rowStride()];
852 return m_data[index * m_innerStride.value()];
855 template<
int LoadMode,
typename PacketType>
859 PointerType
ptr = m_data + row * rowStride() + col * colStride();
860 return internal::ploadt<PacketType, LoadMode>(
ptr);
863 template<
int LoadMode,
typename PacketType>
867 return internal::ploadt<PacketType, LoadMode>(m_data + index * m_innerStride.value());
870 template<
int StoreMode,
typename PacketType>
874 PointerType
ptr = m_data + row * rowStride() + col * colStride();
875 return internal::pstoret<Scalar, PacketType, StoreMode>(
ptr,
x);
878 template<
int StoreMode,
typename PacketType>
882 internal::pstoret<Scalar, PacketType, StoreMode>(m_data + index * m_innerStride.value(),
x);
886 inline Index rowStride()
const {
return XprType::IsRowMajor ? m_outerStride.value() : m_innerStride.value(); }
888 inline Index colStride()
const {
return XprType::IsRowMajor ? m_innerStride.value() : m_outerStride.value(); }
895 template<
typename PlainObjectType,
int MapOptions,
typename Str
ideType>
897 :
public mapbase_evaluator<Map<PlainObjectType, MapOptions, StrideType>, PlainObjectType>
905 InnerStrideAtCompileTime = StrideType::InnerStrideAtCompileTime == 0
906 ?
int(PlainObjectType::InnerStrideAtCompileTime)
907 :
int(StrideType::InnerStrideAtCompileTime),
908 OuterStrideAtCompileTime = StrideType::OuterStrideAtCompileTime == 0
909 ?
int(PlainObjectType::OuterStrideAtCompileTime)
910 :
int(StrideType::OuterStrideAtCompileTime),
911 HasNoInnerStride = InnerStrideAtCompileTime == 1,
912 HasNoOuterStride = StrideType::OuterStrideAtCompileTime == 0,
913 HasNoStride = HasNoInnerStride && HasNoOuterStride,
914 IsDynamicSize = PlainObjectType::SizeAtCompileTime==
Dynamic,
916 PacketAccessMask = bool(HasNoInnerStride) ? ~
int(0) : ~
int(PacketAccessBit),
917 LinearAccessMask = bool(HasNoStride) || bool(PlainObjectType::IsVectorAtCompileTime) ? ~
int(0) : ~
int(LinearAccessBit),
918 Flags =
int(
evaluator<PlainObjectType>::Flags) & (LinearAccessMask&PacketAccessMask),
923 EIGEN_DEVICE_FUNC
explicit evaluator(
const XprType& map)
930 template<
typename PlainObjectType,
int RefOptions,
typename Str
ideType>
932 :
public mapbase_evaluator<Ref<PlainObjectType, RefOptions, StrideType>, PlainObjectType>
948 template<
typename ArgType,
int BlockRows,
int BlockCols,
bool InnerPanel,
951 template<
typename ArgType,
int BlockRows,
int BlockCols,
bool InnerPanel>
969 IsRowMajor = (MaxRowsAtCompileTime==1 && MaxColsAtCompileTime!=1) ? 1
970 : (MaxColsAtCompileTime==1 && MaxRowsAtCompileTime!=1) ? 0
972 HasSameStorageOrderAsArgType = (IsRowMajor == ArgTypeIsRowMajor),
973 InnerSize = IsRowMajor ?
int(ColsAtCompileTime) : int(RowsAtCompileTime),
974 InnerStrideAtCompileTime = HasSameStorageOrderAsArgType
977 OuterStrideAtCompileTime = HasSameStorageOrderAsArgType
980 MaskPacketAccessBit = (InnerStrideAtCompileTime == 1 || HasSameStorageOrderAsArgType) ? PacketAccessBit : 0,
982 FlagsLinearAccessBit = (RowsAtCompileTime == 1 || ColsAtCompileTime == 1 || (InnerPanel && (
evaluator<ArgType>::Flags&LinearAccessBit))) ? LinearAccessBit : 0,
986 MaskPacketAccessBit),
987 Flags = Flags0 | FlagsLinearAccessBit | FlagsRowMajorBit,
990 Alignment0 = (InnerPanel && (OuterStrideAtCompileTime!=
Dynamic)
991 && (OuterStrideAtCompileTime!=0)
992 && (((OuterStrideAtCompileTime * int(sizeof(Scalar))) % int(PacketAlignment)) == 0)) ? int(PacketAlignment) : 0,
996 EIGEN_DEVICE_FUNC
explicit evaluator(
const XprType&
block) : block_evaluator_type(block)
1003 template<
typename ArgType,
int BlockRows,
int BlockCols,
bool InnerPanel>
1014 template<
typename ArgType,
int BlockRows,
int BlockCols,
bool InnerPanel>
1016 :
evaluator_base<Block<ArgType, BlockRows, BlockCols, InnerPanel> >
1021 : m_argImpl(block.nestedExpression()),
1022 m_startRow(block.startRow()),
1023 m_startCol(block.startCol()),
1024 m_linear_offset(InnerPanel?(XprType::IsRowMajor ? block.startRow()*block.
cols() : block.startCol()*block.
rows()):0)
1031 RowsAtCompileTime = XprType::RowsAtCompileTime,
1038 return m_argImpl.coeff(m_startRow.value() +
row, m_startCol.value() +
col);
1044 if (ForwardLinearAccess)
1045 return m_argImpl.coeff(m_linear_offset.value() + index);
1047 return coeff(RowsAtCompileTime == 1 ? 0 : index, RowsAtCompileTime == 1 ? index : 0);
1053 return m_argImpl.coeffRef(m_startRow.value() +
row, m_startCol.value() +
col);
1059 if (ForwardLinearAccess)
1060 return m_argImpl.coeffRef(m_linear_offset.value() + index);
1062 return coeffRef(RowsAtCompileTime == 1 ? 0 : index, RowsAtCompileTime == 1 ? index : 0);
1065 template<
int LoadMode,
typename PacketType>
1069 return m_argImpl.template packet<LoadMode,PacketType>(m_startRow.value() +
row, m_startCol.value() +
col);
1072 template<
int LoadMode,
typename PacketType>
1076 if (ForwardLinearAccess)
1077 return m_argImpl.template packet<LoadMode,PacketType>(m_linear_offset.value() + index);
1079 return packet<LoadMode,PacketType>(RowsAtCompileTime == 1 ? 0 : index,
1080 RowsAtCompileTime == 1 ? index : 0);
1083 template<
int StoreMode,
typename PacketType>
1087 return m_argImpl.template writePacket<StoreMode,PacketType>(m_startRow.value() +
row, m_startCol.value() +
col,
x);
1090 template<
int StoreMode,
typename PacketType>
1094 if (ForwardLinearAccess)
1095 return m_argImpl.template writePacket<StoreMode,PacketType>(m_linear_offset.value() + index,
x);
1097 return writePacket<StoreMode,PacketType>(RowsAtCompileTime == 1 ? 0 : index,
1098 RowsAtCompileTime == 1 ? index : 0,
1112 template<
typename ArgType,
int BlockRows,
int BlockCols,
bool InnerPanel>
1115 typename Block<ArgType, BlockRows, BlockCols, InnerPanel>::PlainObject>
1133 template<
typename ConditionMatrixType,
typename ThenMatrixType,
typename ElseMatrixType>
1135 :
evaluator_base<Select<ConditionMatrixType, ThenMatrixType, ElseMatrixType> >
1149 : m_conditionImpl(select.conditionMatrix()),
1150 m_thenImpl(select.thenMatrix()),
1151 m_elseImpl(select.elseMatrix())
1161 if (m_conditionImpl.coeff(row, col))
1162 return m_thenImpl.coeff(row, col);
1164 return m_elseImpl.coeff(row, col);
1170 if (m_conditionImpl.coeff(index))
1171 return m_thenImpl.coeff(index);
1173 return m_elseImpl.coeff(index);
1185 template<
typename ArgType,
int RowFactor,
int ColFactor>
1199 LinearAccessMask = XprType::IsVectorAtCompileTime ? LinearAccessBit : 0,
1206 : m_arg(replicate.nestedExpression()),
1208 m_rows(replicate.nestedExpression().
rows()),
1209 m_cols(replicate.nestedExpression().
cols())
1217 : RowFactor==1 ? row
1218 : row % m_rows.value();
1220 : ColFactor==1 ? col
1221 : col % m_cols.value();
1223 return m_argImpl.coeff(actual_row, actual_col);
1231 ? (ColFactor==1 ? index : index%m_cols.value())
1232 : (RowFactor==1 ? index : index%m_rows.value());
1234 return m_argImpl.coeff(actual_index);
1237 template<
int LoadMode,
typename PacketType>
1242 : RowFactor==1 ? row
1243 : row % m_rows.value();
1245 : ColFactor==1 ? col
1246 : col % m_cols.value();
1248 return m_argImpl.template packet<LoadMode,PacketType>(actual_row, actual_col);
1251 template<
int LoadMode,
typename PacketType>
1256 ? (ColFactor==1 ? index : index%m_cols.value())
1257 : (RowFactor==1 ? index : index%m_rows.value());
1259 return m_argImpl.template packet<LoadMode,PacketType>(actual_index);
1272 template<
typename ArgType,
typename MemberOp,
int Direction>
1274 :
evaluator_base<PartialReduxExpr<ArgType, MemberOp, Direction> >
1282 TraversalSize = Direction==
int(
Vertical) ?
int(ArgType::RowsAtCompileTime) :
int(ArgType::ColsAtCompileTime)
1284 typedef typename MemberOp::template Cost<InputScalar,int(TraversalSize)>
CostOpType;
1295 : m_arg(xpr.nestedExpression()), m_functor(xpr.functor())
1307 return m_functor(m_arg.col(j));
1309 return m_functor(m_arg.row(i));
1316 return m_functor(m_arg.col(index));
1318 return m_functor(m_arg.row(index));
1332 template<
typename XprType>
1351 return m_argImpl.coeff(row, col);
1357 return m_argImpl.coeff(index);
1363 return m_argImpl.coeffRef(row, col);
1369 return m_argImpl.coeffRef(index);
1372 template<
int LoadMode,
typename PacketType>
1376 return m_argImpl.template packet<LoadMode,PacketType>(
row,
col);
1379 template<
int LoadMode,
typename PacketType>
1383 return m_argImpl.template packet<LoadMode,PacketType>(index);
1386 template<
int StoreMode,
typename PacketType>
1390 m_argImpl.template writePacket<StoreMode>(
row,
col,
x);
1393 template<
int StoreMode,
typename PacketType>
1397 m_argImpl.template writePacket<StoreMode>(index,
x);
1404 template<
typename TArgType>
1415 template<
typename TArgType>
1432 template<
typename ArgType,
int Direction>
1441 IsRowMajor = XprType::IsRowMajor,
1442 IsColMajor = !IsRowMajor,
1446 || ((Direction ==
Vertical) && IsColMajor)
1447 || ((Direction ==
Horizontal) && IsRowMajor),
1455 || ((ReverseRow && XprType::ColsAtCompileTime==1) || (ReverseCol && XprType::RowsAtCompileTime==1))
1456 ? LinearAccessBit : 0,
1464 : m_argImpl(reverse.nestedExpression()),
1465 m_rows(ReverseRow ? reverse.nestedExpression().
rows() : 1),
1466 m_cols(ReverseCol ? reverse.nestedExpression().
cols() : 1)
1472 return m_argImpl.coeff(ReverseRow ? m_rows.value() - row - 1 :
row,
1473 ReverseCol ? m_cols.value() - col - 1 :
col);
1479 return m_argImpl.coeff(m_rows.value() * m_cols.value() - index - 1);
1485 return m_argImpl.coeffRef(ReverseRow ? m_rows.value() - row - 1 :
row,
1486 ReverseCol ? m_cols.value() - col - 1 :
col);
1492 return m_argImpl.coeffRef(m_rows.value() * m_cols.value() - index - 1);
1495 template<
int LoadMode,
typename PacketType>
1501 OffsetRow = ReverseRow && IsColMajor ? PacketSize : 1,
1502 OffsetCol = ReverseCol && IsRowMajor ? PacketSize : 1
1506 ReverseRow ? m_rows.value() - row - OffsetRow :
row,
1507 ReverseCol ? m_cols.value() - col - OffsetCol :
col));
1510 template<
int LoadMode,
typename PacketType>
1515 return preverse(m_argImpl.template packet<LoadMode,PacketType>(m_rows.value() * m_cols.value() - index - PacketSize));
1518 template<
int LoadMode,
typename PacketType>
1525 OffsetRow = ReverseRow && IsColMajor ? PacketSize : 1,
1526 OffsetCol = ReverseCol && IsRowMajor ? PacketSize : 1
1529 m_argImpl.template writePacket<LoadMode>(
1530 ReverseRow ? m_rows.value() - row - OffsetRow :
row,
1531 ReverseCol ? m_cols.value() - col - OffsetCol :
col,
1535 template<
int LoadMode,
typename PacketType>
1540 m_argImpl.template writePacket<LoadMode>
1541 (m_rows.value() * m_cols.value() - index - PacketSize,
preverse(x));
1556 template<
typename ArgType,
int DiagIndex>
1571 : m_argImpl(diagonal.nestedExpression()),
1572 m_index(diagonal.index())
1581 return m_argImpl.coeff(row + rowOffset(), row + colOffset());
1587 return m_argImpl.coeff(index + rowOffset(), index + colOffset());
1593 return m_argImpl.coeffRef(row + rowOffset(), row + colOffset());
1599 return m_argImpl.coeffRef(index + rowOffset(), index + colOffset());
1622 template<
typename ArgType>
1627 template<
typename ArgType>
1647 return m_arg.rows();
1652 return m_arg.cols();
1659 template<
typename ArgType>
1661 :
public evaluator<typename ArgType::PlainObject>
1668 : m_result(xpr.
arg())
1670 ::new (static_cast<Base*>(
this)) Base(m_result);
1677 ::new (static_cast<Base*>(
this)) Base(m_result);
1688 #endif // EIGEN_COREEVALUATORS_H EIGEN_STRONG_INLINE PacketType packet(Index index) const
EIGEN_DEVICE_FUNC unary_evaluator(const XprType &replicate)
EIGEN_DEVICE_FUNC evaluator_wrapper_base(const ArgType &arg)
Generic expression of a matrix where all coefficients are defined by a functor.
CwiseNullaryOp< NullaryOp, PlainObjectType > XprType
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE unary_evaluator(const XprType &op)
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(Index index) const
EIGEN_STRONG_INLINE PacketType packet(Index index) const
#define EIGEN_GENERIC_PUBLIC_INTERFACE(Derived)
internal::traits< Derived >::Scalar Scalar
storage_kind_to_evaluator_kind< typename traits< T >::StorageKind >::Kind Kind
EIGEN_STRONG_INLINE PacketType packet(IndexType row, IndexType col) const
CwiseUnaryView< UnaryOp, ArgType > XprType
#define EIGEN_STRONG_INLINE
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar & coeffRef(Index row, Index col)
CwiseUnaryOp< UnaryOp, ArgType > XprType
EIGEN_DEVICE_FUNC evaluator(const XprType &xpr)
EIGEN_DEVICE_FUNC evaluator(const XprType &block)
internal::add_const_on_value_type< ArgTypeNested >::type m_arg
Array< Scalar, Rows, Cols, Options, MaxRows, MaxCols > XprType
internal::remove_all< PlainObjectType >::type PlainObjectTypeCleaned
EIGEN_STRONG_INLINE void writePacket(Index index, const PacketType &x)
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar operator()(const NullaryOp &op, IndexType=0, IndexType=0) const
Expression of a mathematical vector or matrix as an array object.
m m block(1, 0, 2, 2)<< 4
evaluator< ConditionMatrixType > m_conditionImpl
EIGEN_DEVICE_FUNC evaluator(const XprType &xpr)
evaluator< ArgType > m_argImpl
Block< ArgType, BlockRows, BlockCols, InnerPanel > XprType
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(Index row, Index col) const
evaluator< ElseMatrixType > m_elseImpl
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T packetOp(const NullaryOp &op, IndexType i, IndexType j) const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(Index row, Index col) const
ArrayWrapper< TArgType > XprType
Block< ArgType, BlockRows, BlockCols, InnerPanel > XprType
EIGEN_DEVICE_FUNC mapbase_evaluator(const XprType &map)
Transpose< ArgType > XprType
CwiseBinaryOp< BinaryOp, Lhs, Rhs > XprType
packet_traits< Scalar >::type PacketScalar
evaluator< Arg1 > m_arg1Impl
EIGEN_STRONG_INLINE PacketType packet(Index row, Index col) const
A matrix or vector expression mapping an existing array of data.
EIGEN_DEVICE_FUNC unary_evaluator(const XprType &wrapper)
EIGEN_DEVICE_FUNC Index colStride() const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T packetOp(const NullaryOp &op, IndexType=0, IndexType=0) const
XprType::CoeffReturnType CoeffReturnType
Expression of the transpose of a matrix.
const unsigned int DirectAccessBit
EIGEN_STRONG_INLINE void writePacket(Index row, Index col, const PacketType &x)
EIGEN_STRONG_INLINE void writePacket(Index row, Index col, const PacketType &x)
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar & coeffRef(Index row, Index col)
evaluator< Arg3 > m_arg3Impl
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(Index index) const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar & coeffRef(Index row, Index col)
traits< ExpressionType > ExpressionTraits
void diagonal(const MatrixType &m)
XprType::CoeffReturnType CoeffReturnType
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(Index index) const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar & coeffRef(Index row, Index col)
evaluator< ThenMatrixType > m_thenImpl
const internal::variable_if_dynamic< Index, XprType::InnerStrideAtCompileTime > m_innerStride
#define EIGEN_PLAIN_ENUM_MAX(a, b)
EIGEN_STRONG_INLINE PacketType packet(Index index) const
EIGEN_STRONG_INLINE PacketType packet(Index row, Index col) const
Namespace containing all symbols from the Eigen library.
XprType::CoeffReturnType CoeffReturnType
const internal::nullary_wrapper< CoeffReturnType, NullaryOp > m_wrapper
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar & coeffRef(Index index)
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(Index index) const
MatrixWrapper< TArgType > XprType
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE XprType::Scalar & coeffRef(Index index)
EIGEN_DEVICE_FUNC block_evaluator(const XprType &block)
Generic expression of a partially reduxed matrix.
evaluator< ArgType > m_argImpl
Holds information about the various numeric (i.e. scalar) types allowed by Eigen. ...
EIGEN_DEVICE_FUNC evaluator()
#define EIGEN_STATIC_ASSERT(CONDITION, MSG)
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(Index index) const
EIGEN_STRONG_INLINE PacketType packet(Index index) const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(Index index) const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(Index row, Index col) const
evaluator< Rhs > m_rhsImpl
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(Index index) const
const variable_if_dynamic< Index, ArgType::RowsAtCompileTime > m_rows
const unsigned int RowMajorBit
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(Index row, Index col) const
#define EIGEN_IMPLIES(a, b)
EIGEN_STRONG_INLINE PacketType packet(IndexType index) const
evaluator< ArgType > m_argImpl
EIGEN_DEVICE_FUNC unary_evaluator(const XprType &op)
XprType::CoeffReturnType CoeffReturnType
packet_traits< Scalar >::type PacketScalar
internal::nested_eval< ArgType, 1 >::type ArgTypeNested
const unsigned int PacketAccessBit
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index colOffset() const
EIGEN_STRONG_INLINE PacketType packet(Index index) const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(Index index) const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(Index row, Index col) const
evaluator< ArgType > m_argImpl
EIGEN_DEVICE_FUNC Index rowStride() const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar & coeffRef(Index row, Index)
unary_evaluator< T > Base
EIGEN_DEVICE_FUNC evaluator(const XprType &n)
Generic lvalue expression of a coefficient-wise unary operator of a matrix or a vector.
Expression of an array as a mathematical vector or matrix.
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T packetOp(const NullaryOp &op, IndexType i, IndexType j=0) const
evaluator< ArgTypeNestedCleaned > m_argImpl
const NullaryOp m_functor
XprType::CoeffReturnType CoeffReturnType
EIGEN_DEVICE_FUNC evaluator(const T &xpr)
EIGEN_DEVICE_FUNC unary_evaluator(const XprType &reverse)
#define EIGEN_INTERNAL_CHECK_COST_VALUE(C)
Generic expression where a coefficient-wise binary operator is applied to two expressions.
const unsigned int HereditaryBits
XprType::CoeffReturnType CoeffReturnType
MemberOp::template Cost< InputScalar, int(TraversalSize)> CostOpType
XprType::CoeffReturnType CoeffReturnType
EIGEN_DEVICE_FUNC unary_evaluator(const XprType &t)
void replicate(const MatrixType &m)
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T value()
block_evaluator< ArgType, BlockRows, BlockCols, InnerPanel > block_evaluator_type
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar operator()(const NullaryOp &op, IndexType i) const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar operator()(const NullaryOp &op, IndexType i, IndexType j=0) const
EIGEN_STRONG_INLINE void writePacket(Index row, Index col, const PacketType &x)
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(Index row, Index col) const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(Index index) const
EIGEN_DEVICE_FUNC evaluator(const T &xpr)
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(Index index) const
EIGEN_STRONG_INLINE PacketType packet(Index index) const
EIGEN_DEVICE_FUNC unary_evaluator(const XprType &block)
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(Index row, Index col) const
Block< ArgType, BlockRows, BlockCols, InnerPanel > XprType
EIGEN_DEVICE_FUNC evaluator(const XprType xpr)
EvalToTemp< ArgType > XprType
const variable_if_dynamic< Index, ReverseRow?ArgType::RowsAtCompileTime:1 > m_rows
EIGEN_STRONG_INLINE void writePacket(Index index, const PacketType &x)
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(Index index) const
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
EIGEN_STRONG_INLINE PacketType packet(Index row, Index col) const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar operator()(const NullaryOp &op, IndexType i) const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(Index row, Index col) const
EIGEN_DEVICE_FUNC evaluator(const XprType &m)
dense_xpr_base< EvalToTemp >::type Base
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar & coeffRef(Index index)
EIGEN_STRONG_INLINE PacketType packet(Index row, Index col) const
Eigen::Triplet< double > T
Generic expression where a coefficient-wise ternary operator is applied to two expressions.
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T packetOp(const NullaryOp &op, IndexType i) const
evaluator< Arg2 > m_arg2Impl
Expression of the multiple replication of a matrix or vector.
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar & coeffRef(Index index)
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(Index row, Index col) const
EIGEN_STRONG_INLINE PacketType packet(Index row, Index col) const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar coeff(Index index) const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T packetOp(const NullaryOp &op, IndexType i, IndexType j) const
XprType::CoeffReturnType CoeffReturnType
const internal::variable_if_dynamicindex< Index, XprType::DiagIndex > m_index
Ref< PlainObjectType, RefOptions, StrideType > XprType
evaluator< ArgType > m_argImpl
EIGEN_STRONG_INLINE void writePacket(Index row, Index col, const PacketType &x)
evaluator< Lhs > m_lhsImpl
PlainObjectType::CoeffReturnType CoeffReturnType
TranspositionsShape Shape
Replicate< ArgType, RowFactor, ColFactor > XprType
const variable_if_dynamic< Index, InnerPanel?Dynamic:0 > m_linear_offset
CwiseTernaryOp< TernaryOp, Arg1, Arg2, Arg3 > XprType
Map< PlainObjectType, MapOptions, StrideType > XprType
const variable_if_dynamic< Index, ArgType::ColsAtCompileTime > m_cols
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(IndexType index) const
const variable_if_dynamic< Index,(ArgType::RowsAtCompileTime==1 &&BlockRows==1)?0:Dynamic > m_startRow
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar coeff(Index i, Index j) const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T packetOp(const NullaryOp &op, IndexType i) const
EIGEN_DEVICE_FUNC evaluator(const XprType &xpr)
EIGEN_STRONG_INLINE void writePacket(Index row, Index col, const PacketType &x)
EIGEN_STRONG_INLINE PacketType packet(Index row, Index col) const
EIGEN_DEVICE_FUNC evaluator()
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar & coeffRef(Index index)
Reference counting helper.
Block< ArgType, BlockRows, BlockCols, InnerPanel > XprType
XprType::CoeffReturnType CoeffReturnType
const TernaryOp m_functor
EIGEN_STRONG_INLINE PacketType packet(Index row, Index col) const
Matrix< Scalar, Rows, Cols, Options, MaxRows, MaxCols > XprType
EIGEN_DEVICE_FUNC evaluator()
evaluator< ArgType > m_argImpl
A matrix or vector expression mapping an existing expression.
binary_evaluator< CwiseBinaryOp< BinaryOp, Lhs, Rhs > > Base
ternary_evaluator< CwiseTernaryOp< TernaryOp, Arg1, Arg2, Arg3 > > Base
const internal::variable_if_dynamic< Index, XprType::OuterStrideAtCompileTime > m_outerStride
EIGEN_DEVICE_FUNC evaluator(const XprType &ref)
EIGEN_DEVICE_FUNC evaluator(const PlainObjectType &m)
EIGEN_STRONG_INLINE void writePacket(Index index, const PacketType &x)
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar & coeffRef(Index row, Index col)
EIGEN_STRONG_INLINE void writePacket(Index index, const PacketType &x)
ArgType::PlainObject PlainObject
CwiseTernaryOp< TernaryOp, Arg1, Arg2, Arg3 > XprType
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar & coeffRef(Index row, Index col)
evaluator< ArgType > m_argImpl
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar & coeffRef(Index index)
EIGEN_DEVICE_FUNC unary_evaluator(const XprType &wrapper)
Expression of a fixed-size or dynamic-size block.
XprType::CoeffReturnType CoeffReturnType
EIGEN_DEVICE_FUNC ternary_evaluator(const XprType &xpr)
void reverse(const MatrixType &m)
#define EIGEN_PLAIN_ENUM_MIN(a, b)
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(Index index) const
PlainObjectBase< Derived > PlainObjectType
storage_kind_to_shape< typename traits< BandMatrixWrapper< _CoefficientsType, _Rows, _Cols, _Supers, _Subs, _Options > >::StorageKind >::Shape Shape
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(IndexType row, IndexType col) const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(Index row, Index col) const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(Index row, Index col) const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar operator()(const NullaryOp &op, IndexType i, IndexType j) const
EIGEN_DEVICE_FUNC evaluator(const XprType &diagonal)
XprType::PointerType PointerType
evaluator< PlainObject > Base
General-purpose arrays with easy API for coefficient-wise operations.
CwiseBinaryOp< BinaryOp, Lhs, Rhs > XprType
const ArgTypeNested m_arg
EIGEN_STRONG_INLINE PacketType packet(Index row, Index col) const
EIGEN_STRONG_INLINE PacketType packet(Index index) const
EIGEN_STRONG_INLINE PacketType packet(Index index) const
XprType::CoeffReturnType CoeffReturnType
Diagonal< ArgType, DiagIndex > XprType
const ArgType & arg() const
remove_all< typename XprType::NestedExpressionType >::type ArgType
Base::PointerType PointerType
EIGEN_STRONG_INLINE void writePacket(Index index, const PacketType &x)
variable_if_dynamic< Index, IsVectorAtCompileTime?0:int(IsRowMajor)?ColsAtCompileTime:RowsAtCompileTime > m_outerStride
ArgType::Scalar InputScalar
const variable_if_dynamic< Index,(ArgType::ColsAtCompileTime==1 &&BlockCols==1)?0:Dynamic > m_startCol
Expression of a diagonal/subdiagonal/superdiagonal in a matrix.
EIGEN_STRONG_INLINE void writePacket(Index index, const PacketType &x)
EIGEN_DEVICE_FUNC evaluator(const XprType &map)
internal::remove_all< ArgTypeNested >::type ArgTypeNestedCleaned
const unsigned int EvalBeforeNestingBit
const variable_if_dynamic< Index, ReverseCol?ArgType::ColsAtCompileTime:1 > m_cols
XprType::CoeffReturnType CoeffReturnType
Generic expression where a coefficient-wise unary operator is applied to an expression.
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar & coeffRef(Index row, Index col)
EIGEN_DEVICE_FUNC evaluator(const XprType &select)
EIGEN_STRONG_INLINE void writePacket(Index row, Index col, const PacketType &x)
internal::nested_eval< ArgType, Factor >::type ArgTypeNested
The matrix class, also used for vectors and row-vectors.
EIGEN_STRONG_INLINE PacketType packet(Index row, Index col) const
Expression of the reverse of a vector or matrix.
EIGEN_STRONG_INLINE PacketType packet(Index index) const
void run(Expr &expr, Dev &dev)
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy x
PartialReduxExpr< ArgType, MemberOp, Direction > XprType
Reverse< ArgType, Direction > XprType
XprType::CoeffReturnType CoeffReturnType
EIGEN_DEVICE_FUNC evaluator(const ArgType &arg)
EIGEN_DEVICE_FUNC block_evaluator(const XprType &block)
PlainObjectType::Scalar Scalar
EIGEN_DEVICE_FUNC evaluator(const XprType &m)
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar operator()(const NullaryOp &op, IndexType i, IndexType j) const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(Index row, Index col) const
const unsigned int LinearAccessBit
ArgType::CoeffReturnType CoeffReturnType
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index rowOffset() const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar & coeffRef(Index index)
EIGEN_STRONG_INLINE PacketType packet(Index index) const
EIGEN_STRONG_INLINE PacketType packet(Index row, Index col) const
Select< ConditionMatrixType, ThenMatrixType, ElseMatrixType > XprType
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(Index index) const
EIGEN_STRONG_INLINE Packet2cf preverse(const Packet2cf &a)
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(Index row, Index) const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar & coeffRef(Index index)
EIGEN_DEVICE_FUNC binary_evaluator(const XprType &xpr)
Expression of a coefficient wise version of the C++ ternary operator ?:
internal::remove_all< ArgTypeNested >::type ArgTypeNestedCleaned