12 #ifndef EIGEN_ASSIGN_EVALUATOR_H 13 #define EIGEN_ASSIGN_EVALUATOR_H 27 template <
typename DstEvaluator,
typename SrcEvaluator,
typename AssignFunc>
30 typedef typename DstEvaluator::XprType Dst;
31 typedef typename Dst::Scalar DstScalar;
34 DstFlags = DstEvaluator::Flags,
35 SrcFlags = SrcEvaluator::Flags
40 DstAlignment = DstEvaluator::Alignment,
41 SrcAlignment = SrcEvaluator::Alignment,
43 JointAlignment = EIGEN_PLAIN_ENUM_MIN(DstAlignment,SrcAlignment)
48 InnerSize = int(Dst::IsVectorAtCompileTime) ? int(Dst::SizeAtCompileTime)
49 : int(DstFlags)&
RowMajorBit ? int(Dst::ColsAtCompileTime)
50 : int(Dst::RowsAtCompileTime),
51 InnerMaxSize = int(Dst::IsVectorAtCompileTime) ? int(Dst::MaxSizeAtCompileTime)
52 : int(DstFlags)&
RowMajorBit ? int(Dst::MaxColsAtCompileTime)
53 : int(Dst::MaxRowsAtCompileTime),
55 MaxSizeAtCompileTime = Dst::SizeAtCompileTime
59 typedef typename find_best_packet<DstScalar,Dst::SizeAtCompileTime>::type LinearPacketType;
60 typedef typename find_best_packet<DstScalar,InnerSize>::type InnerPacketType;
77 StorageOrdersAgree = (int(DstIsRowMajor) == int(SrcIsRowMajor)),
78 MightVectorize =
bool(StorageOrdersAgree)
79 && (int(DstFlags) & int(SrcFlags) & ActualPacketAccessBit)
81 MayInnerVectorize = MightVectorize
82 && int(InnerSize)!=
Dynamic && int(InnerSize)%int(InnerPacketSize)==0
84 && (EIGEN_UNALIGNED_VECTORIZE || int(JointAlignment)>=int(InnerRequiredAlignment)),
85 MayLinearize =
bool(StorageOrdersAgree) && (int(DstFlags) & int(SrcFlags) &
LinearAccessBit),
86 MayLinearVectorize =
bool(MightVectorize) && MayLinearize && DstHasDirectAccess
87 && (EIGEN_UNALIGNED_VECTORIZE || (int(DstAlignment)>=int(LinearRequiredAlignment)) || MaxSizeAtCompileTime ==
Dynamic),
90 MaySliceVectorize = bool(MightVectorize) && bool(DstHasDirectAccess)
91 && (int(InnerMaxSize)==
Dynamic || int(InnerMaxSize)>=(EIGEN_UNALIGNED_VECTORIZE?InnerPacketSize:(3*InnerPacketSize)))
100 Traversal = int(MayLinearVectorize) && (LinearPacketSize>InnerPacketSize) ?
int(LinearVectorizedTraversal)
101 : int(MayInnerVectorize) ? int(InnerVectorizedTraversal)
102 : int(MayLinearVectorize) ? int(LinearVectorizedTraversal)
103 : int(MaySliceVectorize) ? int(SliceVectorizedTraversal)
104 : int(MayLinearize) ? int(LinearTraversal)
105 : int(DefaultTraversal),
106 Vectorized = int(Traversal) == InnerVectorizedTraversal
107 || int(Traversal) == LinearVectorizedTraversal
108 || int(Traversal) == SliceVectorizedTraversal
111 typedef typename conditional<int(Traversal)==LinearVectorizedTraversal, LinearPacketType, InnerPacketType>::type PacketType;
115 ActualPacketSize = int(Traversal)==LinearVectorizedTraversal ? LinearPacketSize
116 : Vectorized ? InnerPacketSize
118 UnrollingLimit = EIGEN_UNROLLING_LIMIT * ActualPacketSize,
119 MayUnrollCompletely = int(Dst::SizeAtCompileTime) !=
Dynamic 120 && int(Dst::SizeAtCompileTime) * (int(DstEvaluator::CoeffReadCost)+int(SrcEvaluator::CoeffReadCost)) <=
int(UnrollingLimit),
121 MayUnrollInner = int(InnerSize) !=
Dynamic 122 && int(InnerSize) * (int(DstEvaluator::CoeffReadCost)+int(SrcEvaluator::CoeffReadCost)) <=
int(UnrollingLimit)
127 Unrolling = (int(Traversal) == int(InnerVectorizedTraversal) || int(Traversal) == int(DefaultTraversal))
129 int(MayUnrollCompletely) ? int(CompleteUnrolling)
130 : int(MayUnrollInner) ? int(InnerUnrolling)
133 :
int(Traversal) == int(LinearVectorizedTraversal)
134 ? ( bool(MayUnrollCompletely) && ( EIGEN_UNALIGNED_VECTORIZE || (int(DstAlignment)>=int(LinearRequiredAlignment)))
135 ? int(CompleteUnrolling)
137 :
int(Traversal) == int(LinearTraversal)
138 ? ( bool(MayUnrollCompletely) ? int(CompleteUnrolling)
140 #
if EIGEN_UNALIGNED_VECTORIZE
141 :
int(Traversal) == int(SliceVectorizedTraversal)
142 ? ( bool(MayUnrollInner) ? int(InnerUnrolling)
148 #ifdef EIGEN_DEBUG_ASSIGN 151 std::cerr <<
"DstXpr: " <<
typeid(
typename DstEvaluator::XprType).name() << std::endl;
152 std::cerr <<
"SrcXpr: " <<
typeid(
typename SrcEvaluator::XprType).name() << std::endl;
153 std::cerr.setf(std::ios::hex, std::ios::basefield);
154 std::cerr <<
"DstFlags" <<
" = " << DstFlags <<
" (" << demangle_flags(DstFlags) <<
" )" << std::endl;
155 std::cerr <<
"SrcFlags" <<
" = " << SrcFlags <<
" (" << demangle_flags(SrcFlags) <<
" )" << std::endl;
156 std::cerr.unsetf(std::ios::hex);
157 EIGEN_DEBUG_VAR(DstAlignment)
158 EIGEN_DEBUG_VAR(SrcAlignment)
159 EIGEN_DEBUG_VAR(LinearRequiredAlignment)
160 EIGEN_DEBUG_VAR(InnerRequiredAlignment)
161 EIGEN_DEBUG_VAR(JointAlignment)
162 EIGEN_DEBUG_VAR(InnerSize)
163 EIGEN_DEBUG_VAR(InnerMaxSize)
164 EIGEN_DEBUG_VAR(LinearPacketSize)
165 EIGEN_DEBUG_VAR(InnerPacketSize)
166 EIGEN_DEBUG_VAR(ActualPacketSize)
167 EIGEN_DEBUG_VAR(StorageOrdersAgree)
168 EIGEN_DEBUG_VAR(MightVectorize)
169 EIGEN_DEBUG_VAR(MayLinearize)
170 EIGEN_DEBUG_VAR(MayInnerVectorize)
171 EIGEN_DEBUG_VAR(MayLinearVectorize)
172 EIGEN_DEBUG_VAR(MaySliceVectorize)
173 std::cerr <<
"Traversal" <<
" = " << Traversal <<
" (" << demangle_traversal(Traversal) <<
")" << std::endl;
174 EIGEN_DEBUG_VAR(SrcEvaluator::CoeffReadCost)
175 EIGEN_DEBUG_VAR(UnrollingLimit)
176 EIGEN_DEBUG_VAR(MayUnrollCompletely)
177 EIGEN_DEBUG_VAR(MayUnrollInner)
178 std::cerr <<
"Unrolling" <<
" = " << Unrolling <<
" (" << demangle_unrolling(Unrolling) <<
")" << std::endl;
179 std::cerr << std::endl;
192 template<
typename Kernel,
int Index,
int Stop>
196 typedef typename Kernel::DstEvaluatorType DstEvaluatorType;
197 typedef typename DstEvaluatorType::XprType DstXprType;
200 outer =
Index / DstXprType::InnerSizeAtCompileTime,
201 inner =
Index % DstXprType::InnerSizeAtCompileTime
204 EIGEN_DEVICE_FUNC
static EIGEN_STRONG_INLINE
void run(Kernel &kernel)
206 kernel.assignCoeffByOuterInner(outer, inner);
211 template<
typename Kernel,
int Stop>
214 EIGEN_DEVICE_FUNC
static EIGEN_STRONG_INLINE
void run(Kernel&) { }
217 template<
typename Kernel,
int Index_,
int Stop>
220 EIGEN_DEVICE_FUNC
static EIGEN_STRONG_INLINE
void run(Kernel &kernel,
Index outer)
222 kernel.assignCoeffByOuterInner(outer, Index_);
227 template<
typename Kernel,
int Stop>
230 EIGEN_DEVICE_FUNC
static EIGEN_STRONG_INLINE
void run(Kernel&,
Index) { }
237 template<
typename Kernel,
int Index,
int Stop>
240 EIGEN_DEVICE_FUNC
static EIGEN_STRONG_INLINE
void run(Kernel& kernel)
242 kernel.assignCoeff(
Index);
247 template<
typename Kernel,
int Stop>
250 EIGEN_DEVICE_FUNC
static EIGEN_STRONG_INLINE
void run(Kernel&) { }
257 template<
typename Kernel,
int Index,
int Stop>
261 typedef typename Kernel::DstEvaluatorType DstEvaluatorType;
262 typedef typename DstEvaluatorType::XprType DstXprType;
263 typedef typename Kernel::PacketType PacketType;
266 outer =
Index / DstXprType::InnerSizeAtCompileTime,
267 inner =
Index % DstXprType::InnerSizeAtCompileTime,
268 SrcAlignment = Kernel::AssignmentTraits::SrcAlignment,
269 DstAlignment = Kernel::AssignmentTraits::DstAlignment
272 EIGEN_DEVICE_FUNC
static EIGEN_STRONG_INLINE
void run(Kernel &kernel)
274 kernel.template assignPacketByOuterInner<DstAlignment, SrcAlignment, PacketType>(outer, inner);
280 template<
typename Kernel,
int Stop>
283 EIGEN_DEVICE_FUNC
static EIGEN_STRONG_INLINE
void run(Kernel&) { }
286 template<
typename Kernel,
int Index_,
int Stop,
int SrcAlignment,
int DstAlignment>
289 typedef typename Kernel::PacketType PacketType;
290 EIGEN_DEVICE_FUNC
static EIGEN_STRONG_INLINE
void run(Kernel &kernel,
Index outer)
292 kernel.template assignPacketByOuterInner<DstAlignment, SrcAlignment, PacketType>(outer, Index_);
298 template<
typename Kernel,
int Stop,
int SrcAlignment,
int DstAlignment>
301 EIGEN_DEVICE_FUNC
static EIGEN_STRONG_INLINE
void run(Kernel &,
Index) { }
310 template<
typename Kernel,
311 int Traversal = Kernel::AssignmentTraits::Traversal,
312 int Unrolling = Kernel::AssignmentTraits::Unrolling>
319 template<
typename Kernel>
322 EIGEN_DEVICE_FUNC
static void EIGEN_STRONG_INLINE run(Kernel &kernel)
324 for(
Index outer = 0; outer < kernel.outerSize(); ++outer) {
325 for(
Index inner = 0; inner < kernel.innerSize(); ++inner) {
326 kernel.assignCoeffByOuterInner(outer, inner);
332 template<
typename Kernel>
335 EIGEN_DEVICE_FUNC
static EIGEN_STRONG_INLINE
void run(Kernel &kernel)
337 typedef typename Kernel::DstEvaluatorType::XprType DstXprType;
342 template<
typename Kernel>
345 EIGEN_DEVICE_FUNC
static EIGEN_STRONG_INLINE
void run(Kernel &kernel)
347 typedef typename Kernel::DstEvaluatorType::XprType DstXprType;
349 const Index outerSize = kernel.outerSize();
350 for(
Index outer = 0; outer < outerSize; ++outer)
363 template <
bool IsAligned = false>
367 template <
typename Kernel>
368 EIGEN_DEVICE_FUNC
static EIGEN_STRONG_INLINE
void run(Kernel&,
Index,
Index) {}
378 template <
typename Kernel>
379 static EIGEN_DONT_INLINE
void run(Kernel &kernel,
383 template <
typename Kernel>
384 EIGEN_DEVICE_FUNC
static EIGEN_STRONG_INLINE
void run(Kernel &kernel,
389 for (
Index index = start; index < end; ++index)
390 kernel.assignCoeff(index);
394 template<
typename Kernel>
397 EIGEN_DEVICE_FUNC
static EIGEN_STRONG_INLINE
void run(Kernel &kernel)
399 const Index size = kernel.size();
400 typedef typename Kernel::Scalar Scalar;
401 typedef typename Kernel::PacketType
PacketType;
403 requestedAlignment = Kernel::AssignmentTraits::LinearRequiredAlignment,
405 dstIsAligned = int(Kernel::AssignmentTraits::DstAlignment)>=int(requestedAlignment),
407 : int(Kernel::AssignmentTraits::DstAlignment),
408 srcAlignment = Kernel::AssignmentTraits::JointAlignment
410 const Index alignedStart = dstIsAligned ? 0 : internal::first_aligned<requestedAlignment>(kernel.dstDataPtr(), size);
411 const Index alignedEnd = alignedStart + ((size-alignedStart)/packetSize)*packetSize;
415 for(
Index index = alignedStart; index < alignedEnd; index += packetSize)
416 kernel.template assignPacket<dstAlignment, srcAlignment, PacketType>(index);
422 template<
typename Kernel>
425 EIGEN_DEVICE_FUNC
static EIGEN_STRONG_INLINE
void run(Kernel &kernel)
427 typedef typename Kernel::DstEvaluatorType::XprType DstXprType;
428 typedef typename Kernel::PacketType
PacketType;
430 enum { size = DstXprType::SizeAtCompileTime,
432 alignedSize = (size/packetSize)*packetSize };
443 template<
typename Kernel>
446 typedef typename Kernel::PacketType PacketType;
448 SrcAlignment = Kernel::AssignmentTraits::SrcAlignment,
449 DstAlignment = Kernel::AssignmentTraits::DstAlignment
451 EIGEN_DEVICE_FUNC
static EIGEN_STRONG_INLINE
void run(Kernel &kernel)
453 const Index innerSize = kernel.innerSize();
454 const Index outerSize = kernel.outerSize();
456 for(
Index outer = 0; outer < outerSize; ++outer)
457 for(
Index inner = 0; inner < innerSize; inner+=packetSize)
458 kernel.template assignPacketByOuterInner<DstAlignment, SrcAlignment, PacketType>(outer, inner);
462 template<
typename Kernel>
465 EIGEN_DEVICE_FUNC
static EIGEN_STRONG_INLINE
void run(Kernel &kernel)
467 typedef typename Kernel::DstEvaluatorType::XprType DstXprType;
472 template<
typename Kernel>
475 EIGEN_DEVICE_FUNC
static EIGEN_STRONG_INLINE
void run(Kernel &kernel)
477 typedef typename Kernel::DstEvaluatorType::XprType DstXprType;
478 typedef typename Kernel::AssignmentTraits Traits;
479 const Index outerSize = kernel.outerSize();
480 for(
Index outer = 0; outer < outerSize; ++outer)
482 Traits::SrcAlignment, Traits::DstAlignment>::run(kernel, outer);
490 template<
typename Kernel>
493 EIGEN_DEVICE_FUNC
static EIGEN_STRONG_INLINE
void run(Kernel &kernel)
495 const Index size = kernel.size();
496 for(
Index i = 0; i < size; ++i)
497 kernel.assignCoeff(i);
501 template<
typename Kernel>
504 EIGEN_DEVICE_FUNC
static EIGEN_STRONG_INLINE
void run(Kernel &kernel)
506 typedef typename Kernel::DstEvaluatorType::XprType DstXprType;
515 template<
typename Kernel>
518 EIGEN_DEVICE_FUNC
static inline void run(Kernel &kernel)
520 typedef typename Kernel::Scalar Scalar;
521 typedef typename Kernel::PacketType
PacketType;
524 requestedAlignment = int(Kernel::AssignmentTraits::InnerRequiredAlignment),
526 dstIsAligned =
int(Kernel::AssignmentTraits::DstAlignment)>=int(requestedAlignment),
527 dstAlignment = alignable ? int(requestedAlignment)
528 : int(Kernel::AssignmentTraits::DstAlignment)
530 const Scalar *dst_ptr = kernel.dstDataPtr();
531 if((!
bool(dstIsAligned)) && (UIntPtr(dst_ptr) %
sizeof(Scalar))>0)
536 const Index packetAlignedMask = packetSize - 1;
537 const Index innerSize = kernel.innerSize();
538 const Index outerSize = kernel.outerSize();
539 const Index alignedStep = alignable ? (packetSize - kernel.outerStride() % packetSize) & packetAlignedMask : 0;
540 Index alignedStart = ((!alignable) ||
bool(dstIsAligned)) ? 0 : internal::first_aligned<requestedAlignment>(dst_ptr, innerSize);
542 for(
Index outer = 0; outer < outerSize; ++outer)
544 const Index alignedEnd = alignedStart + ((innerSize-alignedStart) & ~packetAlignedMask);
546 for(
Index inner = 0; inner<alignedStart ; ++inner)
547 kernel.assignCoeffByOuterInner(outer, inner);
550 for(
Index inner = alignedStart; inner<alignedEnd; inner+=packetSize)
551 kernel.template assignPacketByOuterInner<dstAlignment, Unaligned, PacketType>(outer, inner);
554 for(
Index inner = alignedEnd; inner<innerSize ; ++inner)
555 kernel.assignCoeffByOuterInner(outer, inner);
557 alignedStart = numext::mini((alignedStart+alignedStep)%packetSize, innerSize);
562 #if EIGEN_UNALIGNED_VECTORIZE 563 template<
typename Kernel>
566 EIGEN_DEVICE_FUNC
static inline void run(Kernel &kernel)
568 typedef typename Kernel::DstEvaluatorType::XprType DstXprType;
569 typedef typename Kernel::PacketType
PacketType;
571 enum { size = DstXprType::InnerSizeAtCompileTime,
573 vectorizableSize = (size/packetSize)*packetSize };
575 for(
Index outer = 0; outer < kernel.outerSize(); ++outer)
595 template<
typename DstEvaluatorTypeT,
typename SrcEvaluatorTypeT,
typename Functor,
int Version = Specialized>
599 typedef typename DstEvaluatorTypeT::XprType DstXprType;
600 typedef typename SrcEvaluatorTypeT::XprType SrcXprType;
603 typedef DstEvaluatorTypeT DstEvaluatorType;
604 typedef SrcEvaluatorTypeT SrcEvaluatorType;
605 typedef typename DstEvaluatorType::Scalar Scalar;
607 typedef typename AssignmentTraits::PacketType PacketType;
611 : m_dst(dst), m_src(src), m_functor(func), m_dstExpr(dstExpr)
613 #ifdef EIGEN_DEBUG_ASSIGN 614 AssignmentTraits::debug();
618 EIGEN_DEVICE_FUNC
Index size()
const {
return m_dstExpr.size(); }
619 EIGEN_DEVICE_FUNC
Index innerSize()
const {
return m_dstExpr.innerSize(); }
620 EIGEN_DEVICE_FUNC
Index outerSize()
const {
return m_dstExpr.outerSize(); }
621 EIGEN_DEVICE_FUNC
Index rows()
const {
return m_dstExpr.rows(); }
622 EIGEN_DEVICE_FUNC
Index cols()
const {
return m_dstExpr.cols(); }
623 EIGEN_DEVICE_FUNC
Index outerStride()
const {
return m_dstExpr.outerStride(); }
625 EIGEN_DEVICE_FUNC DstEvaluatorType& dstEvaluator() {
return m_dst; }
626 EIGEN_DEVICE_FUNC
const SrcEvaluatorType& srcEvaluator()
const {
return m_src; }
631 m_functor.assignCoeff(m_dst.coeffRef(row,col), m_src.coeff(row,col));
637 m_functor.assignCoeff(m_dst.coeffRef(index), m_src.coeff(index));
643 Index row = rowIndexByOuterInner(outer, inner);
644 Index col = colIndexByOuterInner(outer, inner);
645 assignCoeff(row, col);
649 template<
int StoreMode,
int LoadMode,
typename PacketType>
650 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
void assignPacket(
Index row,
Index col)
652 m_functor.template assignPacket<StoreMode>(&m_dst.coeffRef(row,col), m_src.template packet<LoadMode,PacketType>(row,col));
655 template<
int StoreMode,
int LoadMode,
typename PacketType>
656 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
void assignPacket(
Index index)
658 m_functor.template assignPacket<StoreMode>(&m_dst.coeffRef(index), m_src.template packet<LoadMode,PacketType>(index));
661 template<
int StoreMode,
int LoadMode,
typename PacketType>
662 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
void assignPacketByOuterInner(
Index outer,
Index inner)
664 Index row = rowIndexByOuterInner(outer, inner);
665 Index col = colIndexByOuterInner(outer, inner);
666 assignPacket<StoreMode,LoadMode,PacketType>(row, col);
669 EIGEN_DEVICE_FUNC
static EIGEN_STRONG_INLINE
Index rowIndexByOuterInner(
Index outer,
Index inner)
671 typedef typename DstEvaluatorType::ExpressionTraits Traits;
672 return int(Traits::RowsAtCompileTime) == 1 ? 0
673 : int(Traits::ColsAtCompileTime) == 1 ? inner
678 EIGEN_DEVICE_FUNC
static EIGEN_STRONG_INLINE
Index colIndexByOuterInner(
Index outer,
Index inner)
680 typedef typename DstEvaluatorType::ExpressionTraits Traits;
681 return int(Traits::ColsAtCompileTime) == 1 ? 0
682 : int(Traits::RowsAtCompileTime) == 1 ? inner
687 EIGEN_DEVICE_FUNC
const Scalar* dstDataPtr()
const 689 return m_dstExpr.data();
693 DstEvaluatorType& m_dst;
694 const SrcEvaluatorType& m_src;
697 DstXprType& m_dstExpr;
704 template<
typename DstXprType,
typename SrcXprType,
typename Functor>
705 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
void call_dense_assignment_loop(DstXprType& dst,
const SrcXprType& src,
const Functor &
func)
710 SrcEvaluatorType srcEvaluator(src);
714 Index dstRows = src.rows();
715 Index dstCols = src.cols();
716 if((dst.rows()!=dstRows) || (dst.cols()!=dstCols))
717 dst.resize(dstRows, dstCols);
719 DstEvaluatorType dstEvaluator(dst);
722 Kernel kernel(dstEvaluator, srcEvaluator, func, dst.const_cast_derived());
727 template<
typename DstXprType,
typename SrcXprType>
728 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
void call_dense_assignment_loop(DstXprType& dst,
const SrcXprType& src)
750 template<
typename DstXprType,
typename SrcXprType,
typename Functor,
761 template<
typename Dst,
typename Src>
762 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
763 void call_assignment(Dst& dst,
const Src& src)
767 template<
typename Dst,
typename Src>
768 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
769 void call_assignment(
const Dst& dst,
const Src& src)
775 template<
typename Dst,
typename Src,
typename Func>
776 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
780 call_assignment_no_alias(dst, tmp, func);
783 template<
typename Dst,
typename Src,
typename Func>
784 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
787 call_assignment_no_alias(dst, src, func);
792 template<
typename Dst,
template <
typename>
class StorageBase,
typename Src,
typename Func>
793 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
796 call_assignment_no_alias(dst.expression(), src, func);
800 template<
typename Dst,
typename Src,
typename Func>
801 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
802 void call_assignment_no_alias(Dst& dst,
const Src& src,
const Func& func)
805 NeedToTranspose = ( (int(Dst::RowsAtCompileTime) == 1 && int(Src::ColsAtCompileTime) == 1)
806 || (
int(Dst::ColsAtCompileTime) == 1 && int(Src::RowsAtCompileTime) == 1)
807 ) && int(Dst::SizeAtCompileTime) != 1
811 typedef typename internal::conditional<NeedToTranspose, Transpose<Dst>, Dst&>::type ActualDstType;
812 ActualDstType actualDst(dst);
815 EIGEN_STATIC_ASSERT_LVALUE(Dst)
816 EIGEN_STATIC_ASSERT_SAME_MATRIX_SIZE(ActualDstTypeCleaned,Src)
817 EIGEN_CHECK_BINARY_COMPATIBILIY(Func,typename ActualDstTypeCleaned::Scalar,typename Src::Scalar);
819 Assignment<ActualDstTypeCleaned,Src,Func>::run(actualDst, src, func);
821 template<typename Dst, typename Src>
822 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
823 void call_assignment_no_alias(Dst& dst, const Src& src)
828 template<
typename Dst,
typename Src,
typename Func>
829 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
830 void call_assignment_no_alias_no_transpose(Dst& dst,
const Src& src,
const Func& func)
833 EIGEN_STATIC_ASSERT_LVALUE(Dst)
834 EIGEN_STATIC_ASSERT_SAME_MATRIX_SIZE(Dst,Src)
835 EIGEN_CHECK_BINARY_COMPATIBILIY(Func,typename Dst::Scalar,typename Src::Scalar);
837 Assignment<Dst,Src,Func>::run(dst, src, func);
839 template<typename Dst, typename Src>
840 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
841 void call_assignment_no_alias_no_transpose(Dst& dst, const Src& src)
847 template<
typename Dst,
typename Src>
void check_for_aliasing(
const Dst &dst,
const Src &src);
852 template<
typename DstXprType,
typename SrcXprType,
typename Functor,
typename Weak>
856 static EIGEN_STRONG_INLINE
void run(DstXprType &dst,
const SrcXprType &src,
const Functor &func)
858 #ifndef EIGEN_NO_DEBUG 859 internal::check_for_aliasing(dst, src);
862 call_dense_assignment_loop(dst, src, func);
870 template<
typename DstXprType,
typename SrcXprType,
typename Functor,
typename Weak>
876 Index dstRows = src.rows();
877 Index dstCols = src.cols();
878 if((dst.rows()!=dstRows) || (dst.cols()!=dstCols))
879 dst.resize(dstRows, dstCols);
881 eigen_assert(dst.rows() == src.rows() && dst.cols() == src.cols());
887 template<
typename SrcScalarType>
891 Index dstRows = src.rows();
892 Index dstCols = src.cols();
893 if((dst.rows()!=dstRows) || (dst.cols()!=dstCols))
894 dst.resize(dstRows, dstCols);
896 eigen_assert(dst.rows() == src.rows() && dst.cols() == src.cols());
900 template<
typename SrcScalarType>
904 Index dstRows = src.rows();
905 Index dstCols = src.cols();
906 if((dst.rows()!=dstRows) || (dst.cols()!=dstCols))
907 dst.resize(dstRows, dstCols);
909 eigen_assert(dst.rows() == src.rows() && dst.cols() == src.cols());
918 #endif // EIGEN_ASSIGN_EVALUATOR_H Definition: NonLinearOptimization.cpp:108
Definition: AssignEvaluator.h:28
Definition: XprHelper.h:158
Pseudo expression providing an operator = assuming no aliasing.
Definition: NoAlias.h:31
Definition: AssignEvaluator.h:287
Definition: AssignmentFunctors.h:67
Definition: AssignEvaluator.h:313
const unsigned int DirectAccessBit
Means that the underlying array of coefficients can be directly accessed as a plain strided array...
Definition: Constants.h:150
Definition: XprHelper.h:275
Definition: AssignEvaluator.h:258
Definition: CoreEvaluators.h:90
Namespace containing all symbols from the Eigen library.
Definition: bench_norm.cpp:85
const unsigned int RowMajorBit
for a matrix, this means that the storage order is row-major.
Definition: Constants.h:61
Definition: AssignEvaluator.h:238
Definition: Constants.h:512
Definition: AssignEvaluator.h:193
Definition: AssignEvaluator.h:218
Definition: AssignmentFunctors.h:21
Definition: AssignEvaluator.h:753
Definition: AssignEvaluator.h:743
Definition: GenericPacketMath.h:96
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void assignCoeffByOuterInner(Index outer, Index inner)
Definition: AssignEvaluator.h:641
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:33
Definition: AssignEvaluator.h:744
Definition: ForwardDeclarations.h:149
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void assignCoeff(Index row, Index col)
Assign src(row,col) to dst(row,col) through the assignment functor.
Definition: AssignEvaluator.h:629
Definition: benchGeometry.cpp:23
Definition: BandTriangularSolver.h:13
Definition: XprHelper.h:146
Definition: DenseCoeffsBase.h:666
Definition: AssignEvaluator.h:740
Definition: CoreEvaluators.h:84
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void assignCoeff(Index index)
Definition: AssignEvaluator.h:635
Definition: AssignmentFunctors.h:46
const int Dynamic
This value means that a positive quantity (e.g., a size) is not known at compile-time, and that instead the value is stored in some runtime variable.
Definition: Constants.h:21
Definition: AssignEvaluator.h:596
Definition: TensorMeta.h:50
Convenience specialization of Stride to specify only an outer stride See class Map for some examples...
Definition: Stride.h:101
const unsigned int LinearAccessBit
Short version: means the expression can be seen as 1D vector.
Definition: Constants.h:125
Definition: AssignEvaluator.h:364