TensorMorphing.h
Go to the documentation of this file.
1 // This file is part of Eigen, a lightweight C++ template library
2 // for linear algebra.
3 //
4 // Copyright (C) 2014 Benoit Steiner <benoit.steiner.goog@gmail.com>
5 //
6 // This Source Code Form is subject to the terms of the Mozilla
7 // Public License v. 2.0. If a copy of the MPL was not distributed
8 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 
10 #ifndef EIGEN_CXX11_TENSOR_TENSOR_MORPHING_H
11 #define EIGEN_CXX11_TENSOR_TENSOR_MORPHING_H
12 
13 namespace Eigen {
14 
22 namespace internal {
23 template<typename NewDimensions, typename XprType>
24 struct traits<TensorReshapingOp<NewDimensions, XprType> > : public traits<XprType>
25 {
26  typedef typename XprType::Scalar Scalar;
28  typedef typename XprTraits::StorageKind StorageKind;
29  typedef typename XprTraits::Index Index;
30  typedef typename XprType::Nested Nested;
32  static const int NumDimensions = array_size<NewDimensions>::value;
33  static const int Layout = XprTraits::Layout;
34  typedef typename XprTraits::PointerType PointerType;
35 };
36 
37 template<typename NewDimensions, typename XprType>
38 struct eval<TensorReshapingOp<NewDimensions, XprType>, Eigen::Dense>
39 {
41 };
42 
43 template<typename NewDimensions, typename XprType>
44 struct nested<TensorReshapingOp<NewDimensions, XprType>, 1, typename eval<TensorReshapingOp<NewDimensions, XprType> >::type>
45 {
47 };
48 
49 } // end namespace internal
50 
51 
52 
53 template<typename NewDimensions, typename XprType>
54 class TensorReshapingOp : public TensorBase<TensorReshapingOp<NewDimensions, XprType>, WriteAccessors>
55 {
56  public:
63 
64  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorReshapingOp(const XprType& expr, const NewDimensions& dims)
65  : m_xpr(expr), m_dims(dims) {}
66 
68  const NewDimensions& dimensions() const { return m_dims; }
69 
72  expression() const { return m_xpr; }
73 
75 
76  protected:
77  typename XprType::Nested m_xpr;
78  const NewDimensions m_dims;
79 };
80 
81 
82 // Eval as rvalue
83 template<typename NewDimensions, typename ArgType, typename Device>
84 struct TensorEvaluator<const TensorReshapingOp<NewDimensions, ArgType>, Device>
85 {
87  typedef NewDimensions Dimensions;
88 
89  typedef typename XprType::Index Index;
90  typedef typename XprType::Scalar Scalar;
96 
97  static const int NumOutputDims = internal::array_size<Dimensions>::value;
99 
101  // We do not use layout information to determine reshaping kind.
102  // Depending on the layout `N` can be inner or outer dimension.
103  OneByN = 0, // expr.reshape(1, N)
104  NByOne = 1, // expr.reshape(N, 1)
105  Runtime = 2 // Reshape dimensions are dynamic (specified at runtime).
106  };
107 
108  // clang-format off
109  static const ReshapingKind kind =
110 #if defined(EIGEN_HAS_INDEX_LIST)
111  (NumOutputDims == 2 && internal::index_statically_eq<NewDimensions>(/*index=*/0, /*value=*/1)) ? OneByN
112  : (NumOutputDims == 2 && internal::index_statically_eq<NewDimensions>(/*index=*/1, /*value=*/1)) ? NByOne
113  : Runtime;
114 #else
115  Runtime;
116 #endif
117  // clang-format on
118 
119  enum {
122  // For trivial reshapes with raw access to underlying data we will provide
123  // zero overhead block access.
124  // TODO(ezhulenev): Consider adding block access without raw access?
126  NumInputDims > 0 && NumOutputDims > 0,
127  PreferBlockAccess = false,
129  CoordAccess = false, // to be implemented
131  };
132 
134 
135  //===- Tensor block evaluation strategy (see TensorBlock.h) -------------===//
138 
139  typedef
140  typename internal::TensorMaterializedBlock<ScalarNoConst, NumOutputDims,
141  Layout, Index>
143  //===--------------------------------------------------------------------===//
144 
145  EIGEN_STRONG_INLINE TensorEvaluator(const XprType& op, const Device& device)
146  : m_impl(op.expression(), device), m_dimensions(op.dimensions())
147  {
148  // The total size of the reshaped tensor must be equal to the total size
149  // of the input tensor.
150  eigen_assert(internal::array_prod(m_impl.dimensions()) == internal::array_prod(op.dimensions()));
151  }
152 
153  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Dimensions& dimensions() const { return m_dimensions; }
154 
155 #ifdef EIGEN_USE_THREADS
156  template <typename EvalSubExprsCallback>
157  EIGEN_STRONG_INLINE void evalSubExprsIfNeededAsync(
158  EvaluatorPointerType data, EvalSubExprsCallback done) {
159  m_impl.evalSubExprsIfNeededAsync(data, std::move(done));
160  }
161 #endif
162 
164  return m_impl.evalSubExprsIfNeeded(data);
165  }
167  m_impl.cleanup();
168  }
169 
171  {
172  return m_impl.coeff(index);
173  }
174 
175  template<int LoadMode>
177  {
178  return m_impl.template packet<LoadMode>(index);
179  }
180 
182  return m_impl.costPerCoeff(vectorized);
183  }
184 
188  }
189 
190  // required in block(OutputTensorBlock* output_block) const
191  // For C++03 compatibility this must be defined outside the method
192  struct BlockIteratorState {
197  };
198 
201  bool /*root_of_expr_ast*/ = false) const {
202  eigen_assert(m_impl.data() != NULL);
203  eigen_assert((kind == Runtime) ||
204  (kind == OneByN && desc.dimensions()[0] == 1) ||
205  (kind == NByOne && desc.dimensions()[1] == 1));
206 
207  if (kind == OneByN || kind == NByOne) {
208  // We can guarantee at compile time that block is just a contiguous slice
209  // of the underlying expression memory buffer.
211  m_impl.data() + desc.offset(), desc.dimensions());
212  } else {
213  // This will do additional runtime checks, and in the end it might be also
214  // a view, or it might be a block materialized in the temporary buffer.
215  return TensorBlock::materialize(m_impl.data(), m_dimensions, desc,
216  scratch);
217  }
218  }
219 
221  return constCast(m_impl.data());
222  }
223 
224  EIGEN_DEVICE_FUNC const TensorEvaluator<ArgType, Device>& impl() const { return m_impl; }
225 
226  #ifdef EIGEN_USE_SYCL
227  // binding placeholder accessors to a command group handler for SYCL
228  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void bind(cl::sycl::handler &cgh) const {
229  m_impl.bind(cgh);
230  }
231  #endif
232  protected:
234  NewDimensions m_dimensions;
235 };
236 
237 
238 // Eval as lvalue
239 template<typename NewDimensions, typename ArgType, typename Device>
240  struct TensorEvaluator<TensorReshapingOp<NewDimensions, ArgType>, Device>
241  : public TensorEvaluator<const TensorReshapingOp<NewDimensions, ArgType>, Device>
242 
243 {
246  typedef NewDimensions Dimensions;
247 
248  enum {
254  CoordAccess = false, // to be implemented
256  };
257 
258  EIGEN_STRONG_INLINE TensorEvaluator(const XprType& op, const Device& device)
259  : Base(op, device)
260  { }
261 
262  typedef typename XprType::Index Index;
263  typedef typename XprType::Scalar Scalar;
266 
267  //===- Tensor block evaluation strategy (see TensorBlock.h) -------------===//
270  //===--------------------------------------------------------------------===//
271 
273  {
274  return this->m_impl.coeffRef(index);
275  }
276 
277  template <int StoreMode> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
278  void writePacket(Index index, const PacketReturnType& x)
279  {
280  this->m_impl.template writePacket<StoreMode>(index, x);
281  }
282 
283  template <typename TensorBlock>
285  const TensorBlockDesc& desc, const TensorBlock& block) {
286  assert(this->m_impl.data() != NULL);
287 
288  typedef typename TensorBlock::XprType TensorBlockExpr;
290  Scalar, TensorEvaluator::NumOutputDims, TensorBlockExpr, Index>
291  TensorBlockAssign;
292 
293  TensorBlockAssign::Run(
294  TensorBlockAssign::target(desc.dimensions(),
295  internal::strides<Layout>(this->dimensions()),
296  this->m_impl.data(), desc.offset()),
297  block.expr());
298  }
299 };
300 
301 
309 namespace internal {
310 template<typename StartIndices, typename Sizes, typename XprType>
311 struct traits<TensorSlicingOp<StartIndices, Sizes, XprType> > : public traits<XprType>
312 {
313  typedef typename XprType::Scalar Scalar;
315  typedef typename XprTraits::StorageKind StorageKind;
316  typedef typename XprTraits::Index Index;
317  typedef typename XprType::Nested Nested;
319  static const int NumDimensions = array_size<StartIndices>::value;
320  static const int Layout = XprTraits::Layout;
321  typedef typename XprTraits::PointerType PointerType;
322 };
323 
324 template<typename StartIndices, typename Sizes, typename XprType>
325 struct eval<TensorSlicingOp<StartIndices, Sizes, XprType>, Eigen::Dense>
326 {
328 };
329 
330 template<typename StartIndices, typename Sizes, typename XprType>
331 struct nested<TensorSlicingOp<StartIndices, Sizes, XprType>, 1, typename eval<TensorSlicingOp<StartIndices, Sizes, XprType> >::type>
332 {
334 };
335 
336 } // end namespace internal
337 
338 
339 
340 template<typename StartIndices, typename Sizes, typename XprType>
341 class TensorSlicingOp : public TensorBase<TensorSlicingOp<StartIndices, Sizes, XprType> >
342 {
343  public:
346  typedef typename XprType::CoeffReturnType CoeffReturnType;
350 
352  : m_xpr(expr), m_indices(indices), m_sizes(sizes) {}
353 
355  const StartIndices& startIndices() const { return m_indices; }
357  const Sizes& sizes() const { return m_sizes; }
358 
361  expression() const { return m_xpr; }
362 
364 
365  protected:
366  typename XprType::Nested m_xpr;
367  const StartIndices m_indices;
368  const Sizes m_sizes;
369 };
370 
371 
372 // Fixme: figure out the exact threshold
373 namespace {
374 template <typename Index, typename Device, bool BlockAccess> struct MemcpyTriggerForSlicing {
375  EIGEN_DEVICE_FUNC MemcpyTriggerForSlicing(const Device& device) : threshold_(2 * device.numThreads()) { }
376  EIGEN_DEVICE_FUNC bool operator ()(Index total, Index contiguous) const {
377  const bool prefer_block_evaluation = BlockAccess && total > 32*1024;
378  return !prefer_block_evaluation && contiguous > threshold_;
379  }
380 
381  private:
383 };
384 
385 // It is very expensive to start the memcpy kernel on GPU: we therefore only
386 // use it for large copies.
387 #ifdef EIGEN_USE_GPU
388 template <typename Index, bool BlockAccess> struct MemcpyTriggerForSlicing<Index, GpuDevice, BlockAccess> {
389  EIGEN_DEVICE_FUNC MemcpyTriggerForSlicing(const GpuDevice&) { }
390  EIGEN_DEVICE_FUNC bool operator ()(Index, Index contiguous) const { return contiguous > 4*1024*1024; }
391 };
392 #endif
393 
394 // It is very expensive to start the memcpy kernel on GPU: we therefore only
395 // use it for large copies.
396 #ifdef EIGEN_USE_SYCL
397 template <typename Index, bool BlockAccess> struct MemcpyTriggerForSlicing<Index, Eigen::SyclDevice, BlockAccess> {
398  EIGEN_DEVICE_FUNC MemcpyTriggerForSlicing(const SyclDevice&) { }
399  EIGEN_DEVICE_FUNC bool operator ()(Index, Index contiguous) const { return contiguous > 4*1024*1024; }
400 };
401 #endif
402 
403 }
404 
405 // Eval as rvalue
406 template<typename StartIndices, typename Sizes, typename ArgType, typename Device>
407 struct TensorEvaluator<const TensorSlicingOp<StartIndices, Sizes, ArgType>, Device>
408 {
410  static const int NumDims = internal::array_size<Sizes>::value;
411 
412  typedef typename XprType::Index Index;
413  typedef typename XprType::Scalar Scalar;
416  typedef Sizes Dimensions;
420 
421  enum {
422  // Alignment can't be guaranteed at compile time since it depends on the
423  // slice offsets and sizes.
424  IsAligned = false,
427  // FIXME: Temporary workaround for bug in slicing of bool tensors.
431  CoordAccess = false,
432  RawAccess = false
433  };
434 
436 
437  //===- Tensor block evaluation strategy (see TensorBlock.h) -------------===//
440 
441  // Tensor slicing does not change the block type.
444  //===--------------------------------------------------------------------===//
445 
446  EIGEN_STRONG_INLINE TensorEvaluator(const XprType& op, const Device& device)
447  : m_impl(op.expression(), device), m_device(device), m_dimensions(op.sizes()), m_offsets(op.startIndices())
448  {
449  m_is_identity = true;
451  eigen_assert(m_impl.dimensions()[i] >=
452  op.sizes()[i] + op.startIndices()[i]);
453  if (m_impl.dimensions()[i] != op.sizes()[i] ||
454  op.startIndices()[i] != 0) {
455  m_is_identity = false;
456  }
457  }
458 
459  // No strides for scalars.
460  if (NumDims == 0) return;
461 
462  const typename TensorEvaluator<ArgType, Device>::Dimensions& input_dims = m_impl.dimensions();
463  const Sizes& output_dims = op.sizes();
464  if (static_cast<int>(Layout) == static_cast<int>(ColMajor)) {
465  m_inputStrides[0] = 1;
466  for (int i = 1; i < NumDims; ++i) {
467  m_inputStrides[i] = m_inputStrides[i-1] * input_dims[i-1];
468  }
469 
470  // Don't initialize m_fastOutputStrides[0] since it won't ever be accessed.
471  m_outputStrides[0] = 1;
472  for (int i = 1; i < NumDims; ++i) {
473  m_outputStrides[i] = m_outputStrides[i-1] * output_dims[i-1];
474  m_fastOutputStrides[i] = internal::TensorIntDivisor<Index>(m_outputStrides[i] > 0 ? m_outputStrides[i] : 1);
475  }
476  } else {
477  m_inputStrides[NumDims-1] = 1;
478  for (int i = NumDims - 2; i >= 0; --i) {
479  m_inputStrides[i] = m_inputStrides[i+1] * input_dims[i+1];
480  }
481 
482  // Don't initialize m_fastOutputStrides[NumDims-1] since it won't ever be accessed.
483  m_outputStrides[NumDims-1] = 1;
484  for (int i = NumDims - 2; i >= 0; --i) {
485  m_outputStrides[i] = m_outputStrides[i+1] * output_dims[i+1];
486  m_fastOutputStrides[i] = internal::TensorIntDivisor<Index>(m_outputStrides[i] > 0 ? m_outputStrides[i] : 1);
487  }
488  }
489  }
490 
491  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Dimensions& dimensions() const { return m_dimensions; }
492 
494  m_impl.evalSubExprsIfNeeded(NULL);
495  if (!NumTraits<typename internal::remove_const<Scalar>::type>::RequireInitialization
496  && data && m_impl.data()) {
497  Index contiguous_values = 1;
498  if (static_cast<int>(Layout) == static_cast<int>(ColMajor)) {
499  for (int i = 0; i < NumDims; ++i) {
500  contiguous_values *= dimensions()[i];
501  if (dimensions()[i] != m_impl.dimensions()[i]) {
502  break;
503  }
504  }
505  } else {
506  for (int i = NumDims-1; i >= 0; --i) {
507  contiguous_values *= dimensions()[i];
508  if (dimensions()[i] != m_impl.dimensions()[i]) {
509  break;
510  }
511  }
512  }
513  // Use memcpy if it's going to be faster than using the regular evaluation.
514  const MemcpyTriggerForSlicing<Index, Device, BlockAccess> trigger(m_device);
515  if (trigger(internal::array_prod(dimensions()), contiguous_values)) {
516  EvaluatorPointerType src = (EvaluatorPointerType)m_impl.data();
517  for (Index i = 0; i < internal::array_prod(dimensions()); i += contiguous_values) {
518  Index offset = srcCoeff(i);
519  m_device.memcpy((void*)(m_device.get(data + i)), m_device.get(src+offset), contiguous_values * sizeof(Scalar));
520  }
521  return false;
522  }
523  }
524  return true;
525  }
526 
527 #ifdef EIGEN_USE_THREADS
528  template <typename EvalSubExprsCallback>
529  EIGEN_STRONG_INLINE void evalSubExprsIfNeededAsync(
530  EvaluatorPointerType /*data*/, EvalSubExprsCallback done) {
531  m_impl.evalSubExprsIfNeededAsync(nullptr, [done](bool) { done(true); });
532  }
533 #endif // EIGEN_USE_THREADS
534 
536  m_impl.cleanup();
537  }
538 
540  {
541  if (m_is_identity) {
542  return m_impl.coeff(index);
543  } else {
544  return m_impl.coeff(srcCoeff(index));
545  }
546  }
547 
548  template<int LoadMode>
550  {
551  const int packetSize = PacketType<CoeffReturnType, Device>::size;
552  EIGEN_STATIC_ASSERT((packetSize > 1), YOU_MADE_A_PROGRAMMING_MISTAKE)
553  eigen_assert(index+packetSize-1 < internal::array_prod(dimensions()));
554 
555  if (m_is_identity) {
556  return m_impl.template packet<LoadMode>(index);
557  }
558 
559  Index inputIndices[] = {0, 0};
560  Index indices[] = {index, index + packetSize - 1};
561  if (static_cast<int>(Layout) == static_cast<int>(ColMajor)) {
563  for (int i = NumDims - 1; i > 0; --i) {
564  const Index idx0 = indices[0] / m_fastOutputStrides[i];
565  const Index idx1 = indices[1] / m_fastOutputStrides[i];
566  inputIndices[0] += (idx0 + m_offsets[i]) * m_inputStrides[i];
567  inputIndices[1] += (idx1 + m_offsets[i]) * m_inputStrides[i];
568  indices[0] -= idx0 * m_outputStrides[i];
569  indices[1] -= idx1 * m_outputStrides[i];
570  }
571  inputIndices[0] += (indices[0] + m_offsets[0]);
572  inputIndices[1] += (indices[1] + m_offsets[0]);
573  } else {
575  for (int i = 0; i < NumDims - 1; ++i) {
576  const Index idx0 = indices[0] / m_fastOutputStrides[i];
577  const Index idx1 = indices[1] / m_fastOutputStrides[i];
578  inputIndices[0] += (idx0 + m_offsets[i]) * m_inputStrides[i];
579  inputIndices[1] += (idx1 + m_offsets[i]) * m_inputStrides[i];
580  indices[0] -= idx0 * m_outputStrides[i];
581  indices[1] -= idx1 * m_outputStrides[i];
582  }
583  inputIndices[0] += (indices[0] + m_offsets[NumDims-1]);
584  inputIndices[1] += (indices[1] + m_offsets[NumDims-1]);
585  }
586  if (inputIndices[1] - inputIndices[0] == packetSize - 1) {
587  PacketReturnType rslt = m_impl.template packet<Unaligned>(inputIndices[0]);
588  return rslt;
589  }
590  else {
592  values[0] = m_impl.coeff(inputIndices[0]);
593  values[packetSize-1] = m_impl.coeff(inputIndices[1]);
595  for (int i = 1; i < packetSize-1; ++i) {
596  values[i] = coeff(index+i);
597  }
598  PacketReturnType rslt = internal::pload<PacketReturnType>(values);
599  return rslt;
600  }
601  }
602 
604  return m_impl.costPerCoeff(vectorized) + TensorOpCost(0, 0, m_is_identity ? 1 : NumDims);
605  }
606 
609  const size_t target_size = m_device.lastLevelCacheSize();
611  internal::TensorBlockResourceRequirements::skewed<Scalar>(target_size),
612  m_impl.getResourceRequirements());
613  }
614 
617  bool /*root_of_expr_ast*/ = false) const {
618  TensorBlockDesc arg_desc = desc.WithOffset(srcCoeff(desc.offset()));
619  TensorBlock block = m_impl.block(arg_desc, scratch);
620  if (!arg_desc.HasDestinationBuffer()) desc.DropDestinationBuffer();
621  return block;
622  }
623 
625  typename Storage::Type result = constCast(m_impl.data());
626  if (result) {
627  Index offset = 0;
628  if (static_cast<int>(Layout) == static_cast<int>(ColMajor)) {
629  for (int i = 0; i < NumDims; ++i) {
630  if (m_dimensions[i] != m_impl.dimensions()[i]) {
631  offset += m_offsets[i] * m_inputStrides[i];
632  for (int j = i+1; j < NumDims; ++j) {
633  if (m_dimensions[j] > 1) {
634  return NULL;
635  }
636  offset += m_offsets[j] * m_inputStrides[j];
637  }
638  break;
639  }
640  }
641  } else {
642  for (int i = NumDims - 1; i >= 0; --i) {
643  if (m_dimensions[i] != m_impl.dimensions()[i]) {
644  offset += m_offsets[i] * m_inputStrides[i];
645  for (int j = i-1; j >= 0; --j) {
646  if (m_dimensions[j] > 1) {
647  return NULL;
648  }
649  offset += m_offsets[j] * m_inputStrides[j];
650  }
651  break;
652  }
653  }
654  }
655  return result + offset;
656  }
657  return NULL;
658  }
659 #ifdef EIGEN_USE_SYCL
660  // binding placeholder accessors to a command group handler for SYCL
661  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void bind(cl::sycl::handler &cgh) const {
662  m_impl.bind(cgh);
663  }
664 #endif
665 
666  protected:
668  {
669  Index inputIndex = 0;
670  if (static_cast<int>(Layout) == static_cast<int>(ColMajor)) {
672  for (int i = NumDims - 1; i > 0; --i) {
673  const Index idx = index / m_fastOutputStrides[i];
674  inputIndex += (idx + m_offsets[i]) * m_inputStrides[i];
675  index -= idx * m_outputStrides[i];
676  }
677  inputIndex += (index + m_offsets[0]);
678  } else {
680  for (int i = 0; i < NumDims - 1; ++i) {
681  const Index idx = index / m_fastOutputStrides[i];
682  inputIndex += (idx + m_offsets[i]) * m_inputStrides[i];
683  index -= idx * m_outputStrides[i];
684  }
685  inputIndex += (index + m_offsets[NumDims-1]);
686  }
687  return inputIndex;
688  }
689 
697  const StartIndices m_offsets;
698 };
699 
700 
701 // Eval as lvalue
702 template<typename StartIndices, typename Sizes, typename ArgType, typename Device>
703 struct TensorEvaluator<TensorSlicingOp<StartIndices, Sizes, ArgType>, Device>
704  : public TensorEvaluator<const TensorSlicingOp<StartIndices, Sizes, ArgType>, Device>
705 {
708  static const int NumDims = internal::array_size<Sizes>::value;
709 
710  typedef typename XprType::Index Index;
711  typedef typename XprType::Scalar Scalar;
714  typedef Sizes Dimensions;
715 
716  enum {
717  IsAligned = false,
722  CoordAccess = false,
723  RawAccess = (NumDims == 1) & TensorEvaluator<ArgType, Device>::RawAccess
724  };
725 
727 
728  //===- Tensor block evaluation strategy (see TensorBlock.h) -------------===//
731  //===--------------------------------------------------------------------===//
732 
733  EIGEN_STRONG_INLINE TensorEvaluator(const XprType& op, const Device& device)
734  : Base(op, device)
735  { }
736 
738  {
739  if (this->m_is_identity) {
740  return this->m_impl.coeffRef(index);
741  } else {
742  return this->m_impl.coeffRef(this->srcCoeff(index));
743  }
744  }
745 
746  template <int StoreMode> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
747  void writePacket(Index index, const PacketReturnType& x)
748  {
749  if (this->m_is_identity) {
750  this->m_impl.template writePacket<StoreMode>(index, x);
751  return;
752  }
753 
754  const int packetSize = PacketType<CoeffReturnType, Device>::size;
755  Index inputIndices[] = {0, 0};
756  Index indices[] = {index, index + packetSize - 1};
757  if (static_cast<int>(Layout) == static_cast<int>(ColMajor)) {
759  for (int i = NumDims - 1; i > 0; --i) {
760  const Index idx0 = indices[0] / this->m_fastOutputStrides[i];
761  const Index idx1 = indices[1] / this->m_fastOutputStrides[i];
762  inputIndices[0] += (idx0 + this->m_offsets[i]) * this->m_inputStrides[i];
763  inputIndices[1] += (idx1 + this->m_offsets[i]) * this->m_inputStrides[i];
764  indices[0] -= idx0 * this->m_outputStrides[i];
765  indices[1] -= idx1 * this->m_outputStrides[i];
766  }
767  inputIndices[0] += (indices[0] + this->m_offsets[0]);
768  inputIndices[1] += (indices[1] + this->m_offsets[0]);
769  } else {
771  for (int i = 0; i < NumDims - 1; ++i) {
772  const Index idx0 = indices[0] / this->m_fastOutputStrides[i];
773  const Index idx1 = indices[1] / this->m_fastOutputStrides[i];
774  inputIndices[0] += (idx0 + this->m_offsets[i]) * this->m_inputStrides[i];
775  inputIndices[1] += (idx1 + this->m_offsets[i]) * this->m_inputStrides[i];
776  indices[0] -= idx0 * this->m_outputStrides[i];
777  indices[1] -= idx1 * this->m_outputStrides[i];
778  }
779  inputIndices[0] += (indices[0] + this->m_offsets[NumDims-1]);
780  inputIndices[1] += (indices[1] + this->m_offsets[NumDims-1]);
781  }
782  if (inputIndices[1] - inputIndices[0] == packetSize - 1) {
783  this->m_impl.template writePacket<StoreMode>(inputIndices[0], x);
784  }
785  else {
787  internal::pstore<CoeffReturnType, PacketReturnType>(values, x);
788  this->m_impl.coeffRef(inputIndices[0]) = values[0];
789  this->m_impl.coeffRef(inputIndices[1]) = values[packetSize-1];
791  for (int i = 1; i < packetSize-1; ++i) {
792  this->coeffRef(index+i) = values[i];
793  }
794  }
795  }
796 
797  template<typename TensorBlock>
799  const TensorBlockDesc& desc, const TensorBlock& block) {
800  TensorBlockDesc arg_desc = desc.WithOffset(this->srcCoeff(desc.offset()));
801  this->m_impl.writeBlock(arg_desc, block);
802  }
803 };
804 
805 namespace internal {
806 template<typename StartIndices, typename StopIndices, typename Strides, typename XprType>
807 struct traits<TensorStridingSlicingOp<StartIndices, StopIndices, Strides, XprType> > : public traits<XprType>
808 {
809  typedef typename XprType::Scalar Scalar;
811  typedef typename XprTraits::StorageKind StorageKind;
812  typedef typename XprTraits::Index Index;
813  typedef typename XprType::Nested Nested;
815  static const int NumDimensions = array_size<StartIndices>::value;
816  static const int Layout = XprTraits::Layout;
817  typedef typename XprTraits::PointerType PointerType;
818 };
819 
820 template<typename StartIndices, typename StopIndices, typename Strides, typename XprType>
821 struct eval<TensorStridingSlicingOp<StartIndices, StopIndices, Strides, XprType>, Eigen::Dense>
822 {
824 };
825 
826 template<typename StartIndices, typename StopIndices, typename Strides, typename XprType>
827 struct nested<TensorStridingSlicingOp<StartIndices, StopIndices, Strides, XprType>, 1, typename eval<TensorStridingSlicingOp<StartIndices, StopIndices, Strides, XprType> >::type>
828 {
830 };
831 
832 } // end namespace internal
833 
834 
835 template<typename StartIndices, typename StopIndices, typename Strides, typename XprType>
836 class TensorStridingSlicingOp : public TensorBase<TensorStridingSlicingOp<StartIndices, StopIndices, Strides, XprType> >
837 {
838  public:
841  typedef typename XprType::CoeffReturnType CoeffReturnType;
845 
847  const XprType& expr, const StartIndices& startIndices,
848  const StopIndices& stopIndices, const Strides& strides)
850  m_strides(strides) {}
851 
853  const StartIndices& startIndices() const { return m_startIndices; }
855  const StartIndices& stopIndices() const { return m_stopIndices; }
857  const StartIndices& strides() const { return m_strides; }
858 
861  expression() const { return m_xpr; }
862 
864 
865  protected:
866  typename XprType::Nested m_xpr;
867  const StartIndices m_startIndices;
868  const StopIndices m_stopIndices;
869  const Strides m_strides;
870 };
871 
872 // Eval as rvalue
873 template<typename StartIndices, typename StopIndices, typename Strides, typename ArgType, typename Device>
874 struct TensorEvaluator<const TensorStridingSlicingOp<StartIndices, StopIndices, Strides, ArgType>, Device>
875 {
877  static const int NumDims = internal::array_size<Strides>::value;
878  typedef typename XprType::Index Index;
879  typedef typename XprType::Scalar Scalar;
884  typedef Strides Dimensions;
885 
886  enum {
887  // Alignment can't be guaranteed at compile time since it depends on the
888  // slice offsets and sizes.
889  IsAligned = false,
890  PacketAccess = false,
891  BlockAccess = false,
894  RawAccess = false
895  };
896 
897  //===- Tensor block evaluation strategy (see TensorBlock.h) -------------===//
899  //===--------------------------------------------------------------------===//
900 
901  EIGEN_STRONG_INLINE TensorEvaluator(const XprType& op, const Device& device)
902  : m_impl(op.expression(), device),
903  m_device(device),
904  m_strides(op.strides())
905  {
906  // Handle degenerate intervals by gracefully clamping and allowing m_dimensions to be zero
907  DSizes<Index, NumDims> startIndicesClamped, stopIndicesClamped;
908  for (ptrdiff_t i = 0; i < internal::array_size<Dimensions>::value; ++i) {
909  eigen_assert(m_strides[i] != 0 && "0 stride is invalid");
910  if (m_strides[i] > 0) {
911  startIndicesClamped[i] =
912  clamp(op.startIndices()[i], 0, m_impl.dimensions()[i]);
913  stopIndicesClamped[i] =
914  clamp(op.stopIndices()[i], 0, m_impl.dimensions()[i]);
915  } else {
916  /* implies m_strides[i] < 0 by assert */
917  startIndicesClamped[i] =
918  clamp(op.startIndices()[i], -1, m_impl.dimensions()[i] - 1);
919  stopIndicesClamped[i] =
920  clamp(op.stopIndices()[i], -1, m_impl.dimensions()[i] - 1);
921  }
922  m_startIndices[i] = startIndicesClamped[i];
923  }
924 
925  typedef typename TensorEvaluator<ArgType, Device>::Dimensions InputDimensions;
926  const InputDimensions& input_dims = m_impl.dimensions();
927 
928  // compute output tensor shape
929  m_is_identity = true;
930  for (int i = 0; i < NumDims; i++) {
931  Index interval = stopIndicesClamped[i] - startIndicesClamped[i];
932  if (interval == 0 || ((interval < 0) != (m_strides[i] < 0))) {
933  m_dimensions[i] = 0;
934  } else {
935  m_dimensions[i] =
936  (interval / m_strides[i]) + (interval % m_strides[i] != 0 ? 1 : 0);
937  eigen_assert(m_dimensions[i] >= 0);
938  }
939  if (m_strides[i] != 1 || interval != m_impl.dimensions()[i]) {
940  m_is_identity = false;
941  }
942  }
943 
944  Strides output_dims = m_dimensions;
945 
946  if (static_cast<int>(Layout) == static_cast<int>(ColMajor)) {
947  m_inputStrides[0] = m_strides[0];
948  m_offsets[0] = startIndicesClamped[0];
949  Index previousDimProduct = 1;
950  for (int i = 1; i < NumDims; ++i) {
951  previousDimProduct *= input_dims[i-1];
952  m_inputStrides[i] = previousDimProduct * m_strides[i];
953  m_offsets[i] = startIndicesClamped[i] * previousDimProduct;
954  }
955 
956  // Don't initialize m_fastOutputStrides[0] since it won't ever be accessed.
957  m_outputStrides[0] = 1;
958  for (int i = 1; i < NumDims; ++i) {
959  m_outputStrides[i] = m_outputStrides[i-1] * output_dims[i-1];
960  m_fastOutputStrides[i] = internal::TensorIntDivisor<Index>(m_outputStrides[i] > 0 ? m_outputStrides[i] : 1);
961  }
962  } else {
963  m_inputStrides[NumDims-1] = m_strides[NumDims-1];
964  m_offsets[NumDims-1] = startIndicesClamped[NumDims-1];
965  Index previousDimProduct = 1;
966  for (int i = NumDims - 2; i >= 0; --i) {
967  previousDimProduct *= input_dims[i+1];
968  m_inputStrides[i] = previousDimProduct * m_strides[i];
969  m_offsets[i] = startIndicesClamped[i] * previousDimProduct;
970  }
971 
972  m_outputStrides[NumDims-1] = 1;
973  for (int i = NumDims - 2; i >= 0; --i) {
974  m_outputStrides[i] = m_outputStrides[i+1] * output_dims[i+1];
975  m_fastOutputStrides[i] = internal::TensorIntDivisor<Index>(m_outputStrides[i] > 0 ? m_outputStrides[i] : 1);
976  }
977  }
978  }
979 
980  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Dimensions& dimensions() const { return m_dimensions; }
981 
982 
984  m_impl.evalSubExprsIfNeeded(NULL);
985  return true;
986  }
987 
989  m_impl.cleanup();
990  }
991 
993  {
994  if (m_is_identity) {
995  return m_impl.coeff(index);
996  } else {
997  return m_impl.coeff(srcCoeff(index));
998  }
999  }
1000 
1002  return m_impl.costPerCoeff(vectorized) + TensorOpCost(0, 0, m_is_identity ? 1 : NumDims);
1003  }
1004 
1006  return NULL;
1007  }
1008 #ifdef EIGEN_USE_SYCL
1009  // binding placeholder accessors to a command group handler for SYCL
1010  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void bind(cl::sycl::handler &cgh) const {
1011  m_impl.bind(cgh);
1012  }
1013 #endif
1014  protected:
1016  {
1017  Index inputIndex = 0;
1018  if (static_cast<int>(Layout) == static_cast<int>(ColMajor)) {
1020  for (int i = NumDims - 1; i >= 0; --i) {
1021  const Index idx = index / m_fastOutputStrides[i];
1022  inputIndex += idx * m_inputStrides[i] + m_offsets[i];
1023  index -= idx * m_outputStrides[i];
1024  }
1025  } else {
1027  for (int i = 0; i < NumDims; ++i) {
1028  const Index idx = index / m_fastOutputStrides[i];
1029  inputIndex += idx * m_inputStrides[i] + m_offsets[i];
1030  index -= idx * m_outputStrides[i];
1031  }
1032  }
1033  return inputIndex;
1034  }
1035 
1037 #ifndef SYCL_DEVICE_ONLY
1039 #else
1040  return cl::sycl::clamp(value, min, max);
1041 #endif
1042  }
1043 
1050  DSizes<Index, NumDims> m_startIndices; // clamped startIndices
1052  DSizes<Index, NumDims> m_offsets; // offset in a flattened shape
1053  const Strides m_strides;
1054 };
1055 
1056 // Eval as lvalue
1057 template<typename StartIndices, typename StopIndices, typename Strides, typename ArgType, typename Device>
1058 struct TensorEvaluator<TensorStridingSlicingOp<StartIndices, StopIndices, Strides, ArgType>, Device>
1059  : public TensorEvaluator<const TensorStridingSlicingOp<StartIndices, StopIndices, Strides, ArgType>, Device>
1060 {
1063  static const int NumDims = internal::array_size<Strides>::value;
1064 
1065  enum {
1066  IsAligned = false,
1067  PacketAccess = false,
1068  BlockAccess = false,
1072  RawAccess = false
1073  };
1074 
1075  //===- Tensor block evaluation strategy (see TensorBlock.h) -------------===//
1077  //===--------------------------------------------------------------------===//
1078 
1079  EIGEN_STRONG_INLINE TensorEvaluator(const XprType& op, const Device& device)
1080  : Base(op, device)
1081  { }
1082 
1083  typedef typename XprType::Index Index;
1084  typedef typename XprType::Scalar Scalar;
1087  typedef Strides Dimensions;
1088 
1090  {
1091  if (this->m_is_identity) {
1092  return this->m_impl.coeffRef(index);
1093  } else {
1094  return this->m_impl.coeffRef(this->srcCoeff(index));
1095  }
1096  }
1097 };
1098 
1099 
1100 } // end namespace Eigen
1101 
1102 #endif // EIGEN_CXX11_TENSOR_TENSOR_MORPHING_H
Eigen::TensorEvaluator::dimensions
EIGEN_DEVICE_FUNC const EIGEN_STRONG_INLINE Dimensions & dimensions() const
Definition: TensorEvaluator.h:73
Eigen::TensorEvaluator< const TensorSlicingOp< StartIndices, Sizes, ArgType >, Device >::m_is_identity
bool m_is_identity
Definition: TensorMorphing.h:696
Eigen::internal::TensorBlockScratchAllocator
Definition: TensorBlock.h:525
Eigen::TensorSlicingOp::StorageKind
Eigen::internal::traits< TensorSlicingOp >::StorageKind StorageKind
Definition: TensorMorphing.h:348
Eigen::TensorEvaluator< const TensorReshapingOp< NewDimensions, ArgType >, Device >::ReshapingKind
ReshapingKind
Definition: TensorMorphing.h:100
Eigen::internal::traits< TensorReshapingOp< NewDimensions, XprType > >::Nested
XprType::Nested Nested
Definition: TensorMorphing.h:30
EIGEN_DEVICE_FUNC
#define EIGEN_DEVICE_FUNC
Definition: Macros.h:976
Eigen::TensorEvaluator< TensorSlicingOp< StartIndices, Sizes, ArgType >, Device >::writePacket
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void writePacket(Index index, const PacketReturnType &x)
Definition: TensorMorphing.h:747
Eigen::TensorEvaluator< const TensorStridingSlicingOp< StartIndices, StopIndices, Strides, ArgType >, Device >::cleanup
EIGEN_STRONG_INLINE void cleanup()
Definition: TensorMorphing.h:988
Eigen
Namespace containing all symbols from the Eigen library.
Definition: jet.h:637
Eigen::TensorEvaluator< const TensorReshapingOp< NewDimensions, ArgType >, Device >::Index
XprType::Index Index
Definition: TensorMorphing.h:89
Eigen::TensorSlicingOp::m_xpr
XprType::Nested m_xpr
Definition: TensorMorphing.h:366
Eigen::internal::TensorMaterializedBlock::materialize
static EIGEN_STRONG_INLINE TensorMaterializedBlock materialize(const Scalar *data, const DataDimensions &data_dims, TensorBlockDesc &desc, TensorBlockScratch &scratch)
Definition: TensorBlock.h:762
Eigen::TensorReshapingOp::Index
Eigen::internal::traits< TensorReshapingOp >::Index Index
Definition: TensorMorphing.h:62
Eigen::TensorReshapingOp::expression
const EIGEN_DEVICE_FUNC internal::remove_all< typename XprType::Nested >::type & expression() const
Definition: TensorMorphing.h:72
Eigen::TensorEvaluator< const TensorStridingSlicingOp< StartIndices, StopIndices, Strides, ArgType >, Device >::evalSubExprsIfNeeded
EIGEN_STRONG_INLINE bool evalSubExprsIfNeeded(EvaluatorPointerType)
Definition: TensorMorphing.h:983
Eigen::internal::TensorBlockNotImplemented
Definition: TensorBlock.h:617
Eigen::TensorEvaluator< const TensorReshapingOp< NewDimensions, ArgType >, Device >::packet
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE PacketReturnType packet(Index index) const
Definition: TensorMorphing.h:176
Eigen::TensorSlicingOp::Scalar
Eigen::internal::traits< TensorSlicingOp >::Scalar Scalar
Definition: TensorMorphing.h:345
Eigen::max
CleanedUpDerType< DerType >::type() max(const AutoDiffScalar< DerType > &x, const T &y)
Definition: AutoDiffScalar.h:585
Eigen::internal::strides
EIGEN_ALWAYS_INLINE DSizes< IndexType, NumDims > strides(const DSizes< IndexType, NumDims > &dimensions)
Definition: TensorBlock.h:26
Eigen::TensorEvaluator< const TensorStridingSlicingOp< StartIndices, StopIndices, Strides, ArgType >, Device >::coeff
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(Index index) const
Definition: TensorMorphing.h:992
Eigen::TensorEvaluator< const TensorStridingSlicingOp< StartIndices, StopIndices, Strides, ArgType >, Device >::costPerCoeff
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorOpCost costPerCoeff(bool vectorized) const
Definition: TensorMorphing.h:1001
Eigen::TensorEvaluator< const TensorReshapingOp< NewDimensions, ArgType >, Device >::Dimensions
NewDimensions Dimensions
Definition: TensorMorphing.h:87
Eigen::TensorEvaluator< TensorReshapingOp< NewDimensions, ArgType >, Device >::XprType
TensorReshapingOp< NewDimensions, ArgType > XprType
Definition: TensorMorphing.h:245
Eigen::TensorEvaluator< TensorStridingSlicingOp< StartIndices, StopIndices, Strides, ArgType >, Device >::TensorEvaluator
EIGEN_STRONG_INLINE TensorEvaluator(const XprType &op, const Device &device)
Definition: TensorMorphing.h:1079
Eigen::TensorEvaluator< const TensorSlicingOp< StartIndices, Sizes, ArgType >, Device >::cleanup
EIGEN_STRONG_INLINE void cleanup()
Definition: TensorMorphing.h:535
Eigen::CwiseBinaryOp
Generic expression where a coefficient-wise binary operator is applied to two expressions.
Definition: CwiseBinaryOp.h:77
Eigen::TensorEvaluator< const TensorSlicingOp< StartIndices, Sizes, ArgType >, Device >::m_inputStrides
array< Index, NumDims > m_inputStrides
Definition: TensorMorphing.h:692
Eigen::array< Index, NumDims >
Eigen::TensorStridingSlicingOp::m_strides
const Strides m_strides
Definition: TensorMorphing.h:869
Eigen::TensorEvaluator< TensorSlicingOp< StartIndices, Sizes, ArgType >, Device >::Base
TensorEvaluator< const TensorSlicingOp< StartIndices, Sizes, ArgType >, Device > Base
Definition: TensorMorphing.h:706
Eigen::TensorStridingSlicingOp::m_xpr
XprType::Nested m_xpr
Definition: TensorMorphing.h:866
Eigen::internal::traits< TensorSlicingOp< StartIndices, Sizes, XprType > >::Index
XprTraits::Index Index
Definition: TensorMorphing.h:316
Eigen::internal::nested
Definition: TensorTraits.h:174
Eigen::TensorEvaluator< const TensorReshapingOp< NewDimensions, ArgType >, Device >::evalSubExprsIfNeeded
EIGEN_STRONG_INLINE bool evalSubExprsIfNeeded(EvaluatorPointerType data)
Definition: TensorMorphing.h:163
Eigen::TensorEvaluator< const TensorReshapingOp< NewDimensions, ArgType >, Device >::getResourceRequirements
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE internal::TensorBlockResourceRequirements getResourceRequirements() const
Definition: TensorMorphing.h:186
Eigen::TensorEvaluator< TensorSlicingOp< StartIndices, Sizes, ArgType >, Device >::TensorBlockDesc
internal::TensorBlockDescriptor< NumDims, Index > TensorBlockDesc
Definition: TensorMorphing.h:729
Eigen::TensorEvaluator< TensorSlicingOp< StartIndices, Sizes, ArgType >, Device >::ScalarNoConst
internal::remove_const< Scalar >::type ScalarNoConst
Definition: TensorMorphing.h:726
Eigen::TensorEvaluator< TensorSlicingOp< StartIndices, Sizes, ArgType >, Device >::coeffRef
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType & coeffRef(Index index)
Definition: TensorMorphing.h:737
Eigen::TensorEvaluator< const TensorReshapingOp< NewDimensions, ArgType >, Device >::costPerCoeff
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorOpCost costPerCoeff(bool vectorized) const
Definition: TensorMorphing.h:181
eigen_assert
#define eigen_assert(x)
Definition: Macros.h:1037
pybind_wrapper_test_script.this
this
Definition: pybind_wrapper_test_script.py:38
Eigen::TensorEvaluator< const TensorStridingSlicingOp< StartIndices, StopIndices, Strides, ArgType >, Device >::m_inputStrides
array< Index, NumDims > m_inputStrides
Definition: TensorMorphing.h:1046
x
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
Definition: gnuplot_common_settings.hh:12
Eigen::internal::kView
@ kView
Definition: TensorBlock.h:596
Eigen::TensorEvaluator::TensorBlock
internal::TensorMaterializedBlock< ScalarNoConst, NumCoords, Layout, Index > TensorBlock
Definition: TensorEvaluator.h:63
Eigen::internal::traits< TensorSlicingOp< StartIndices, Sizes, XprType > >::StorageKind
XprTraits::StorageKind StorageKind
Definition: TensorMorphing.h:315
Eigen::TensorEvaluator< const TensorSlicingOp< StartIndices, Sizes, ArgType >, Device >::Storage
StorageMemory< CoeffReturnType, Device > Storage
Definition: TensorMorphing.h:417
Eigen::TensorEvaluator< TensorReshapingOp< NewDimensions, ArgType >, Device >::coeffRef
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType & coeffRef(Index index)
Definition: TensorMorphing.h:272
Eigen::TensorSlicingOp::m_indices
const StartIndices m_indices
Definition: TensorMorphing.h:367
Eigen::TensorEvaluator::Layout
@ Layout
Definition: TensorEvaluator.h:50
Eigen::TensorEvaluator< const TensorReshapingOp< NewDimensions, ArgType >, Device >::block
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorBlock block(TensorBlockDesc &desc, TensorBlockScratch &scratch, bool=false) const
Definition: TensorMorphing.h:200
Eigen::TensorEvaluator< const TensorSlicingOp< StartIndices, Sizes, ArgType >, Device >::costPerCoeff
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorOpCost costPerCoeff(bool vectorized) const
Definition: TensorMorphing.h:603
Eigen::TensorEvaluator< const TensorSlicingOp< StartIndices, Sizes, ArgType >, Device >::TensorBlock
TensorEvaluator< const ArgType, Device >::TensorBlock TensorBlock
Definition: TensorMorphing.h:443
Eigen::internal::traits< TensorStridingSlicingOp< StartIndices, StopIndices, Strides, XprType > >::PointerType
XprTraits::PointerType PointerType
Definition: TensorMorphing.h:817
Eigen::TensorEvaluator< const TensorSlicingOp< StartIndices, Sizes, ArgType >, Device >::m_dimensions
Dimensions m_dimensions
Definition: TensorMorphing.h:695
sizes
std::vector< Array2i > sizes
Definition: dense_solvers.cpp:12
threshold_
Index threshold_
Definition: TensorMorphing.h:382
Eigen::TensorEvaluator< const TensorStridingSlicingOp< StartIndices, StopIndices, Strides, ArgType >, Device >::m_impl
TensorEvaluator< ArgType, Device > m_impl
Definition: TensorMorphing.h:1048
Eigen::internal::TensorMaterializedBlock
Definition: TensorBlock.h:656
Eigen::TensorSlicingOp::CoeffReturnType
XprType::CoeffReturnType CoeffReturnType
Definition: TensorMorphing.h:346
Eigen::TensorEvaluator< const TensorSlicingOp< StartIndices, Sizes, ArgType >, Device >::block
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorBlock block(TensorBlockDesc &desc, TensorBlockScratch &scratch, bool=false) const
Definition: TensorMorphing.h:616
Eigen::TensorEvaluator< const TensorSlicingOp< StartIndices, Sizes, ArgType >, Device >::Scalar
XprType::Scalar Scalar
Definition: TensorMorphing.h:413
Eigen::TensorEvaluator< const TensorSlicingOp< StartIndices, Sizes, ArgType >, Device >::data
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Storage::Type data() const
Definition: TensorMorphing.h:624
different_sigmas::values
HybridValues values
Definition: testHybridBayesNet.cpp:245
Eigen::TensorEvaluator< const TensorStridingSlicingOp< StartIndices, StopIndices, Strides, ArgType >, Device >::TensorEvaluator
EIGEN_STRONG_INLINE TensorEvaluator(const XprType &op, const Device &device)
Definition: TensorMorphing.h:901
Eigen::internal::nested< TensorStridingSlicingOp< StartIndices, StopIndices, Strides, XprType >, 1, typename eval< TensorStridingSlicingOp< StartIndices, StopIndices, Strides, XprType > >::type >::type
TensorStridingSlicingOp< StartIndices, StopIndices, Strides, XprType > type
Definition: TensorMorphing.h:829
Eigen::internal::TensorBlockResourceRequirements::merge
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorBlockResourceRequirements merge(const TensorBlockResourceRequirements &lhs, const TensorBlockResourceRequirements &rhs)
Definition: TensorBlock.h:138
Eigen::TensorReshapingOp::dimensions
const EIGEN_DEVICE_FUNC NewDimensions & dimensions() const
Definition: TensorMorphing.h:68
Eigen::TensorSlicingOp::Nested
Eigen::internal::nested< TensorSlicingOp >::type Nested
Definition: TensorMorphing.h:347
Eigen::internal::traits< TensorStridingSlicingOp< StartIndices, StopIndices, Strides, XprType > >::_Nested
remove_reference< Nested >::type _Nested
Definition: TensorMorphing.h:814
Eigen::TensorStridingSlicingOp::TensorStridingSlicingOp
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorStridingSlicingOp(const XprType &expr, const StartIndices &startIndices, const StopIndices &stopIndices, const Strides &strides)
Definition: TensorMorphing.h:846
Eigen::TensorEvaluator< TensorStridingSlicingOp< StartIndices, StopIndices, Strides, ArgType >, Device >::Index
XprType::Index Index
Definition: TensorMorphing.h:1083
Eigen::TensorReshapingOp::TensorReshapingOp
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorReshapingOp(const XprType &expr, const NewDimensions &dims)
Definition: TensorMorphing.h:64
Eigen::internal::traits< TensorSlicingOp< StartIndices, Sizes, XprType > >::PointerType
XprTraits::PointerType PointerType
Definition: TensorMorphing.h:321
Eigen::TensorStridingSlicingOp::StorageKind
internal::traits< TensorStridingSlicingOp >::StorageKind StorageKind
Definition: TensorMorphing.h:843
result
Values result
Definition: OdometryOptimize.cpp:8
Eigen::TensorStridingSlicingOp::m_stopIndices
const StopIndices m_stopIndices
Definition: TensorMorphing.h:868
Eigen::TensorEvaluator< TensorStridingSlicingOp< StartIndices, StopIndices, Strides, ArgType >, Device >::coeffRef
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType & coeffRef(Index index)
Definition: TensorMorphing.h:1089
Eigen::TensorEvaluator< const TensorSlicingOp< StartIndices, Sizes, ArgType >, Device >::m_fastOutputStrides
array< internal::TensorIntDivisor< Index >, NumDims > m_fastOutputStrides
Definition: TensorMorphing.h:691
Eigen::TensorSlicingOp::expression
const EIGEN_DEVICE_FUNC internal::remove_all< typename XprType::Nested >::type & expression() const
Definition: TensorMorphing.h:361
Eigen::internal::TensorIntDivisor< Index >
Eigen::DSizes< Index, NumDims >
Eigen::TensorEvaluator< const TensorSlicingOp< StartIndices, Sizes, ArgType >, Device >::Dimensions
Sizes Dimensions
Definition: TensorMorphing.h:416
make_changelog.desc
desc
Definition: make_changelog.py:71
Eigen::Sizes
Definition: TensorDimensions.h:93
Eigen::internal::traits< TensorReshapingOp< NewDimensions, XprType > >::PointerType
XprTraits::PointerType PointerType
Definition: TensorMorphing.h:34
test_eigen_tensor.indices
indices
Definition: test_eigen_tensor.py:33
Eigen::internal::traits< TensorStridingSlicingOp< StartIndices, StopIndices, Strides, XprType > >::Scalar
XprType::Scalar Scalar
Definition: TensorMorphing.h:809
Eigen::TensorEvaluator< const TensorReshapingOp< NewDimensions, ArgType >, Device >::Storage
StorageMemory< CoeffReturnType, Device > Storage
Definition: TensorMorphing.h:93
Eigen::TensorReshapingOp::m_xpr
XprType::Nested m_xpr
Definition: TensorMorphing.h:77
Eigen::TensorStridingSlicingOp
Definition: TensorForwardDeclarations.h:83
Eigen::TensorReshapingOp::StorageKind
Eigen::internal::traits< TensorReshapingOp >::StorageKind StorageKind
Definition: TensorMorphing.h:61
Eigen::TensorStridingSlicingOp::expression
const EIGEN_DEVICE_FUNC internal::remove_all< typename XprType::Nested >::type & expression() const
Definition: TensorMorphing.h:861
Eigen::internal::traits< TensorSlicingOp< StartIndices, Sizes, XprType > >::XprTraits
traits< XprType > XprTraits
Definition: TensorMorphing.h:314
EIGEN_ALIGN_MAX
#define EIGEN_ALIGN_MAX
Definition: ConfigureVectorization.h:157
Eigen::TensorEvaluator< const TensorReshapingOp< NewDimensions, ArgType >, Device >::PacketReturnType
PacketType< CoeffReturnType, Device >::type PacketReturnType
Definition: TensorMorphing.h:92
Eigen::PacketType
Definition: TensorMeta.h:50
Eigen::TensorEvaluator< TensorReshapingOp< NewDimensions, ArgType >, Device >::Dimensions
NewDimensions Dimensions
Definition: TensorMorphing.h:246
Eigen::internal::TensorBlockDescriptor
Definition: TensorBlock.h:188
Eigen::internal::true_type
Definition: Meta.h:96
Eigen::TensorStridingSlicingOp::strides
const EIGEN_DEVICE_FUNC StartIndices & strides() const
Definition: TensorMorphing.h:857
Eigen::TensorStridingSlicingOp::startIndices
const EIGEN_DEVICE_FUNC StartIndices & startIndices() const
Definition: TensorMorphing.h:853
Eigen::TensorEvaluator< TensorStridingSlicingOp< StartIndices, StopIndices, Strides, ArgType >, Device >::XprType
TensorStridingSlicingOp< StartIndices, StopIndices, Strides, ArgType > XprType
Definition: TensorMorphing.h:1062
Eigen::TensorEvaluator< const TensorSlicingOp< StartIndices, Sizes, ArgType >, Device >::TensorBlockScratch
internal::TensorBlockScratchAllocator< Device > TensorBlockScratch
Definition: TensorMorphing.h:439
Eigen::TensorEvaluator< TensorSlicingOp< StartIndices, Sizes, ArgType >, Device >::Scalar
XprType::Scalar Scalar
Definition: TensorMorphing.h:711
Eigen::TensorEvaluator< const TensorSlicingOp< StartIndices, Sizes, ArgType >, Device >::m_device
const Device EIGEN_DEVICE_REF m_device
Definition: TensorMorphing.h:694
Eigen::TensorEvaluator< TensorSlicingOp< StartIndices, Sizes, ArgType >, Device >::TensorBlockScratch
internal::TensorBlockScratchAllocator< Device > TensorBlockScratch
Definition: TensorMorphing.h:730
Eigen::TensorEvaluator< const TensorSlicingOp< StartIndices, Sizes, ArgType >, Device >::dimensions
EIGEN_DEVICE_FUNC const EIGEN_STRONG_INLINE Dimensions & dimensions() const
Definition: TensorMorphing.h:491
Eigen::TensorEvaluator< const TensorSlicingOp< StartIndices, Sizes, ArgType >, Device >::CoeffReturnType
XprType::CoeffReturnType CoeffReturnType
Definition: TensorMorphing.h:414
NByOne
Eigen::IndexList< Index, Eigen::type2index< 1 > > NByOne(Index n)
Definition: cxx11_tensor_block_eval.cpp:107
Eigen::TensorEvaluator< const TensorSlicingOp< StartIndices, Sizes, ArgType >, Device >::PacketReturnType
PacketType< CoeffReturnType, Device >::type PacketReturnType
Definition: TensorMorphing.h:415
Eigen::internal::traits< TensorReshapingOp< NewDimensions, XprType > >::_Nested
remove_reference< Nested >::type _Nested
Definition: TensorMorphing.h:31
Eigen::TensorEvaluator< const TensorSlicingOp< StartIndices, Sizes, ArgType >, Device >::m_offsets
const StartIndices m_offsets
Definition: TensorMorphing.h:697
Eigen::TensorReshapingOp::CoeffReturnType
internal::remove_const< typename XprType::CoeffReturnType >::type CoeffReturnType
Definition: TensorMorphing.h:59
Eigen::TensorStridingSlicingOp::Index
internal::traits< TensorStridingSlicingOp >::Index Index
Definition: TensorMorphing.h:844
Eigen::TensorEvaluator< const TensorReshapingOp< NewDimensions, ArgType >, Device >::impl
const EIGEN_DEVICE_FUNC TensorEvaluator< ArgType, Device > & impl() const
Definition: TensorMorphing.h:224
j
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2
Eigen::TensorEvaluator< const TensorReshapingOp< NewDimensions, ArgType >, Device >::cleanup
EIGEN_STRONG_INLINE void cleanup()
Definition: TensorMorphing.h:166
Eigen::TensorEvaluator< TensorReshapingOp< NewDimensions, ArgType >, Device >::CoeffReturnType
XprType::CoeffReturnType CoeffReturnType
Definition: TensorMorphing.h:264
Eigen::TensorEvaluator< const TensorSlicingOp< StartIndices, Sizes, ArgType >, Device >::TensorBlockDesc
internal::TensorBlockDescriptor< NumDims, Index > TensorBlockDesc
Definition: TensorMorphing.h:438
Eigen::TensorReshapingOp
Definition: TensorForwardDeclarations.h:76
Eigen::internal::eval< TensorReshapingOp< NewDimensions, XprType >, Eigen::Dense >::type
const typedef TensorReshapingOp< NewDimensions, XprType > EIGEN_DEVICE_REF type
Definition: TensorMorphing.h:40
operator()
internal::enable_if< internal::valid_indexed_view_overload< RowIndices, ColIndices >::value &&internal::traits< typename EIGEN_INDEXED_VIEW_METHOD_TYPE< RowIndices, ColIndices >::type >::ReturnAsIndexedView, typename EIGEN_INDEXED_VIEW_METHOD_TYPE< RowIndices, ColIndices >::type >::type operator()(const RowIndices &rowIndices, const ColIndices &colIndices) EIGEN_INDEXED_VIEW_METHOD_CONST
Definition: IndexedViewMethods.h:73
Eigen::TensorSlicingOp::Index
Eigen::internal::traits< TensorSlicingOp >::Index Index
Definition: TensorMorphing.h:349
Eigen::TensorEvaluator< TensorStridingSlicingOp< StartIndices, StopIndices, Strides, ArgType >, Device >::Base
TensorEvaluator< const TensorStridingSlicingOp< StartIndices, StopIndices, Strides, ArgType >, Device > Base
Definition: TensorMorphing.h:1061
Eigen::TensorSlicingOp::Base
TensorBase< TensorSlicingOp< StartIndices, Sizes, XprType > > Base
Definition: TensorMorphing.h:344
Eigen::TensorEvaluator< const TensorStridingSlicingOp< StartIndices, StopIndices, Strides, ArgType >, Device >::m_strides
const Strides m_strides
Definition: TensorMorphing.h:1053
Eigen::internal::traits< TensorReshapingOp< NewDimensions, XprType > >::StorageKind
XprTraits::StorageKind StorageKind
Definition: TensorMorphing.h:28
Eigen::TensorEvaluator< const TensorReshapingOp< NewDimensions, ArgType >, Device >::TensorBlockScratch
internal::TensorBlockScratchAllocator< Device > TensorBlockScratch
Definition: TensorMorphing.h:137
Eigen::TensorEvaluator< const TensorSlicingOp< StartIndices, Sizes, ArgType >, Device >::evalSubExprsIfNeeded
EIGEN_STRONG_INLINE bool evalSubExprsIfNeeded(EvaluatorPointerType data)
Definition: TensorMorphing.h:493
Eigen::TensorEvaluator::data
EIGEN_DEVICE_FUNC EvaluatorPointerType data() const
Definition: TensorEvaluator.h:181
Eigen::numext::mini
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE T mini(const T &x, const T &y)
Definition: Eigen/src/Core/MathFunctions.h:1085
Eigen::TensorReshapingOp::Base
TensorBase< TensorReshapingOp< NewDimensions, XprType >, WriteAccessors > Base
Definition: TensorMorphing.h:57
Eigen::TensorEvaluator< const TensorReshapingOp< NewDimensions, ArgType >, Device >::ScalarNoConst
internal::remove_const< Scalar >::type ScalarNoConst
Definition: TensorMorphing.h:133
Eigen::TensorEvaluator< const TensorReshapingOp< NewDimensions, ArgType >, Device >::TensorBlock
internal::TensorMaterializedBlock< ScalarNoConst, NumOutputDims, Layout, Index > TensorBlock
Definition: TensorMorphing.h:142
Eigen::TensorEvaluator< TensorSlicingOp< StartIndices, Sizes, ArgType >, Device >::CoeffReturnType
XprType::CoeffReturnType CoeffReturnType
Definition: TensorMorphing.h:712
Eigen::internal::traits< TensorSlicingOp< StartIndices, Sizes, XprType > >::Nested
XprType::Nested Nested
Definition: TensorMorphing.h:317
EIGEN_STRONG_INLINE
#define EIGEN_STRONG_INLINE
Definition: Macros.h:917
EIGEN_UNROLL_LOOP
#define EIGEN_UNROLL_LOOP
Definition: Macros.h:1461
Eigen::internal::traits< TensorStridingSlicingOp< StartIndices, StopIndices, Strides, XprType > >::XprTraits
traits< XprType > XprTraits
Definition: TensorMorphing.h:810
Eigen::TensorEvaluator< const TensorSlicingOp< StartIndices, Sizes, ArgType >, Device >::coeff
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(Index index) const
Definition: TensorMorphing.h:539
Eigen::TensorEvaluator::PreferBlockAccess
@ PreferBlockAccess
Definition: TensorEvaluator.h:49
Eigen::internal::nested< TensorReshapingOp< NewDimensions, XprType >, 1, typename eval< TensorReshapingOp< NewDimensions, XprType > >::type >::type
TensorReshapingOp< NewDimensions, XprType > type
Definition: TensorMorphing.h:46
Eigen::TensorEvaluator< const TensorReshapingOp< NewDimensions, ArgType >, Device >
Definition: TensorMorphing.h:84
Eigen::TensorEvaluator< const TensorReshapingOp< NewDimensions, ArgType >, Device >::EvaluatorPointerType
Storage::Type EvaluatorPointerType
Definition: TensorMorphing.h:94
Eigen::TensorEvaluator< const TensorSlicingOp< StartIndices, Sizes, ArgType >, Device >::m_outputStrides
array< Index, NumDims > m_outputStrides
Definition: TensorMorphing.h:690
Eigen::TensorEvaluator::ScalarNoConst
internal::remove_const< Scalar >::type ScalarNoConst
Definition: TensorEvaluator.h:55
Eigen::TensorEvaluator< TensorReshapingOp< NewDimensions, ArgType >, Device >::writeBlock
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void writeBlock(const TensorBlockDesc &desc, const TensorBlock &block)
Definition: TensorMorphing.h:284
Eigen::TensorMap< const Tensor< Scalar, NumDims, Layout > >
Eigen::TensorEvaluator< const TensorStridingSlicingOp< StartIndices, StopIndices, Strides, ArgType >, Device >::Storage
StorageMemory< CoeffReturnType, Device > Storage
Definition: TensorMorphing.h:882
Eigen::TensorEvaluator< TensorSlicingOp< StartIndices, Sizes, ArgType >, Device >::PacketReturnType
PacketType< CoeffReturnType, Device >::type PacketReturnType
Definition: TensorMorphing.h:713
Eigen::TensorEvaluator< const TensorSlicingOp< StartIndices, Sizes, ArgType >, Device >::Index
XprType::Index Index
Definition: TensorMorphing.h:412
Eigen::TensorStridingSlicingOp::m_startIndices
const StartIndices m_startIndices
Definition: TensorMorphing.h:867
Eigen::TensorEvaluator< const TensorStridingSlicingOp< StartIndices, StopIndices, Strides, ArgType >, Device >::PacketReturnType
PacketType< CoeffReturnType, Device >::type PacketReturnType
Definition: TensorMorphing.h:881
Eigen::TensorEvaluator< TensorReshapingOp< NewDimensions, ArgType >, Device >::Scalar
XprType::Scalar Scalar
Definition: TensorMorphing.h:263
Eigen::TensorEvaluator< const TensorStridingSlicingOp< StartIndices, StopIndices, Strides, ArgType >, Device >::Index
XprType::Index Index
Definition: TensorMorphing.h:878
Eigen::Triplet< double >
Eigen::TensorEvaluator< const TensorReshapingOp< NewDimensions, ArgType >, Device >::TensorEvaluator
EIGEN_STRONG_INLINE TensorEvaluator(const XprType &op, const Device &device)
Definition: TensorMorphing.h:145
Eigen::TensorEvaluator< const TensorSlicingOp< StartIndices, Sizes, ArgType >, Device >::ScalarNoConst
internal::remove_const< Scalar >::type ScalarNoConst
Definition: TensorMorphing.h:435
Eigen::TensorEvaluator< const TensorSlicingOp< StartIndices, Sizes, ArgType >, Device >::packet
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE PacketReturnType packet(Index index) const
Definition: TensorMorphing.h:549
Eigen::TensorEvaluator< const TensorReshapingOp< NewDimensions, ArgType >, Device >::TensorBlockDesc
internal::TensorBlockDescriptor< NumOutputDims, Index > TensorBlockDesc
Definition: TensorMorphing.h:136
Eigen::TensorStridingSlicingOp::CoeffReturnType
XprType::CoeffReturnType CoeffReturnType
Definition: TensorMorphing.h:841
Eigen::TensorEvaluator::m_device
const Device EIGEN_DEVICE_REF m_device
Definition: TensorEvaluator.h:192
Eigen::StorageMemory
Definition: TensorForwardDeclarations.h:37
Eigen::TensorBase
The tensor base class.
Definition: TensorBase.h:973
Eigen::TensorEvaluator< const TensorStridingSlicingOp< StartIndices, StopIndices, Strides, ArgType >, Device >
Definition: TensorMorphing.h:874
Eigen::TensorEvaluator< const TensorSlicingOp< StartIndices, Sizes, ArgType >, Device >::srcCoeff
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index srcCoeff(Index index) const
Definition: TensorMorphing.h:667
Eigen::TensorEvaluator< TensorReshapingOp< NewDimensions, ArgType >, Device >::TensorBlockDesc
internal::TensorBlockDescriptor< TensorEvaluator::NumOutputDims, Index > TensorBlockDesc
Definition: TensorMorphing.h:269
Eigen::TensorEvaluator< const TensorReshapingOp< NewDimensions, ArgType >, Device >::BlockIteratorState::span
Index span
Definition: TensorMorphing.h:194
Eigen::internal::array_prod
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE std::ptrdiff_t array_prod(const Sizes< Indices... > &)
Definition: TensorDimensions.h:140
Eigen::TensorEvaluator< const TensorStridingSlicingOp< StartIndices, StopIndices, Strides, ArgType >, Device >::m_device
const Device EIGEN_DEVICE_REF m_device
Definition: TensorMorphing.h:1049
Eigen::TensorEvaluator< const TensorStridingSlicingOp< StartIndices, StopIndices, Strides, ArgType >, Device >::EvaluatorPointerType
Storage::Type EvaluatorPointerType
Definition: TensorMorphing.h:883
Eigen::internal::array_size
Definition: Meta.h:445
Eigen::TensorEvaluator::BlockAccess
@ BlockAccess
Definition: TensorEvaluator.h:48
offset
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 y set format x g set format y g set format x2 g set format y2 g set format z g set angles radians set nogrid set key title set key left top Right noreverse box linetype linewidth samplen spacing width set nolabel set noarrow set nologscale set logscale x set set pointsize set encoding default set nopolar set noparametric set set set set surface set nocontour set clabel set mapping cartesian set nohidden3d set cntrparam order set cntrparam linear set cntrparam levels auto set cntrparam points set size set set xzeroaxis lt lw set x2zeroaxis lt lw set yzeroaxis lt lw set y2zeroaxis lt lw set tics in set ticslevel set tics set mxtics default set mytics default set mx2tics default set my2tics default set xtics border mirror norotate autofreq set ytics border mirror norotate autofreq set ztics border nomirror norotate autofreq set nox2tics set noy2tics set timestamp bottom norotate offset
Definition: gnuplot_common_settings.hh:64
Eigen::TensorEvaluator< TensorSlicingOp< StartIndices, Sizes, ArgType >, Device >::XprType
TensorSlicingOp< StartIndices, Sizes, ArgType > XprType
Definition: TensorMorphing.h:707
Eigen::TensorSlicingOp::startIndices
const EIGEN_DEVICE_FUNC StartIndices & startIndices() const
Definition: TensorMorphing.h:355
Eigen::TensorEvaluator< TensorStridingSlicingOp< StartIndices, StopIndices, Strides, ArgType >, Device >::CoeffReturnType
XprType::CoeffReturnType CoeffReturnType
Definition: TensorMorphing.h:1085
Eigen::TensorEvaluator< TensorSlicingOp< StartIndices, Sizes, ArgType >, Device >::Index
XprType::Index Index
Definition: TensorMorphing.h:710
Eigen::TensorSlicingOp::m_sizes
const Sizes m_sizes
Definition: TensorMorphing.h:368
Eigen::TensorEvaluator::coeffRef
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType & coeffRef(Index index)
Definition: TensorEvaluator.h:99
Eigen::internal::traits< TensorStridingSlicingOp< StartIndices, StopIndices, Strides, XprType > >::Index
XprTraits::Index Index
Definition: TensorMorphing.h:812
Eigen::TensorEvaluator< const TensorStridingSlicingOp< StartIndices, StopIndices, Strides, ArgType >, Device >::dimensions
EIGEN_DEVICE_FUNC const EIGEN_STRONG_INLINE Dimensions & dimensions() const
Definition: TensorMorphing.h:980
Eigen::TensorEvaluator< const TensorReshapingOp< NewDimensions, ArgType >, Device >::coeff
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(Index index) const
Definition: TensorMorphing.h:170
Eigen::TensorStridingSlicingOp::stopIndices
const EIGEN_DEVICE_FUNC StartIndices & stopIndices() const
Definition: TensorMorphing.h:855
Eigen::internal::TensorBlockDescriptor::HasDestinationBuffer
bool HasDestinationBuffer() const
Definition: TensorBlock.h:326
Eigen::TensorEvaluator< const TensorStridingSlicingOp< StartIndices, StopIndices, Strides, ArgType >, Device >::m_dimensions
DSizes< Index, NumDims > m_dimensions
Definition: TensorMorphing.h:1051
Eigen::internal::traits< TensorReshapingOp< NewDimensions, XprType > >::Scalar
XprType::Scalar Scalar
Definition: TensorMorphing.h:26
EIGEN_TENSOR_INHERIT_ASSIGNMENT_OPERATORS
#define EIGEN_TENSOR_INHERIT_ASSIGNMENT_OPERATORS(Derived)
Definition: TensorMacros.h:94
Eigen::TensorEvaluator< const TensorSlicingOp< StartIndices, Sizes, ArgType >, Device >::TensorEvaluator
EIGEN_STRONG_INLINE TensorEvaluator(const XprType &op, const Device &device)
Definition: TensorMorphing.h:446
Eigen::internal::TensorBlockAssignment
Definition: TensorBlock.h:1381
Eigen::internal::traits
Definition: ForwardDeclarations.h:17
Eigen::internal::traits< TensorStridingSlicingOp< StartIndices, StopIndices, Strides, XprType > >::Nested
XprType::Nested Nested
Definition: TensorMorphing.h:813
Eigen::internal::traits< TensorSlicingOp< StartIndices, Sizes, XprType > >::Scalar
XprType::Scalar Scalar
Definition: TensorMorphing.h:313
Eigen::TensorEvaluator< const TensorStridingSlicingOp< StartIndices, StopIndices, Strides, ArgType >, Device >::m_offsets
DSizes< Index, NumDims > m_offsets
Definition: TensorMorphing.h:1052
EIGEN_STATIC_ASSERT
#define EIGEN_STATIC_ASSERT(CONDITION, MSG)
Definition: StaticAssert.h:127
Eigen::TensorEvaluator< const TensorSlicingOp< StartIndices, Sizes, ArgType >, Device >
Definition: TensorMorphing.h:407
Eigen::internal::eval< TensorSlicingOp< StartIndices, Sizes, XprType >, Eigen::Dense >::type
const typedef TensorSlicingOp< StartIndices, Sizes, XprType > EIGEN_DEVICE_REF type
Definition: TensorMorphing.h:327
Eigen::TensorEvaluator< const TensorStridingSlicingOp< StartIndices, StopIndices, Strides, ArgType >, Device >::CoeffReturnType
XprType::CoeffReturnType CoeffReturnType
Definition: TensorMorphing.h:880
Eigen::TensorEvaluator< const TensorSlicingOp< StartIndices, Sizes, ArgType >, Device >::EvaluatorPointerType
Storage::Type EvaluatorPointerType
Definition: TensorMorphing.h:419
Eigen::TensorEvaluator::EvaluatorPointerType
Storage::Type EvaluatorPointerType
Definition: TensorEvaluator.h:39
Eigen::TensorEvaluator< TensorStridingSlicingOp< StartIndices, StopIndices, Strides, ArgType >, Device >::Dimensions
Strides Dimensions
Definition: TensorMorphing.h:1087
Eigen::internal::traits< TensorReshapingOp< NewDimensions, XprType > >::XprTraits
traits< XprType > XprTraits
Definition: TensorMorphing.h:27
Eigen::TensorEvaluator< const TensorReshapingOp< NewDimensions, ArgType >, Device >::ConstCastStorage
StorageMemory< typename internal::remove_const< CoeffReturnType >::type, Device > ConstCastStorage
Definition: TensorMorphing.h:95
Eigen::internal::TensorBlockResourceRequirements
Definition: TensorBlock.h:75
Eigen::TensorSlicingOp
Definition: TensorForwardDeclarations.h:78
Eigen::TensorEvaluator< const TensorStridingSlicingOp< StartIndices, StopIndices, Strides, ArgType >, Device >::TensorBlock
internal::TensorBlockNotImplemented TensorBlock
Definition: TensorMorphing.h:898
Eigen::TensorEvaluator< const TensorSlicingOp< StartIndices, Sizes, ArgType >, Device >::getResourceRequirements
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE internal::TensorBlockResourceRequirements getResourceRequirements() const
Definition: TensorMorphing.h:608
Eigen::TensorEvaluator< const TensorReshapingOp< NewDimensions, ArgType >, Device >::BlockIteratorState::count
Index count
Definition: TensorMorphing.h:196
Eigen::TensorEvaluator< const TensorStridingSlicingOp< StartIndices, StopIndices, Strides, ArgType >, Device >::Scalar
XprType::Scalar Scalar
Definition: TensorMorphing.h:879
Eigen::TensorEvaluator< const TensorStridingSlicingOp< StartIndices, StopIndices, Strides, ArgType >, Device >::m_startIndices
DSizes< Index, NumDims > m_startIndices
Definition: TensorMorphing.h:1050
Eigen::internal::traits< TensorReshapingOp< NewDimensions, XprType > >::Index
XprTraits::Index Index
Definition: TensorMorphing.h:29
Eigen::TensorEvaluator::coeff
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(Index index) const
Definition: TensorEvaluator.h:94
Eigen::TensorEvaluator< const TensorStridingSlicingOp< StartIndices, StopIndices, Strides, ArgType >, Device >::m_is_identity
bool m_is_identity
Definition: TensorMorphing.h:1047
Eigen::TensorEvaluator< TensorReshapingOp< NewDimensions, ArgType >, Device >::Base
TensorEvaluator< const TensorReshapingOp< NewDimensions, ArgType >, Device > Base
Definition: TensorMorphing.h:244
EIGEN_DEVICE_REF
#define EIGEN_DEVICE_REF
Definition: TensorMacros.h:50
Eigen::TensorEvaluator< TensorReshapingOp< NewDimensions, ArgType >, Device >::PacketReturnType
PacketType< CoeffReturnType, Device >::type PacketReturnType
Definition: TensorMorphing.h:265
Eigen::internal::nested< TensorSlicingOp< StartIndices, Sizes, XprType >, 1, typename eval< TensorSlicingOp< StartIndices, Sizes, XprType > >::type >::type
TensorSlicingOp< StartIndices, Sizes, XprType > type
Definition: TensorMorphing.h:333
Eigen::TensorEvaluator< const TensorStridingSlicingOp< StartIndices, StopIndices, Strides, ArgType >, Device >::srcCoeff
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index srcCoeff(Index index) const
Definition: TensorMorphing.h:1015
Eigen::TensorSlicingOp::sizes
const EIGEN_DEVICE_FUNC Sizes & sizes() const
Definition: TensorMorphing.h:357
Eigen::TensorEvaluator< const TensorReshapingOp< NewDimensions, ArgType >, Device >::dimensions
EIGEN_DEVICE_FUNC const EIGEN_STRONG_INLINE Dimensions & dimensions() const
Definition: TensorMorphing.h:153
Eigen::TensorEvaluator
A cost model used to limit the number of threads used for evaluating tensor expression.
Definition: TensorEvaluator.h:28
Eigen::TensorReshapingOp::Nested
Eigen::internal::nested< TensorReshapingOp >::type Nested
Definition: TensorMorphing.h:60
Eigen::TensorEvaluator< TensorSlicingOp< StartIndices, Sizes, ArgType >, Device >::writeBlock
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void writeBlock(const TensorBlockDesc &desc, const TensorBlock &block)
Definition: TensorMorphing.h:798
Eigen::TensorEvaluator::Scalar
Derived::Scalar Scalar
Definition: TensorEvaluator.h:31
Eigen::TensorEvaluator< TensorReshapingOp< NewDimensions, ArgType >, Device >::Index
XprType::Index Index
Definition: TensorMorphing.h:262
Eigen::TensorSlicingOp::TensorSlicingOp
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorSlicingOp(const XprType &expr, const StartIndices &indices, const Sizes &sizes)
Definition: TensorMorphing.h:351
Eigen::internal::is_same
Definition: Meta.h:148
Eigen::TensorStridingSlicingOp::Base
TensorBase< TensorStridingSlicingOp< StartIndices, StopIndices, Strides, XprType > > Base
Definition: TensorMorphing.h:839
Eigen::internal::TensorMaterializedBlock::expr
const XprType & expr() const
Definition: TensorBlock.h:677
Eigen::TensorEvaluator< TensorSlicingOp< StartIndices, Sizes, ArgType >, Device >::TensorEvaluator
EIGEN_STRONG_INLINE TensorEvaluator(const XprType &op, const Device &device)
Definition: TensorMorphing.h:733
Eigen::TensorStridingSlicingOp::Scalar
internal::traits< TensorStridingSlicingOp >::Scalar Scalar
Definition: TensorMorphing.h:840
internal
Definition: BandTriangularSolver.h:13
Eigen::numext::maxi
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE T maxi(const T &x, const T &y)
Definition: Eigen/src/Core/MathFunctions.h:1093
Eigen::min
CleanedUpDerType< DerType >::type() min(const AutoDiffScalar< DerType > &x, const T &y)
Definition: AutoDiffScalar.h:580
Eigen::TensorEvaluator< const TensorSlicingOp< StartIndices, Sizes, ArgType >, Device >::m_impl
TensorEvaluator< ArgType, Device > m_impl
Definition: TensorMorphing.h:693
NULL
#define NULL
Definition: ccolamd.c:609
Eigen::TensorReshapingOp::m_dims
const NewDimensions m_dims
Definition: TensorMorphing.h:78
Eigen::TensorEvaluator< const TensorSlicingOp< StartIndices, Sizes, ArgType >, Device >::XprType
TensorSlicingOp< StartIndices, Sizes, ArgType > XprType
Definition: TensorMorphing.h:409
Eigen::ColMajor
@ ColMajor
Definition: Constants.h:319
Eigen::TensorEvaluator< TensorReshapingOp< NewDimensions, ArgType >, Device >::writePacket
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void writePacket(Index index, const PacketReturnType &x)
Definition: TensorMorphing.h:278
Eigen::TensorEvaluator::IsAligned
@ IsAligned
Definition: TensorEvaluator.h:46
Eigen::TensorEvaluator< const TensorReshapingOp< NewDimensions, ArgType >, Device >::m_impl
TensorEvaluator< ArgType, Device > m_impl
Definition: TensorMorphing.h:233
Eigen::TensorEvaluator::block
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorBlock block(TensorBlockDesc &desc, TensorBlockScratch &scratch, bool=false) const
Definition: TensorEvaluator.h:158
Eigen::TensorEvaluator< TensorStridingSlicingOp< StartIndices, StopIndices, Strides, ArgType >, Device >::Scalar
XprType::Scalar Scalar
Definition: TensorMorphing.h:1084
Eigen::TensorEvaluator< const TensorStridingSlicingOp< StartIndices, StopIndices, Strides, ArgType >, Device >::Dimensions
Strides Dimensions
Definition: TensorMorphing.h:884
Eigen::TensorEvaluator< TensorSlicingOp< StartIndices, Sizes, ArgType >, Device >::Dimensions
Sizes Dimensions
Definition: TensorMorphing.h:714
Eigen::WriteAccessors
@ WriteAccessors
Definition: Constants.h:378
Eigen::TensorEvaluator< const TensorStridingSlicingOp< StartIndices, StopIndices, Strides, ArgType >, Device >::m_outputStrides
array< Index, NumDims > m_outputStrides
Definition: TensorMorphing.h:1044
Eigen::internal::eval
Definition: XprHelper.h:332
Eigen::TensorEvaluator::PacketAccess
@ PacketAccess
Definition: TensorEvaluator.h:47
Eigen::TensorEvaluator< const TensorReshapingOp< NewDimensions, ArgType >, Device >::Scalar
XprType::Scalar Scalar
Definition: TensorMorphing.h:90
Eigen::TensorEvaluator< TensorStridingSlicingOp< StartIndices, StopIndices, Strides, ArgType >, Device >::TensorBlock
internal::TensorBlockNotImplemented TensorBlock
Definition: TensorMorphing.h:1076
Eigen::TensorEvaluator< const TensorStridingSlicingOp< StartIndices, StopIndices, Strides, ArgType >, Device >::m_fastOutputStrides
array< internal::TensorIntDivisor< Index >, NumDims > m_fastOutputStrides
Definition: TensorMorphing.h:1045
Eigen::TensorEvaluator< const TensorReshapingOp< NewDimensions, ArgType >, Device >::m_dimensions
NewDimensions m_dimensions
Definition: TensorMorphing.h:234
Eigen::TensorEvaluator< const TensorReshapingOp< NewDimensions, ArgType >, Device >::BlockIteratorState::stride
Index stride
Definition: TensorMorphing.h:193
Eigen::internal::eval< TensorStridingSlicingOp< StartIndices, StopIndices, Strides, XprType >, Eigen::Dense >::type
const typedef TensorStridingSlicingOp< StartIndices, StopIndices, Strides, XprType > EIGEN_DEVICE_REF type
Definition: TensorMorphing.h:823
Eigen::TensorEvaluator< const TensorReshapingOp< NewDimensions, ArgType >, Device >::BlockIteratorState::size
Index size
Definition: TensorMorphing.h:195
Eigen::TensorEvaluator< const TensorReshapingOp< NewDimensions, ArgType >, Device >::CoeffReturnType
XprType::CoeffReturnType CoeffReturnType
Definition: TensorMorphing.h:91
Eigen::TensorEvaluator< const TensorReshapingOp< NewDimensions, ArgType >, Device >::XprType
TensorReshapingOp< NewDimensions, ArgType > XprType
Definition: TensorMorphing.h:86
Eigen::internal::traits< TensorStridingSlicingOp< StartIndices, StopIndices, Strides, XprType > >::StorageKind
XprTraits::StorageKind StorageKind
Definition: TensorMorphing.h:811
Eigen::TensorEvaluator< TensorStridingSlicingOp< StartIndices, StopIndices, Strides, ArgType >, Device >::PacketReturnType
PacketType< CoeffReturnType, Device >::type PacketReturnType
Definition: TensorMorphing.h:1086
Eigen::TensorOpCost
Definition: TensorCostModel.h:25
Eigen::TensorEvaluator< const TensorReshapingOp< NewDimensions, ArgType >, Device >::data
EIGEN_DEVICE_FUNC Storage::Type data() const
Definition: TensorMorphing.h:220
Eigen::NumTraits
Holds information about the various numeric (i.e. scalar) types allowed by Eigen.
Definition: NumTraits.h:232
Eigen::constCast
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T * constCast(const T *data)
Definition: TensorForwardDeclarations.h:27
test_callbacks.value
value
Definition: test_callbacks.py:160
i
int i
Definition: BiCGSTAB_step_by_step.cpp:9
Eigen::TensorReshapingOp::Scalar
Eigen::internal::traits< TensorReshapingOp >::Scalar Scalar
Definition: TensorMorphing.h:58
Eigen::TensorEvaluator< const TensorStridingSlicingOp< StartIndices, StopIndices, Strides, ArgType >, Device >::clamp
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index clamp(Index value, Index min, Index max)
Definition: TensorMorphing.h:1036
Eigen::TensorEvaluator< TensorReshapingOp< NewDimensions, ArgType >, Device >::TensorEvaluator
EIGEN_STRONG_INLINE TensorEvaluator(const XprType &op, const Device &device)
Definition: TensorMorphing.h:258
Eigen::TensorEvaluator< const TensorSlicingOp< StartIndices, Sizes, ArgType >, Device >::ConstCastStorage
StorageMemory< typename internal::remove_const< CoeffReturnType >::type, Device > ConstCastStorage
Definition: TensorMorphing.h:418
Eigen::internal::TensorBlockResourceRequirements::any
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorBlockResourceRequirements any()
Definition: TensorBlock.h:155
Scalar
SCALAR Scalar
Definition: bench_gemm.cpp:46
Eigen::TensorEvaluator< const TensorStridingSlicingOp< StartIndices, StopIndices, Strides, ArgType >, Device >::XprType
TensorStridingSlicingOp< StartIndices, StopIndices, Strides, ArgType > XprType
Definition: TensorMorphing.h:876
Eigen::TensorStridingSlicingOp::Nested
internal::nested< TensorStridingSlicingOp >::type Nested
Definition: TensorMorphing.h:842
Eigen::internal::traits< TensorSlicingOp< StartIndices, Sizes, XprType > >::_Nested
remove_reference< Nested >::type _Nested
Definition: TensorMorphing.h:318
Eigen::Index
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:74
Eigen::Dense
Definition: Constants.h:507
Eigen::TensorEvaluator< const TensorStridingSlicingOp< StartIndices, StopIndices, Strides, ArgType >, Device >::data
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Storage::Type data() const
Definition: TensorMorphing.h:1005


gtsam
Author(s):
autogenerated on Fri Nov 1 2024 03:38:20