TensorBase.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_BASE_H
11 #define EIGEN_CXX11_TENSOR_TENSOR_BASE_H
12 
13 // clang-format off
14 
15 #include "./InternalHeaderCheck.h"
16 
17 namespace Eigen {
18 
27 #ifndef EIGEN_PARSED_BY_DOXYGEN
28 // FIXME Doxygen does not like the inheritance with different template parameters
29 // Since there is no doxygen documentation inside, we disable it for now
30 template<typename Derived>
31 class TensorBase<Derived, ReadOnlyAccessors>
32 {
33  public:
34  typedef internal::traits<Derived> DerivedTraits;
35  typedef typename DerivedTraits::Scalar Scalar;
36  typedef typename DerivedTraits::Index Index;
37  typedef std::remove_const_t<Scalar> CoeffReturnType;
38  static constexpr int NumDimensions = DerivedTraits::NumDimensions;
39 
40  // Generic nullary operation support.
41  template <typename CustomNullaryOp> EIGEN_DEVICE_FUNC
42  EIGEN_STRONG_INLINE const TensorCwiseNullaryOp<CustomNullaryOp, const Derived>
43  nullaryExpr(const CustomNullaryOp& func) const {
44  return TensorCwiseNullaryOp<CustomNullaryOp, const Derived>(derived(), func);
45  }
46 
47  // Coefficient-wise nullary operators
49  EIGEN_STRONG_INLINE const TensorCwiseNullaryOp<internal::scalar_constant_op<Scalar>, const Derived>
50  constant(const Scalar& value) const {
51  return nullaryExpr(internal::scalar_constant_op<Scalar>(value));
52  }
53 
55  EIGEN_STRONG_INLINE const TensorCwiseNullaryOp<internal::UniformRandomGenerator<Scalar>, const Derived>
56  random() const {
57  return nullaryExpr(internal::UniformRandomGenerator<Scalar>());
58  }
59  template <typename RandomGenerator> EIGEN_DEVICE_FUNC
60  EIGEN_STRONG_INLINE const TensorCwiseNullaryOp<RandomGenerator, const Derived>
61  random(const RandomGenerator& gen = RandomGenerator()) const {
62  return nullaryExpr(gen);
63  }
64 
65  // Tensor generation
66  template <typename Generator> EIGEN_DEVICE_FUNC
67  EIGEN_STRONG_INLINE const TensorGeneratorOp<Generator, const Derived>
68  generate(const Generator& generator) const {
69  return TensorGeneratorOp<Generator, const Derived>(derived(), generator);
70  }
71 
72  // Generic unary operation support.
73  template <typename CustomUnaryOp> EIGEN_DEVICE_FUNC
74  EIGEN_STRONG_INLINE const TensorCwiseUnaryOp<CustomUnaryOp, const Derived>
75  unaryExpr(const CustomUnaryOp& func) const {
76  return TensorCwiseUnaryOp<CustomUnaryOp, const Derived>(derived(), func);
77  }
78 
79  // Coefficient-wise unary operators
81  EIGEN_STRONG_INLINE const TensorCwiseUnaryOp<internal::scalar_opposite_op<Scalar>, const Derived>
82  operator-() const {
83  return unaryExpr(internal::scalar_opposite_op<Scalar>());
84  }
85 
87  EIGEN_STRONG_INLINE const TensorCwiseUnaryOp<internal::scalar_sqrt_op<Scalar>, const Derived>
88  sqrt() const {
89  return unaryExpr(internal::scalar_sqrt_op<Scalar>());
90  }
91 
93  EIGEN_STRONG_INLINE const TensorCwiseUnaryOp<internal::scalar_sign_op<Scalar>, const Derived>
94  sign() const {
95  return unaryExpr(internal::scalar_sign_op<Scalar>());
96  }
97 
99  EIGEN_STRONG_INLINE const TensorCwiseUnaryOp<internal::scalar_rsqrt_op<Scalar>, const Derived>
100  rsqrt() const {
101  return unaryExpr(internal::scalar_rsqrt_op<Scalar>());
102  }
103 
105  EIGEN_STRONG_INLINE const TensorCwiseUnaryOp<internal::scalar_square_op<Scalar>, const Derived>
106  square() const {
107  return unaryExpr(internal::scalar_square_op<Scalar>());
108  }
109 
111  EIGEN_STRONG_INLINE const TensorCwiseUnaryOp<internal::scalar_cube_op<Scalar>, const Derived>
112  cube() const {
113  return unaryExpr(internal::scalar_cube_op<Scalar>());
114  }
115 
117  EIGEN_STRONG_INLINE const TensorCwiseUnaryOp<internal::scalar_inverse_op<Scalar>, const Derived>
118  inverse() const {
119  return unaryExpr(internal::scalar_inverse_op<Scalar>());
120  }
121 
123  EIGEN_STRONG_INLINE const TensorCwiseUnaryOp<internal::scalar_tanh_op<Scalar>, const Derived>
124  tanh() const {
125  return unaryExpr(internal::scalar_tanh_op<Scalar>());
126  }
127 
129  EIGEN_STRONG_INLINE const TensorCwiseUnaryOp<internal::scalar_lgamma_op<Scalar>, const Derived>
130  lgamma() const {
131  return unaryExpr(internal::scalar_lgamma_op<Scalar>());
132  }
133 
135  EIGEN_STRONG_INLINE const TensorCwiseUnaryOp<internal::scalar_digamma_op<Scalar>, const Derived>
136  digamma() const {
137  return unaryExpr(internal::scalar_digamma_op<Scalar>());
138  }
139 
141  EIGEN_STRONG_INLINE const TensorCwiseUnaryOp<internal::scalar_bessel_i0_op<Scalar>, const Derived>
142  bessel_i0() const {
143  return unaryExpr(internal::scalar_bessel_i0_op<Scalar>());
144  }
145 
147  EIGEN_STRONG_INLINE const TensorCwiseUnaryOp<internal::scalar_bessel_i0e_op<Scalar>, const Derived>
148  bessel_i0e() const {
149  return unaryExpr(internal::scalar_bessel_i0e_op<Scalar>());
150  }
151 
153  EIGEN_STRONG_INLINE const TensorCwiseUnaryOp<internal::scalar_bessel_i1_op<Scalar>, const Derived>
154  bessel_i1() const {
155  return unaryExpr(internal::scalar_bessel_i1_op<Scalar>());
156  }
157 
159  EIGEN_STRONG_INLINE const TensorCwiseUnaryOp<internal::scalar_bessel_i1e_op<Scalar>, const Derived>
160  bessel_i1e() const {
161  return unaryExpr(internal::scalar_bessel_i1e_op<Scalar>());
162  }
163 
165  EIGEN_STRONG_INLINE const TensorCwiseUnaryOp<internal::scalar_bessel_j0_op<Scalar>, const Derived>
166  bessel_j0() const {
167  return unaryExpr(internal::scalar_bessel_j0_op<Scalar>());
168  }
169 
171  EIGEN_STRONG_INLINE const TensorCwiseUnaryOp<internal::scalar_bessel_y0_op<Scalar>, const Derived>
172  bessel_y0() const {
173  return unaryExpr(internal::scalar_bessel_y0_op<Scalar>());
174  }
175 
177  EIGEN_STRONG_INLINE const TensorCwiseUnaryOp<internal::scalar_bessel_j1_op<Scalar>, const Derived>
178  bessel_j1() const {
179  return unaryExpr(internal::scalar_bessel_j1_op<Scalar>());
180  }
181 
183  EIGEN_STRONG_INLINE const TensorCwiseUnaryOp<internal::scalar_bessel_y1_op<Scalar>, const Derived>
184  bessel_y1() const {
185  return unaryExpr(internal::scalar_bessel_y1_op<Scalar>());
186  }
187 
189  EIGEN_STRONG_INLINE const TensorCwiseUnaryOp<internal::scalar_bessel_k0_op<Scalar>, const Derived>
190  bessel_k0() const {
191  return unaryExpr(internal::scalar_bessel_k0_op<Scalar>());
192  }
193 
195  EIGEN_STRONG_INLINE const TensorCwiseUnaryOp<internal::scalar_bessel_k0e_op<Scalar>, const Derived>
196  bessel_k0e() const {
197  return unaryExpr(internal::scalar_bessel_k0e_op<Scalar>());
198  }
199 
201  EIGEN_STRONG_INLINE const TensorCwiseUnaryOp<internal::scalar_bessel_k1_op<Scalar>, const Derived>
202  bessel_k1() const {
203  return unaryExpr(internal::scalar_bessel_k1_op<Scalar>());
204  }
205 
207  EIGEN_STRONG_INLINE const TensorCwiseUnaryOp<internal::scalar_bessel_k1e_op<Scalar>, const Derived>
208  bessel_k1e() const {
209  return unaryExpr(internal::scalar_bessel_k1e_op<Scalar>());
210  }
211 
212  // igamma(a = this, x = other)
213  template<typename OtherDerived> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
214  const TensorCwiseBinaryOp<internal::scalar_igamma_op<Scalar>, const Derived, const OtherDerived>
215  igamma(const OtherDerived& other) const {
216  return binaryExpr(other.derived(), internal::scalar_igamma_op<Scalar>());
217  }
218 
219  // igamma_der_a(a = this, x = other)
220  template<typename OtherDerived> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
221  const TensorCwiseBinaryOp<internal::scalar_igamma_der_a_op<Scalar>, const Derived, const OtherDerived>
222  igamma_der_a(const OtherDerived& other) const {
223  return binaryExpr(other.derived(), internal::scalar_igamma_der_a_op<Scalar>());
224  }
225 
226  // gamma_sample_der_alpha(alpha = this, sample = other)
227  template<typename OtherDerived> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
228  const TensorCwiseBinaryOp<internal::scalar_gamma_sample_der_alpha_op<Scalar>, const Derived, const OtherDerived>
229  gamma_sample_der_alpha(const OtherDerived& other) const {
230  return binaryExpr(other.derived(), internal::scalar_gamma_sample_der_alpha_op<Scalar>());
231  }
232 
233  // igammac(a = this, x = other)
234  template<typename OtherDerived> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
235  const TensorCwiseBinaryOp<internal::scalar_igammac_op<Scalar>, const Derived, const OtherDerived>
236  igammac(const OtherDerived& other) const {
237  return binaryExpr(other.derived(), internal::scalar_igammac_op<Scalar>());
238  }
239 
240  // zeta(x = this, q = other)
241  template<typename OtherDerived> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
242  const TensorCwiseBinaryOp<internal::scalar_zeta_op<Scalar>, const Derived, const OtherDerived>
243  zeta(const OtherDerived& other) const {
244  return binaryExpr(other.derived(), internal::scalar_zeta_op<Scalar>());
245  }
246 
247  // polygamma(n = this, x = other)
248  template<typename OtherDerived> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
249  const TensorCwiseBinaryOp<internal::scalar_polygamma_op<Scalar>, const Derived, const OtherDerived>
250  polygamma(const OtherDerived& other) const {
251  return binaryExpr(other.derived(), internal::scalar_polygamma_op<Scalar>());
252  }
253 
255  EIGEN_STRONG_INLINE const TensorCwiseUnaryOp<internal::scalar_erf_op<Scalar>, const Derived>
256  erf() const {
257  return unaryExpr(internal::scalar_erf_op<Scalar>());
258  }
259 
261  EIGEN_STRONG_INLINE const TensorCwiseUnaryOp<internal::scalar_erfc_op<Scalar>, const Derived>
262  erfc() const {
263  return unaryExpr(internal::scalar_erfc_op<Scalar>());
264  }
265 
267  EIGEN_STRONG_INLINE const TensorCwiseUnaryOp<internal::scalar_ndtri_op<Scalar>, const Derived>
268  ndtri() const {
269  return unaryExpr(internal::scalar_ndtri_op<Scalar>());
270  }
271 
273  EIGEN_STRONG_INLINE const TensorCwiseUnaryOp<internal::scalar_logistic_op<Scalar>, const Derived>
274  sigmoid() const {
275  return unaryExpr(internal::scalar_logistic_op<Scalar>());
276  }
277 
279  EIGEN_STRONG_INLINE const TensorCwiseUnaryOp<internal::scalar_exp_op<Scalar>, const Derived>
280  exp() const {
281  return unaryExpr(internal::scalar_exp_op<Scalar>());
282  }
283 
285  EIGEN_STRONG_INLINE const TensorCwiseUnaryOp<internal::scalar_expm1_op<Scalar>, const Derived>
286  expm1() const {
287  return unaryExpr(internal::scalar_expm1_op<Scalar>());
288  }
289 
291  EIGEN_STRONG_INLINE const TensorCwiseUnaryOp<internal::scalar_log_op<Scalar>, const Derived>
292  log() const {
293  return unaryExpr(internal::scalar_log_op<Scalar>());
294  }
295 
297  EIGEN_STRONG_INLINE const TensorCwiseUnaryOp<internal::scalar_log1p_op<Scalar>, const Derived>
298  log1p() const {
299  return unaryExpr(internal::scalar_log1p_op<Scalar>());
300  }
301 
303  EIGEN_STRONG_INLINE const TensorCwiseUnaryOp<internal::scalar_log2_op<Scalar>, const Derived>
304  log2() const {
305  return unaryExpr(internal::scalar_log2_op<Scalar>());
306  }
307 
309  EIGEN_STRONG_INLINE const TensorCwiseUnaryOp<internal::scalar_abs_op<Scalar>, const Derived>
310  abs() const {
311  return unaryExpr(internal::scalar_abs_op<Scalar>());
312  }
313 
315  EIGEN_STRONG_INLINE const TensorCwiseUnaryOp<internal::scalar_arg_op<Scalar>, const Derived>
316  arg() const {
317  return unaryExpr(internal::scalar_arg_op<Scalar>());
318  }
319 
321  EIGEN_STRONG_INLINE const TensorCwiseUnaryOp<internal::scalar_clamp_op<Scalar>, const Derived>
322  clip(Scalar min, Scalar max) const {
323  return unaryExpr(internal::scalar_clamp_op<Scalar>(min, max));
324  }
325 
327  EIGEN_STRONG_INLINE const std::conditional_t<NumTraits<CoeffReturnType>::IsComplex,
328  TensorCwiseUnaryOp<internal::scalar_conjugate_op<Scalar>, const Derived>,
329  Derived>
330  conjugate() const {
331  return choose(Cond<NumTraits<CoeffReturnType>::IsComplex>(), unaryExpr(internal::scalar_conjugate_op<Scalar>()), derived());
332  }
333 
334  template<typename ScalarExponent>
335  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const std::enable_if_t<internal::is_arithmetic<typename NumTraits<ScalarExponent>::Real>::value,
336  TensorCwiseUnaryOp<internal::scalar_unary_pow_op<Scalar, ScalarExponent>, const Derived>>
337  pow(ScalarExponent exponent) const
338  {
339  return unaryExpr(internal::scalar_unary_pow_op<Scalar, ScalarExponent>(exponent));
340  }
341 
343  EIGEN_STRONG_INLINE const TensorCwiseUnaryOp<internal::scalar_real_op<Scalar>, const Derived>
344  real() const {
345  return unaryExpr(internal::scalar_real_op<Scalar>());
346  }
347 
349  EIGEN_STRONG_INLINE const TensorCwiseUnaryOp<internal::scalar_imag_op<Scalar>, const Derived>
350  imag() const {
351  return unaryExpr(internal::scalar_imag_op<Scalar>());
352  }
353 
355  EIGEN_STRONG_INLINE const TensorCwiseUnaryOp<internal::bind2nd_op<internal::scalar_sum_op<Scalar,Scalar> >, const Derived>
356  operator+ (Scalar rhs) const {
357  return unaryExpr(internal::bind2nd_op<internal::scalar_sum_op<Scalar,Scalar> >(rhs));
358  }
359 
361  EIGEN_STRONG_INLINE friend
362  const TensorCwiseUnaryOp<internal::bind1st_op<internal::scalar_sum_op<Scalar> >, const Derived>
363  operator+ (Scalar lhs, const Derived& rhs) {
364  return rhs.unaryExpr(internal::bind1st_op<internal::scalar_sum_op<Scalar> >(lhs));
365  }
366 
368  EIGEN_STRONG_INLINE const TensorCwiseUnaryOp<internal::bind2nd_op<internal::scalar_difference_op<Scalar,Scalar> >, const Derived>
369  operator- (Scalar rhs) const {
370  EIGEN_STATIC_ASSERT((NumTraits<Scalar>::IsSigned || internal::is_same<Scalar, const std::complex<float> >::value), YOU_MADE_A_PROGRAMMING_MISTAKE);
371  return unaryExpr(internal::bind2nd_op<internal::scalar_difference_op<Scalar,Scalar> >(rhs));
372  }
373 
375  EIGEN_STRONG_INLINE friend
376  const TensorCwiseUnaryOp<internal::bind1st_op<internal::scalar_difference_op<Scalar> >, const Derived>
377  operator- (Scalar lhs, const Derived& rhs) {
378  return rhs.unaryExpr(internal::bind1st_op<internal::scalar_difference_op<Scalar> >(lhs));
379  }
380 
382  EIGEN_STRONG_INLINE const TensorCwiseUnaryOp<internal::bind2nd_op<internal::scalar_product_op<Scalar,Scalar> >, const Derived>
383  operator* (Scalar rhs) const {
384  return unaryExpr(internal::bind2nd_op<internal::scalar_product_op<Scalar,Scalar> >(rhs));
385  }
386 
388  EIGEN_STRONG_INLINE friend
389  const TensorCwiseUnaryOp<internal::bind1st_op<internal::scalar_product_op<Scalar> >, const Derived>
390  operator* (Scalar lhs, const Derived& rhs) {
391  return rhs.unaryExpr(internal::bind1st_op<internal::scalar_product_op<Scalar> >(lhs));
392  }
393 
395  EIGEN_STRONG_INLINE const TensorCwiseUnaryOp<internal::bind2nd_op<internal::scalar_quotient_op<Scalar,Scalar> >, const Derived>
396  operator/ (Scalar rhs) const {
397  return unaryExpr(internal::bind2nd_op<internal::scalar_quotient_op<Scalar,Scalar> >(rhs));
398  }
399 
401  EIGEN_STRONG_INLINE friend
402  const TensorCwiseUnaryOp<internal::bind1st_op<internal::scalar_quotient_op<Scalar> >, const Derived>
403  operator/ (Scalar lhs, const Derived& rhs) {
404  return rhs.unaryExpr(internal::bind1st_op<internal::scalar_quotient_op<Scalar> >(lhs));
405  }
406 
408  EIGEN_STRONG_INLINE const TensorCwiseUnaryOp<internal::scalar_mod_op<Scalar>, const Derived>
409  operator% (Scalar rhs) const {
410  EIGEN_STATIC_ASSERT(NumTraits<Scalar>::IsInteger, YOU_MADE_A_PROGRAMMING_MISTAKE_TRY_MOD);
411  return unaryExpr(internal::scalar_mod_op<Scalar>(rhs));
412  }
413 
414  template <int NanPropagation=PropagateFast>
416  EIGEN_STRONG_INLINE const TensorCwiseBinaryOp<internal::scalar_max_op<Scalar,Scalar,NanPropagation>, const Derived, const TensorCwiseNullaryOp<internal::scalar_constant_op<Scalar>, const Derived> >
417  cwiseMax(Scalar threshold) const {
418  return cwiseMax<NanPropagation>(constant(threshold));
419  }
420 
421  template <int NanPropagation=PropagateFast>
423  EIGEN_STRONG_INLINE const TensorCwiseBinaryOp<internal::scalar_min_op<Scalar,Scalar,NanPropagation>, const Derived, const TensorCwiseNullaryOp<internal::scalar_constant_op<Scalar>, const Derived> >
424  cwiseMin(Scalar threshold) const {
425  return cwiseMin<NanPropagation>(constant(threshold));
426  }
427 
428  template<typename NewType>
430  EIGEN_STRONG_INLINE const std::conditional_t<internal::is_same<NewType, CoeffReturnType>::value,
431  Derived,
432  TensorConversionOp<NewType, const Derived> >
433  cast() const {
434  return choose(Cond<internal::is_same<NewType, CoeffReturnType>::value>(), derived(), TensorConversionOp<NewType, const Derived>(derived()));
435  }
436 
438  EIGEN_STRONG_INLINE const TensorCwiseUnaryOp<internal::scalar_round_op<Scalar>, const Derived>
439  round() const {
440  return unaryExpr(internal::scalar_round_op<Scalar>());
441  }
442 
444  EIGEN_STRONG_INLINE const TensorCwiseUnaryOp<internal::scalar_rint_op<Scalar>, const Derived>
445  rint() const {
446  return unaryExpr(internal::scalar_rint_op<Scalar>());
447  }
448 
450  EIGEN_STRONG_INLINE const TensorCwiseUnaryOp<internal::scalar_ceil_op<Scalar>, const Derived>
451  ceil() const {
452  return unaryExpr(internal::scalar_ceil_op<Scalar>());
453  }
454 
456  EIGEN_STRONG_INLINE const TensorCwiseUnaryOp<internal::scalar_floor_op<Scalar>, const Derived>
457  floor() const {
458  return unaryExpr(internal::scalar_floor_op<Scalar>());
459  }
460 
461  // Generic binary operation support.
462  template <typename CustomBinaryOp, typename OtherDerived> EIGEN_DEVICE_FUNC
463  EIGEN_STRONG_INLINE const TensorCwiseBinaryOp<CustomBinaryOp, const Derived, const OtherDerived>
464  binaryExpr(const OtherDerived& other, const CustomBinaryOp& func) const {
465  return TensorCwiseBinaryOp<CustomBinaryOp, const Derived, const OtherDerived>(derived(), other, func);
466  }
467 
468  // Coefficient-wise binary operators.
469  template<typename OtherDerived> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
470  const TensorCwiseBinaryOp<internal::scalar_sum_op<Scalar>, const Derived, const OtherDerived>
471  operator+(const OtherDerived& other) const {
472  return binaryExpr(other.derived(), internal::scalar_sum_op<Scalar>());
473  }
474 
475  template<typename OtherDerived> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
476  const TensorCwiseBinaryOp<internal::scalar_difference_op<Scalar>, const Derived, const OtherDerived>
477  operator-(const OtherDerived& other) const {
478  return binaryExpr(other.derived(), internal::scalar_difference_op<Scalar>());
479  }
480 
481  template<typename OtherDerived> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
482  const TensorCwiseBinaryOp<internal::scalar_product_op<Scalar>, const Derived, const OtherDerived>
483  operator*(const OtherDerived& other) const {
484  return binaryExpr(other.derived(), internal::scalar_product_op<Scalar>());
485  }
486 
487  template<typename OtherDerived> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
488  const TensorCwiseBinaryOp<internal::scalar_quotient_op<Scalar>, const Derived, const OtherDerived>
489  operator/(const OtherDerived& other) const {
490  return binaryExpr(other.derived(), internal::scalar_quotient_op<Scalar>());
491  }
492 
493  template<int NaNPropagation=PropagateFast, typename OtherDerived> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
494  const TensorCwiseBinaryOp<internal::scalar_max_op<Scalar,Scalar, NaNPropagation>, const Derived, const OtherDerived>
495  cwiseMax(const OtherDerived& other) const {
496  return binaryExpr(other.derived(), internal::scalar_max_op<Scalar,Scalar, NaNPropagation>());
497  }
498 
499  template<int NaNPropagation=PropagateFast, typename OtherDerived> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
500  const TensorCwiseBinaryOp<internal::scalar_min_op<Scalar,Scalar, NaNPropagation>, const Derived, const OtherDerived>
501  cwiseMin(const OtherDerived& other) const {
502  return binaryExpr(other.derived(), internal::scalar_min_op<Scalar,Scalar, NaNPropagation>());
503  }
504 
505  // logical operators
506  template<typename OtherDerived> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
507  const TensorCwiseBinaryOp<internal::scalar_boolean_and_op<Scalar>, const Derived, const OtherDerived>
508  operator&&(const OtherDerived& other) const {
509  return binaryExpr(other.derived(), internal::scalar_boolean_and_op<Scalar>());
510  }
511 
512  template<typename OtherDerived> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
513  const TensorCwiseBinaryOp<internal::scalar_boolean_or_op<Scalar>, const Derived, const OtherDerived>
514  operator||(const OtherDerived& other) const {
515  return binaryExpr(other.derived(), internal::scalar_boolean_or_op<Scalar>());
516  }
517 
518  template<typename OtherDerived> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
519  const TensorCwiseBinaryOp<internal::scalar_bitwise_and_op<Scalar>, const Derived, const OtherDerived>
520  operator&(const OtherDerived& other) const {
521  return binaryExpr(other.derived(), internal::scalar_bitwise_and_op<Scalar>());
522  }
523 
524  template<typename OtherDerived> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
525  const TensorCwiseBinaryOp<internal::scalar_bitwise_or_op<Scalar>, const Derived, const OtherDerived>
526  operator|(const OtherDerived& other) const {
527  return binaryExpr(other.derived(), internal::scalar_bitwise_or_op<Scalar>());
528  }
529 
530  template<typename OtherDerived> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
531  const TensorCwiseBinaryOp<internal::scalar_bitwise_xor_op<Scalar>, const Derived, const OtherDerived>
532  operator^(const OtherDerived& other) const {
533  return binaryExpr(other.derived(), internal::scalar_bitwise_xor_op<Scalar>());
534  }
535 
536  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
537  const TensorCwiseUnaryOp<internal::scalar_boolean_not_op<Scalar>, const Derived>
538  operator!() const {
539  return unaryExpr(internal::scalar_boolean_not_op<Scalar>());
540  }
541 
542  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
543  const TensorCwiseUnaryOp<internal::scalar_bitwise_not_op<Scalar>, const Derived>
544  operator~() const {
545  return unaryExpr(internal::scalar_bitwise_not_op<Scalar>());
546  }
547 
548  // Comparisons and tests.
549  template<typename OtherDerived> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
550  const TensorCwiseBinaryOp<internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_LT>, const Derived, const OtherDerived>
551  operator<(const TensorBase<OtherDerived, ReadOnlyAccessors>& other) const {
552  return binaryExpr(other.derived(), internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_LT>());
553  }
554  template<typename OtherDerived> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
555  const TensorCwiseBinaryOp<internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_LE>, const Derived, const OtherDerived>
556  operator<=(const TensorBase<OtherDerived, ReadOnlyAccessors>& other) const {
557  return binaryExpr(other.derived(), internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_LE>());
558  }
559  template<typename OtherDerived> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
560  const TensorCwiseBinaryOp<internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_GT>, const Derived, const OtherDerived>
561  operator>(const TensorBase<OtherDerived, ReadOnlyAccessors>& other) const {
562  return binaryExpr(other.derived(), internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_GT>());
563  }
564  template<typename OtherDerived> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
565  const TensorCwiseBinaryOp<internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_GE>, const Derived, const OtherDerived>
566  operator>=(const TensorBase<OtherDerived, ReadOnlyAccessors>& other) const {
567  return binaryExpr(other.derived(), internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_GE>());
568  }
569 
570  template<typename OtherDerived> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
571  const TensorCwiseBinaryOp<internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_EQ>, const Derived, const OtherDerived>
572  operator==(const TensorBase<OtherDerived, ReadOnlyAccessors>& other) const {
573  return binaryExpr(other.derived(), internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_EQ>());
574  }
575 
576  template<typename OtherDerived> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
577  const TensorCwiseBinaryOp<internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_NEQ>, const Derived, const OtherDerived>
578  operator!=(const TensorBase<OtherDerived, ReadOnlyAccessors>& other) const {
579  return binaryExpr(other.derived(), internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_NEQ>());
580  }
581 
582  // comparisons and tests for Scalars
584  EIGEN_STRONG_INLINE const TensorCwiseBinaryOp<internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_LT>, const Derived, const TensorCwiseNullaryOp<internal::scalar_constant_op<Scalar>, const Derived> >
585  operator<(Scalar threshold) const {
586  return operator<(constant(threshold));
587  }
589  EIGEN_STRONG_INLINE const TensorCwiseBinaryOp<internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_LE>, const Derived, const TensorCwiseNullaryOp<internal::scalar_constant_op<Scalar>, const Derived> >
590  operator<=(Scalar threshold) const {
591  return operator<=(constant(threshold));
592  }
594  EIGEN_STRONG_INLINE const TensorCwiseBinaryOp<internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_GT>, const Derived, const TensorCwiseNullaryOp<internal::scalar_constant_op<Scalar>, const Derived> >
595  operator>(Scalar threshold) const {
596  return operator>(constant(threshold));
597  }
599  EIGEN_STRONG_INLINE const TensorCwiseBinaryOp<internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_GE>, const Derived, const TensorCwiseNullaryOp<internal::scalar_constant_op<Scalar>, const Derived> >
600  operator>=(Scalar threshold) const {
601  return operator>=(constant(threshold));
602  }
604  EIGEN_STRONG_INLINE const TensorCwiseBinaryOp<internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_EQ>, const Derived, const TensorCwiseNullaryOp<internal::scalar_constant_op<Scalar>, const Derived> >
605  operator==(Scalar threshold) const {
606  return operator==(constant(threshold));
607  }
609  EIGEN_STRONG_INLINE const TensorCwiseBinaryOp<internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_NEQ>, const Derived, const TensorCwiseNullaryOp<internal::scalar_constant_op<Scalar>, const Derived> >
610  operator!=(Scalar threshold) const {
611  return operator!=(constant(threshold));
612  }
613 
614  // Predicates.
616  EIGEN_STRONG_INLINE const TensorConversionOp<bool, const TensorCwiseUnaryOp<internal::scalar_isnan_op<Scalar, true>, const Derived>>
617  (isnan)() const {
618  return unaryExpr(internal::scalar_isnan_op<Scalar, true>()).template cast<bool>();
619  }
620 
622  EIGEN_STRONG_INLINE const TensorCwiseUnaryOp<internal::scalar_isinf_op<Scalar>, const Derived>
623  (isinf)() const {
624  return unaryExpr(internal::scalar_isinf_op<Scalar>());
625  }
627  EIGEN_STRONG_INLINE const TensorCwiseUnaryOp<internal::scalar_isfinite_op<Scalar>, const Derived>
628  (isfinite)() const {
629  return unaryExpr(internal::scalar_isfinite_op<Scalar>());
630  }
631 
632  // Coefficient-wise ternary operators.
633  template<typename ThenDerived, typename ElseDerived> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
634  const TensorSelectOp<const Derived, const ThenDerived, const ElseDerived>
635  select(const ThenDerived& thenTensor, const ElseDerived& elseTensor) const {
636  return TensorSelectOp<const Derived, const ThenDerived, const ElseDerived>(derived(), thenTensor.derived(), elseTensor.derived());
637  }
638 
639  // Contractions.
640  typedef Eigen::IndexPair<Index> DimensionPair;
641 
642  template<typename OtherDerived, typename Dimensions> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
643  const TensorContractionOp<const Dimensions, const Derived, const OtherDerived, const NoOpOutputKernel>
644  contract(const OtherDerived& other, const Dimensions& dims) const {
645  return TensorContractionOp<const Dimensions, const Derived, const OtherDerived, const NoOpOutputKernel>(derived(), other.derived(), dims);
646  }
647 
648  template<typename OtherDerived, typename Dimensions, typename OutputKernel> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
649  const TensorContractionOp<const Dimensions, const Derived, const OtherDerived, const OutputKernel>
650  contract(const OtherDerived& other, const Dimensions& dims, const OutputKernel& output_kernel) const {
651  return TensorContractionOp<const Dimensions, const Derived, const OtherDerived, const OutputKernel>(derived(), other.derived(), dims, output_kernel);
652  }
653 
654  // Convolutions.
655  template<typename KernelDerived, typename Dimensions> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
656  const TensorConvolutionOp<const Dimensions, const Derived, const KernelDerived>
657  convolve(const KernelDerived& kernel, const Dimensions& dims) const {
658  return TensorConvolutionOp<const Dimensions, const Derived, const KernelDerived>(derived(), kernel.derived(), dims);
659  }
660 
661  // Fourier transforms
662  template <int FFTDataType, int FFTDirection, typename FFT> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
663  const TensorFFTOp<const FFT, const Derived, FFTDataType, FFTDirection>
664  fft(const FFT& dims) const {
665  return TensorFFTOp<const FFT, const Derived, FFTDataType, FFTDirection>(derived(), dims);
666  }
667 
668  // Scan.
669  typedef TensorScanOp<internal::SumReducer<CoeffReturnType>, const Derived> TensorScanSumOp;
670  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
671  const TensorScanSumOp
672  cumsum(const Index& axis, bool exclusive = false) const {
673  return TensorScanSumOp(derived(), axis, exclusive);
674  }
675 
676  typedef TensorScanOp<internal::ProdReducer<CoeffReturnType>, const Derived> TensorScanProdOp;
677  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
678  const TensorScanProdOp
679  cumprod(const Index& axis, bool exclusive = false) const {
680  return TensorScanProdOp(derived(), axis, exclusive);
681  }
682 
683  template <typename Reducer>
684  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
685  const TensorScanOp<Reducer, const Derived>
686  scan(const Index& axis, const Reducer& reducer, bool exclusive = false) const {
687  return TensorScanOp<Reducer, const Derived>(derived(), axis, exclusive, reducer);
688  }
689 
690  // Reductions.
691  template <typename Dims> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
692  const TensorReductionOp<internal::SumReducer<CoeffReturnType>, const Dims, const Derived>
693  sum(const Dims& dims) const {
694  return TensorReductionOp<internal::SumReducer<CoeffReturnType>, const Dims, const Derived>(derived(), dims, internal::SumReducer<CoeffReturnType>());
695  }
696 
697  const TensorReductionOp<internal::SumReducer<CoeffReturnType>, const DimensionList<Index, NumDimensions>, const Derived>
698  sum() const {
699  DimensionList<Index, NumDimensions> in_dims;
700  return TensorReductionOp<internal::SumReducer<CoeffReturnType>, const DimensionList<Index, NumDimensions>, const Derived>(derived(), in_dims, internal::SumReducer<CoeffReturnType>());
701  }
702 
703  template <typename Dims> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
704  const TensorReductionOp<internal::MeanReducer<CoeffReturnType>, const Dims, const Derived>
705  mean(const Dims& dims) const {
706  return TensorReductionOp<internal::MeanReducer<CoeffReturnType>, const Dims, const Derived>(derived(), dims, internal::MeanReducer<CoeffReturnType>());
707  }
708 
709  const TensorReductionOp<internal::MeanReducer<CoeffReturnType>, const DimensionList<Index, NumDimensions>, const Derived>
710  mean() const {
711  DimensionList<Index, NumDimensions> in_dims;
712  return TensorReductionOp<internal::MeanReducer<CoeffReturnType>, const DimensionList<Index, NumDimensions>, const Derived>(derived(), in_dims, internal::MeanReducer<CoeffReturnType>());
713  }
714 
715  template <typename Dims> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
716  const TensorReductionOp<internal::ProdReducer<CoeffReturnType>, const Dims, const Derived>
717  prod(const Dims& dims) const {
718  return TensorReductionOp<internal::ProdReducer<CoeffReturnType>, const Dims, const Derived>(derived(), dims, internal::ProdReducer<CoeffReturnType>());
719  }
720 
721  const TensorReductionOp<internal::ProdReducer<CoeffReturnType>, const DimensionList<Index, NumDimensions>, const Derived>
722  prod() const {
723  DimensionList<Index, NumDimensions> in_dims;
724  return TensorReductionOp<internal::ProdReducer<CoeffReturnType>, const DimensionList<Index, NumDimensions>, const Derived>(derived(), in_dims, internal::ProdReducer<CoeffReturnType>());
725  }
726 
727  template <typename Dims,int NanPropagation=PropagateFast> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
728  const TensorReductionOp<internal::MaxReducer<CoeffReturnType,NanPropagation>, const Dims, const Derived>
729  maximum(const Dims& dims) const {
730  return TensorReductionOp<internal::MaxReducer<CoeffReturnType,NanPropagation>, const Dims, const Derived>(derived(), dims, internal::MaxReducer<CoeffReturnType,NanPropagation>());
731  }
732 
733  template <int NanPropagation=PropagateFast>
734  const TensorReductionOp<internal::MaxReducer<CoeffReturnType,NanPropagation>, const DimensionList<Index, NumDimensions>, const Derived>
735  maximum() const {
736  DimensionList<Index, NumDimensions> in_dims;
737  return TensorReductionOp<internal::MaxReducer<CoeffReturnType,NanPropagation>, const DimensionList<Index, NumDimensions>, const Derived>(derived(), in_dims, internal::MaxReducer<CoeffReturnType,NanPropagation>());
738  }
739 
740  template <typename Dims,int NanPropagation=PropagateFast> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
741  const TensorReductionOp<internal::MinReducer<CoeffReturnType,NanPropagation>, const Dims, const Derived>
742  minimum(const Dims& dims) const {
743  return TensorReductionOp<internal::MinReducer<CoeffReturnType,NanPropagation>, const Dims, const Derived>(derived(), dims, internal::MinReducer<CoeffReturnType,NanPropagation>());
744  }
745 
746  template <int NanPropagation=PropagateFast>
747  const TensorReductionOp<internal::MinReducer<CoeffReturnType,NanPropagation>, const DimensionList<Index, NumDimensions>, const Derived>
748  minimum() const {
749  DimensionList<Index, NumDimensions> in_dims;
750  return TensorReductionOp<internal::MinReducer<CoeffReturnType,NanPropagation>, const DimensionList<Index, NumDimensions>, const Derived>(derived(), in_dims, internal::MinReducer<CoeffReturnType,NanPropagation>());
751  }
752 
753  template <typename Dims> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
754  const TensorReductionOp<internal::AndReducer, const Dims, const std::conditional_t<internal::is_same<bool, CoeffReturnType>::value, Derived, TensorConversionOp<bool, const Derived> > >
755  all(const Dims& dims) const {
756  return cast<bool>().reduce(dims, internal::AndReducer());
757  }
758 
759  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
760  const TensorReductionOp<internal::AndReducer, const DimensionList<Index, NumDimensions>, const std::conditional_t<internal::is_same<bool, CoeffReturnType>::value, Derived, TensorConversionOp<bool, const Derived> > >
761  all() const {
762  DimensionList<Index, NumDimensions> in_dims;
763  return cast<bool>().reduce(in_dims, internal::AndReducer());
764  }
765 
766  template <typename Dims> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
767  const TensorReductionOp<internal::OrReducer, const Dims, const std::conditional_t<internal::is_same<bool, CoeffReturnType>::value, Derived, TensorConversionOp<bool, const Derived> > >
768  any(const Dims& dims) const {
769  return cast<bool>().reduce(dims, internal::OrReducer());
770  }
771 
772  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
773  const TensorReductionOp<internal::OrReducer, const DimensionList<Index, NumDimensions>, const std::conditional_t<internal::is_same<bool, CoeffReturnType>::value, Derived, TensorConversionOp<bool, const Derived> > >
774  any() const {
775  DimensionList<Index, NumDimensions> in_dims;
776  return cast<bool>().reduce(in_dims, internal::OrReducer());
777  }
778 
779  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
780  const TensorPairReducerOp<
781  internal::ArgMaxPairReducer<Pair<Index, CoeffReturnType> >,
782  const array<Index, NumDimensions>, const Derived>
783  argmax() const {
785  for (Index d = 0; d < NumDimensions; ++d) in_dims[d] = d;
786  return TensorPairReducerOp<
787  internal::ArgMaxPairReducer<Pair<Index, CoeffReturnType> >,
789  const Derived>(derived(), internal::ArgMaxPairReducer<Pair<Index, CoeffReturnType> >(), -1, in_dims);
790  }
791 
792  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
793  const TensorPairReducerOp<
794  internal::ArgMinPairReducer<Pair<Index, CoeffReturnType> >,
795  const array<Index, NumDimensions>, const Derived>
796  argmin() const {
798  for (Index d = 0; d < NumDimensions; ++d) in_dims[d] = d;
799  return TensorPairReducerOp<
800  internal::ArgMinPairReducer<Pair<Index, CoeffReturnType> >,
802  const Derived>(derived(), internal::ArgMinPairReducer<Pair<Index, CoeffReturnType> >(), -1, in_dims);
803  }
804 
805  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
806  const TensorPairReducerOp<
807  internal::ArgMaxPairReducer<Pair<Index, CoeffReturnType> >,
808  const array<Index, 1>, const Derived>
809  argmax(const Index return_dim) const {
810  array<Index, 1> in_dims;
811  in_dims[0] = return_dim;
812  return TensorPairReducerOp<
813  internal::ArgMaxPairReducer<Pair<Index, CoeffReturnType> >,
814  const array<Index, 1>,
815  const Derived>(derived(), internal::ArgMaxPairReducer<Pair<Index, CoeffReturnType> >(), return_dim, in_dims);
816  }
817 
818  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
819  const TensorPairReducerOp<
820  internal::ArgMinPairReducer<Pair<Index, CoeffReturnType> >,
821  const array<Index, 1>, const Derived>
822  argmin(const Index return_dim) const {
823  array<Index, 1> in_dims;
824  in_dims[0] = return_dim;
825  return TensorPairReducerOp<
826  internal::ArgMinPairReducer<Pair<Index, CoeffReturnType> >,
827  const array<Index, 1>,
828  const Derived>(derived(), internal::ArgMinPairReducer<Pair<Index, CoeffReturnType> >(), return_dim, in_dims);
829  }
830 
831  template <typename Reducer, typename Dims> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
832  const TensorReductionOp<Reducer, const Dims, const Derived>
833  reduce(const Dims& dims, const Reducer& reducer) const {
834  return TensorReductionOp<Reducer, const Dims, const Derived>(derived(), dims, reducer);
835  }
836 
837  template <typename Dims> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
838  const TensorTraceOp<const Dims, const Derived>
839  trace(const Dims& dims) const {
840  return TensorTraceOp<const Dims, const Derived>(derived(), dims);
841  }
842 
843  const TensorTraceOp<const DimensionList<Index, NumDimensions>, const Derived>
844  trace() const {
845  DimensionList<Index, NumDimensions> in_dims;
846  return TensorTraceOp<const DimensionList<Index, NumDimensions>, const Derived>(derived(), in_dims);
847  }
848 
849  template <typename Broadcast> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
850  const TensorBroadcastingOp<const Broadcast, const Derived>
851  broadcast(const Broadcast& bcast) const {
852  return TensorBroadcastingOp<const Broadcast, const Derived>(derived(), bcast);
853  }
854 
855  template <typename Axis, typename OtherDerived> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
856  const TensorConcatenationOp<Axis, const Derived, const OtherDerived>
857  concatenate(const OtherDerived& other, Axis axis) const {
858  return TensorConcatenationOp<Axis, const Derived, const OtherDerived>(derived(), other.derived(), axis);
859  }
860 
861  template <typename PatchDims> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
862  const TensorPatchOp<const PatchDims, const Derived>
863  extract_patches(const PatchDims& patch_dims) const {
864  return TensorPatchOp<const PatchDims, const Derived>(derived(), patch_dims);
865  }
866 
867  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
868  const TensorImagePatchOp<Dynamic, Dynamic, const Derived>
869  extract_image_patches(const Index patch_rows = 1, const Index patch_cols = 1,
870  const Index row_stride = 1, const Index col_stride = 1,
871  const Index in_row_stride = 1, const Index in_col_stride = 1,
872  const PaddingType padding_type = PADDING_SAME, const Scalar padding_value = Scalar(0)) const {
873  return TensorImagePatchOp<Dynamic, Dynamic, const Derived>(derived(), patch_rows, patch_cols, row_stride, col_stride,
874  in_row_stride, in_col_stride, 1, 1, padding_type, padding_value);
875  }
876 
877  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
878  const TensorImagePatchOp<Dynamic, Dynamic, const Derived>
879  extract_image_patches(const Index patch_rows, const Index patch_cols,
880  const Index row_stride, const Index col_stride,
881  const Index in_row_stride, const Index in_col_stride,
882  const Index row_inflate_stride, const Index col_inflate_stride,
883  const Index padding_top, const Index padding_bottom,
884  const Index padding_left,const Index padding_right,
885  const Scalar padding_value) const {
886  return TensorImagePatchOp<Dynamic, Dynamic, const Derived>(derived(), patch_rows, patch_cols, row_stride, col_stride,
887  in_row_stride, in_col_stride, row_inflate_stride, col_inflate_stride,
888  padding_top, padding_bottom, padding_left, padding_right, padding_value);
889  }
890 
891  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
892  const TensorVolumePatchOp<Dynamic, Dynamic, Dynamic, const Derived>
893  extract_volume_patches(const Index patch_planes, const Index patch_rows, const Index patch_cols,
894  const Index plane_stride = 1, const Index row_stride = 1, const Index col_stride = 1,
895  const PaddingType padding_type = PADDING_SAME, const Scalar padding_value = Scalar(0)) const {
896  return TensorVolumePatchOp<Dynamic, Dynamic, Dynamic, const Derived>(derived(), patch_planes, patch_rows, patch_cols, plane_stride, row_stride, col_stride, 1, 1, 1, 1, 1, 1, padding_type, padding_value);
897  }
898 
899 
900  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
901  const TensorVolumePatchOp<Dynamic, Dynamic, Dynamic, const Derived>
902  extract_volume_patches(const Index patch_planes, const Index patch_rows, const Index patch_cols,
903  const Index plane_stride, const Index row_stride, const Index col_stride,
904  const Index plane_inflate_stride, const Index row_inflate_stride, const Index col_inflate_stride,
905  const Index padding_top_z, const Index padding_bottom_z,
906  const Index padding_top, const Index padding_bottom,
907  const Index padding_left, const Index padding_right, const Scalar padding_value = Scalar(0)) const {
908  return TensorVolumePatchOp<Dynamic, Dynamic, Dynamic, const Derived>(derived(), patch_planes, patch_rows, patch_cols, plane_stride, row_stride, col_stride, 1, 1, 1, plane_inflate_stride, row_inflate_stride, col_inflate_stride, padding_top_z, padding_bottom_z, padding_top, padding_bottom, padding_left, padding_right, padding_value);
909  }
910 
911  // Morphing operators.
912  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
913  const TensorLayoutSwapOp<const Derived>
914  swap_layout() const {
915  return TensorLayoutSwapOp<const Derived>(derived());
916  }
917  template <typename NewDimensions> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
918  const TensorReshapingOp<const NewDimensions, const Derived>
919  reshape(const NewDimensions& newDimensions) const {
920  return TensorReshapingOp<const NewDimensions, const Derived>(derived(), newDimensions);
921  }
922  template <typename StartIndices, typename Sizes> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
923  const TensorSlicingOp<const StartIndices, const Sizes, const Derived>
924  slice(const StartIndices& startIndices, const Sizes& sizes) const {
925  return TensorSlicingOp<const StartIndices, const Sizes, const Derived>(derived(), startIndices, sizes);
926  }
927  template <typename StartIndices, typename StopIndices, typename Strides> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
928  const TensorStridingSlicingOp<const StartIndices, const StopIndices, const Strides, const Derived>
929  stridedSlice(const StartIndices& startIndices, const StopIndices& stopIndices, const Strides& strides) const {
930  return TensorStridingSlicingOp<const StartIndices, const StopIndices, const Strides,
931  const Derived>(derived(), startIndices, stopIndices, strides);
932  }
933  template <Index DimId> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
934  const TensorChippingOp<DimId, const Derived>
935  chip(const Index offset) const {
936  return TensorChippingOp<DimId, const Derived>(derived(), offset, DimId);
937  }
938  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
939  const TensorChippingOp<Dynamic, const Derived>
940  chip(const Index offset, const Index dim) const {
941  return TensorChippingOp<Dynamic, const Derived>(derived(), offset, dim);
942  }
943  template <typename ReverseDimensions> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
944  const TensorReverseOp<const ReverseDimensions, const Derived>
945  reverse(const ReverseDimensions& rev) const {
946  return TensorReverseOp<const ReverseDimensions, const Derived>(derived(), rev);
947  }
948  template <typename PaddingDimensions> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
949  const TensorPaddingOp<const PaddingDimensions, const Derived>
950  pad(const PaddingDimensions& padding) const {
951  return TensorPaddingOp<const PaddingDimensions, const Derived>(derived(), padding, internal::scalar_cast_op<int, Scalar>()(0));
952  }
953  template <typename PaddingDimensions> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
954  const TensorPaddingOp<const PaddingDimensions, const Derived>
955  pad(const PaddingDimensions& padding, const Scalar padding_value) const {
956  return TensorPaddingOp<const PaddingDimensions, const Derived>(derived(), padding, padding_value);
957  }
958  template <typename Shuffle> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
959  const TensorShufflingOp<const Shuffle, const Derived>
960  shuffle(const Shuffle& shfl) const {
961  return TensorShufflingOp<const Shuffle, const Derived>(derived(), shfl);
962  }
963  template <typename Strides> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
964  const TensorStridingOp<const Strides, const Derived>
965  stride(const Strides& strides) const {
966  return TensorStridingOp<const Strides, const Derived>(derived(), strides);
967  }
968  template <typename Strides> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
969  const TensorInflationOp<const Strides, const Derived>
970  inflate(const Strides& strides) const {
971  return TensorInflationOp<const Strides, const Derived>(derived(), strides);
972  }
973 
974  // Returns a tensor containing index/value pairs
975  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
976  const TensorIndexPairOp<const Derived>
977  index_pairs() const {
978  return TensorIndexPairOp<const Derived>(derived());
979  }
980 
981  // Support for custom unary and binary operations
982  template <typename CustomUnaryFunc>
983  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
984  const TensorCustomUnaryOp<const CustomUnaryFunc, const Derived> customOp(const CustomUnaryFunc& op) const {
985  return TensorCustomUnaryOp<const CustomUnaryFunc, const Derived>(derived(), op);
986  }
987  template <typename OtherDerived, typename CustomBinaryFunc>
988  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
989  const TensorCustomBinaryOp<const CustomBinaryFunc, const Derived, const OtherDerived> customOp(const OtherDerived& other, const CustomBinaryFunc& op) const {
990  return TensorCustomBinaryOp<const CustomBinaryFunc, const Derived, const OtherDerived>(derived(), other, op);
991  }
992 
993  // Force the evaluation of the expression.
994  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
995  const TensorForcedEvalOp<const Derived> eval() const {
996  return TensorForcedEvalOp<const Derived>(derived());
997  }
998 
999  // Returns a formatted tensor ready for printing to a stream
1000  inline const TensorWithFormat<Derived,DerivedTraits::Layout,DerivedTraits::NumDimensions> format(const TensorIOFormat& fmt) const {
1001  return TensorWithFormat<Derived,DerivedTraits::Layout,DerivedTraits::NumDimensions>(derived(), fmt);
1002  }
1003 
1004  #ifdef EIGEN_READONLY_TENSORBASE_PLUGIN
1005  #include EIGEN_READONLY_TENSORBASE_PLUGIN
1006  #endif
1007 
1008  protected:
1009  template <typename Scalar, int NumIndices, int Options, typename IndexType> friend class Tensor;
1010  template <typename Scalar, typename Dimensions, int Option, typename IndexTypes> friend class TensorFixedSize;
1011  // the Eigen:: prefix is required to workaround a compilation issue with nvcc 9.0
1012  template <typename OtherDerived, int AccessLevel> friend class Eigen::TensorBase;
1014  EIGEN_STRONG_INLINE const Derived& derived() const { return *static_cast<const Derived*>(this); }
1015 };
1016 
1017 template<typename Derived, int AccessLevel = internal::accessors_level<Derived>::value>
1018 class TensorBase : public TensorBase<Derived, ReadOnlyAccessors> {
1019  public:
1020  typedef TensorBase<Derived, ReadOnlyAccessors> Base;
1021  typedef internal::traits<Derived> DerivedTraits;
1022  typedef typename DerivedTraits::Scalar Scalar;
1023  typedef typename DerivedTraits::Index Index;
1024  typedef Scalar CoeffReturnType;
1025  static constexpr int NumDimensions = DerivedTraits::NumDimensions;
1026 
1027  template <typename Scalar, int NumIndices, int Options, typename IndexType> friend class Tensor;
1028  template <typename Scalar, typename Dimensions, int Option, typename IndexTypes> friend class TensorFixedSize;
1029  // the Eigen:: prefix is required to workaround a compilation issue with nvcc 9.0
1030  template <typename OtherDerived, int OtherAccessLevel> friend class Eigen::TensorBase;
1031 
1033  EIGEN_STRONG_INLINE Derived& setZero() {
1034  return setConstant(Scalar(0));
1035  }
1037  EIGEN_STRONG_INLINE Derived& setConstant(const Scalar& val) {
1038  return derived() = this->constant(val);
1039  }
1041  EIGEN_STRONG_INLINE Derived& setRandom() {
1042  return derived() = this->random();
1043  }
1044  template <typename RandomGenerator> EIGEN_DEVICE_FUNC
1045  EIGEN_STRONG_INLINE Derived& setRandom() {
1046  return derived() = this->template random<RandomGenerator>();
1047  }
1048 
1050  EIGEN_STRONG_INLINE Derived& setValues(
1051  const typename internal::Initializer<Derived, NumDimensions>::InitList& vals) {
1052  TensorEvaluator<Derived, DefaultDevice> eval(derived(), DefaultDevice());
1053  internal::initialize_tensor<Derived, NumDimensions>(eval, vals);
1054  return derived();
1055  }
1056 
1057  template<typename OtherDerived> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1058  Derived& operator+=(const OtherDerived& other) {
1059  return derived() = derived() + other.derived();
1060  }
1061  template<typename OtherDerived> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1062  Derived& operator-=(const OtherDerived& other) {
1063  return derived() = derived() - other.derived();
1064  }
1065  template<typename OtherDerived> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1066  Derived& operator*=(const OtherDerived& other) {
1067  return derived() = derived() * other.derived();
1068  }
1069  template<typename OtherDerived> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1070  Derived& operator/=(const OtherDerived& other) {
1071  return derived() = derived() / other.derived();
1072  }
1073 
1074  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1075  const TensorLayoutSwapOp<const Derived>
1076  swap_layout() const {
1077  return TensorLayoutSwapOp<const Derived>(derived());
1078  }
1079  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1080  TensorLayoutSwapOp<Derived>
1081  swap_layout() {
1082  return TensorLayoutSwapOp<Derived>(derived());
1083  }
1084 
1085  template <typename Axis, typename OtherDerived> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1086  const TensorConcatenationOp<const Axis, const Derived, const OtherDerived>
1087  concatenate(const OtherDerived& other, const Axis& axis) const {
1088  return TensorConcatenationOp<const Axis, const Derived, const OtherDerived>(derived(), other, axis);
1089  }
1090  template <typename Axis, typename OtherDerived> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1091  TensorConcatenationOp<const Axis, Derived, OtherDerived>
1092  concatenate(const OtherDerived& other, const Axis& axis) {
1093  return TensorConcatenationOp<const Axis, Derived, OtherDerived>(derived(), other, axis);
1094  }
1095 
1096  template <typename NewDimensions> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1097  const TensorReshapingOp<const NewDimensions, const Derived>
1098  reshape(const NewDimensions& newDimensions) const {
1099  return TensorReshapingOp<const NewDimensions, const Derived>(derived(), newDimensions);
1100  }
1101  template <typename NewDimensions> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1102  TensorReshapingOp<const NewDimensions, Derived>
1103  reshape(const NewDimensions& newDimensions) {
1104  return TensorReshapingOp<const NewDimensions, Derived>(derived(), newDimensions);
1105  }
1106 
1107  template <typename StartIndices, typename Sizes> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1108  const TensorSlicingOp<const StartIndices, const Sizes, const Derived>
1109  slice(const StartIndices& startIndices, const Sizes& sizes) const {
1110  return TensorSlicingOp<const StartIndices, const Sizes, const Derived>(derived(), startIndices, sizes);
1111  }
1112  template <typename StartIndices, typename Sizes> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1113  TensorSlicingOp<const StartIndices, const Sizes, Derived>
1114  slice(const StartIndices& startIndices, const Sizes& sizes) {
1115  return TensorSlicingOp<const StartIndices, const Sizes, Derived>(derived(), startIndices, sizes);
1116  }
1117 
1118  template <typename StartIndices, typename StopIndices, typename Strides> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1119  const TensorStridingSlicingOp<const StartIndices, const StopIndices, const Strides, const Derived>
1120  stridedSlice(const StartIndices& startIndices, const StopIndices& stopIndices, const Strides& strides) const {
1121  return TensorStridingSlicingOp<const StartIndices, const StopIndices, const Strides,
1122  const Derived>(derived(), startIndices, stopIndices, strides);
1123  }
1124  template <typename StartIndices, typename StopIndices, typename Strides> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1125  TensorStridingSlicingOp<const StartIndices, const StopIndices, const Strides, Derived>
1126  stridedSlice(const StartIndices& startIndices, const StopIndices& stopIndices, const Strides& strides) {
1127  return TensorStridingSlicingOp<const StartIndices, const StopIndices, const Strides,
1128  Derived>(derived(), startIndices, stopIndices, strides);
1129  }
1130 
1131  template <DenseIndex DimId> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1132  const TensorChippingOp<DimId, const Derived>
1133  chip(const Index offset) const {
1134  return TensorChippingOp<DimId, const Derived>(derived(), offset, DimId);
1135  }
1136  template <Index DimId> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1137  TensorChippingOp<DimId, Derived>
1138  chip(const Index offset) {
1139  return TensorChippingOp<DimId, Derived>(derived(), offset, DimId);
1140  }
1141 
1142  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1143  const TensorChippingOp<Dynamic, const Derived>
1144  chip(const Index offset, const Index dim) const {
1145  return TensorChippingOp<Dynamic, const Derived>(derived(), offset, dim);
1146  }
1147  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1148  TensorChippingOp<Dynamic, Derived>
1149  chip(const Index offset, const Index dim) {
1150  return TensorChippingOp<Dynamic, Derived>(derived(), offset, dim);
1151  }
1152 
1153  template <typename ReverseDimensions> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1154  const TensorReverseOp<const ReverseDimensions, const Derived>
1155  reverse(const ReverseDimensions& rev) const {
1156  return TensorReverseOp<const ReverseDimensions, const Derived>(derived(), rev);
1157  }
1158  template <typename ReverseDimensions> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1159  TensorReverseOp<const ReverseDimensions, Derived>
1160  reverse(const ReverseDimensions& rev) {
1161  return TensorReverseOp<const ReverseDimensions, Derived>(derived(), rev);
1162  }
1163 
1164  template <typename Shuffle> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1165  const TensorShufflingOp<const Shuffle, const Derived>
1166  shuffle(const Shuffle& shfl) const {
1167  return TensorShufflingOp<const Shuffle, const Derived>(derived(), shfl);
1168  }
1169  template <typename Shuffle> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1170  TensorShufflingOp<const Shuffle, Derived>
1171  shuffle(const Shuffle& shfl) {
1172  return TensorShufflingOp<const Shuffle, Derived>(derived(), shfl);
1173  }
1174 
1175  template <typename Strides> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1176  const TensorStridingOp<const Strides, const Derived>
1177  stride(const Strides& strides) const {
1178  return TensorStridingOp<const Strides, const Derived>(derived(), strides);
1179  }
1180  template <typename Strides> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1181  TensorStridingOp<const Strides, Derived>
1182  stride(const Strides& strides) {
1183  return TensorStridingOp<const Strides, Derived>(derived(), strides);
1184  }
1185 
1186  // Select the device on which to evaluate the expression.
1187  template <typename DeviceType>
1188  TensorDevice<Derived, DeviceType> device(const DeviceType& dev) {
1189  return TensorDevice<Derived, DeviceType>(dev, derived());
1190  }
1191 
1192  // Select the async device on which to evaluate the expression.
1193  template <typename DeviceType, typename DoneCallback>
1194  TensorAsyncDevice<Derived, DeviceType, DoneCallback> device(const DeviceType& dev, DoneCallback done) {
1195  return TensorAsyncDevice<Derived, DeviceType, DoneCallback>(dev, derived(), std::move(done));
1196  }
1197 
1198  #ifdef EIGEN_TENSORBASE_PLUGIN
1199  #include EIGEN_TENSORBASE_PLUGIN
1200  #endif
1201 
1202  protected:
1204  EIGEN_DEFAULT_COPY_CONSTRUCTOR(TensorBase)
1205 
1206  template<typename OtherDerived> EIGEN_DEVICE_FUNC
1207  EIGEN_STRONG_INLINE Derived& operator=(const OtherDerived& other)
1208  {
1209  typedef TensorAssignOp<Derived, const OtherDerived> Assign;
1210  Assign assign(derived(), other.derived());
1211  internal::TensorExecutor<const Assign, DefaultDevice>::run(assign, DefaultDevice());
1212  return derived();
1213  }
1215  EIGEN_STRONG_INLINE Derived& derived() { return *static_cast<Derived*>(this); }
1217  EIGEN_STRONG_INLINE const Derived& derived() const { return *static_cast<const Derived*>(this); }
1218 };
1219 #endif // EIGEN_PARSED_BY_DOXYGEN
1220 } // end namespace Eigen
1221 
1222 #endif // EIGEN_CXX11_TENSOR_TENSOR_BASE_H
const BooleanNotReturnType operator!() const
const BitwiseNotReturnType operator~() const
const CwiseBinaryOp< internal::scalar_boolean_or_op< Scalar >, const Derived, const OtherDerived > operator||(const EIGEN_CURRENT_STORAGE_BASE_CLASS< OtherDerived > &other) const
const CwiseBinaryOp< internal::scalar_boolean_and_op< Scalar >, const Derived, const OtherDerived > operator&&(const EIGEN_CURRENT_STORAGE_BASE_CLASS< OtherDerived > &other) const
const CwiseBinaryOp< internal::scalar_bitwise_xor_op< Scalar >, const Derived, const OtherDerived > operator^(const EIGEN_CURRENT_STORAGE_BASE_CLASS< OtherDerived > &other) const
const CwiseBinaryOp< CustomBinaryOp, const Derived, const OtherDerived > binaryExpr(const EIGEN_CURRENT_STORAGE_BASE_CLASS< OtherDerived > &other, const CustomBinaryOp &func=CustomBinaryOp()) const
const CwiseBinaryOp< internal::scalar_bitwise_or_op< Scalar >, const Derived, const OtherDerived > operator|(const EIGEN_CURRENT_STORAGE_BASE_CLASS< OtherDerived > &other) const
const CwiseBinaryOp< internal::scalar_bitwise_and_op< Scalar >, const Derived, const OtherDerived > operator&(const EIGEN_CURRENT_STORAGE_BASE_CLASS< OtherDerived > &other) const
CastXpr< NewType >::Type cast() const
const CwiseUnaryOp< CustomUnaryOp, const Derived > unaryExpr(const CustomUnaryOp &func=CustomUnaryOp()) const
ConjugateReturnType conjugate() const
A setRandom()
#define EIGEN_DEFAULT_COPY_CONSTRUCTOR(CLASS)
#define EIGEN_DEFAULT_EMPTY_CONSTRUCTOR_AND_DESTRUCTOR(Derived)
#define EIGEN_DEVICE_FUNC
const CwiseBinaryOp< internal::scalar_min_op< Scalar, Scalar, NaNPropagation >, const Derived, const OtherDerived > cwiseMin(const EIGEN_CURRENT_STORAGE_BASE_CLASS< OtherDerived > &other) const
const CwiseBinaryOp< internal::scalar_max_op< Scalar, Scalar, NaNPropagation >, const Derived, const OtherDerived > cwiseMax(const EIGEN_CURRENT_STORAGE_BASE_CLASS< OtherDerived > &other) const
v setConstant(3, 5)
v setZero(3)
#define EIGEN_STATIC_ASSERT(X, MSG)
The tensor base class.
static const Eigen::internal::all_t all
ReadOnlyAccessors
bfloat16 & operator/=(bfloat16 &a, const bfloat16 &b)
bfloat16 & operator*=(bfloat16 &a, const bfloat16 &b)
bool operator>(const bfloat16 &a, const bfloat16 &b)
bfloat16 & operator+=(bfloat16 &a, const bfloat16 &b)
bfloat16 & operator-=(bfloat16 &a, const bfloat16 &b)
bool operator<=(const bfloat16 &a, const bfloat16 &b)
T operator/(const T &numerator, const TensorIntDivisor< T, div_gt_one > &divisor)
Definition: TensorIntDiv.h:253
EIGEN_ALWAYS_INLINE bool operator<(const TensorUInt128< HL, LL > &lhs, const TensorUInt128< HR, LR > &rhs)
EIGEN_ALWAYS_INLINE DSizes< IndexType, NumDims > strides(const DSizes< IndexType, NumDims > &dimensions)
Definition: TensorBlock.h:28
EIGEN_ALWAYS_INLINE bool operator>=(const TensorUInt128< HL, LL > &lhs, const TensorUInt128< HR, LR > &rhs)
Definition: TensorUInt128.h:95
: TensorContractionSycl.h, provides various tensor contraction kernel for SYCL backend
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_tanh_op< typename Derived::Scalar >, const Derived > tanh(const Eigen::ArrayBase< Derived > &x)
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_rint_op< typename Derived::Scalar >, const Derived > rint(const Eigen::ArrayBase< Derived > &x)
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_imag_op< typename Derived::Scalar >, const Derived > imag(const Eigen::ArrayBase< Derived > &x)
EIGEN_CONSTEXPR bool operator==(const Pair< U, V > &x, const Pair< U, V > &y)
Definition: TensorMeta.h:240
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_erfc_op< typename Derived::Scalar >, const Derived > erfc(const Eigen::ArrayBase< Derived > &x)
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_isinf_op< typename Derived::Scalar >, const Derived > isinf(const Eigen::ArrayBase< Derived > &x)
std::array< T, N > array
const Eigen::CwiseBinaryOp< Eigen::internal::scalar_igammac_op< typename Derived::Scalar >, const Derived, const ExponentDerived > igammac(const Eigen::ArrayBase< Derived > &a, const Eigen::ArrayBase< ExponentDerived > &x)
const CwiseBinaryOp< internal::scalar_difference_op< typename DenseDerived::Scalar, typename SparseDerived::Scalar >, const DenseDerived, const SparseDerived > operator-(const MatrixBase< DenseDerived > &a, const SparseMatrixBase< SparseDerived > &b)
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_bessel_j1_op< typename Derived::Scalar >, const Derived > bessel_j1(const Eigen::ArrayBase< Derived > &x)
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_bessel_k0_op< typename Derived::Scalar >, const Derived > bessel_k0(const Eigen::ArrayBase< Derived > &x)
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_bessel_y1_op< typename Derived::Scalar >, const Derived > bessel_y1(const Eigen::ArrayBase< Derived > &x)
@ PADDING_SAME
Definition: TensorTraits.h:261
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_rsqrt_op< typename Derived::Scalar >, const Derived > rsqrt(const Eigen::ArrayBase< Derived > &x)
CleanedUpDerType< DerType >::type() min(const AutoDiffScalar< DerType > &x, const T &y)
CleanedUpDerType< DerType >::type() max(const AutoDiffScalar< DerType > &x, const T &y)
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_bessel_j0_op< typename Derived::Scalar >, const Derived > bessel_j0(const Eigen::ArrayBase< Derived > &x)
const Eigen::CwiseBinaryOp< Eigen::internal::scalar_igamma_op< typename Derived::Scalar >, const Derived, const ExponentDerived > igamma(const Eigen::ArrayBase< Derived > &a, const Eigen::ArrayBase< ExponentDerived > &x)
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_bessel_k1_op< typename Derived::Scalar >, const Derived > bessel_k1(const Eigen::ArrayBase< Derived > &x)
const Eigen::CwiseBinaryOp< Eigen::internal::scalar_polygamma_op< typename DerivedX::Scalar >, const DerivedN, const DerivedX > polygamma(const Eigen::ArrayBase< DerivedN > &n, const Eigen::ArrayBase< DerivedX > &x)
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_sign_op< typename Derived::Scalar >, const Derived > sign(const Eigen::ArrayBase< Derived > &x)
Eigen::AutoDiffScalar< EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(internal::remove_all_t< DerType >, typename internal::traits< internal::remove_all_t< DerType >>::Scalar, product) > pow(const Eigen::AutoDiffScalar< DerType > &x, const typename internal::traits< internal::remove_all_t< DerType >>::Scalar &y)
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_isnan_op< typename Derived::Scalar >, const Derived > isnan(const Eigen::ArrayBase< Derived > &x)
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_bessel_k0e_op< typename Derived::Scalar >, const Derived > bessel_k0e(const Eigen::ArrayBase< Derived > &x)
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_arg_op< typename Derived::Scalar >, const Derived > arg(const Eigen::ArrayBase< Derived > &x)
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_ceil_op< typename Derived::Scalar >, const Derived > ceil(const Eigen::ArrayBase< Derived > &x)
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_bessel_y0_op< typename Derived::Scalar >, const Derived > bessel_y0(const Eigen::ArrayBase< Derived > &x)
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_bessel_i0_op< typename Derived::Scalar >, const Derived > bessel_i0(const Eigen::ArrayBase< Derived > &x)
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_ndtri_op< typename Derived::Scalar >, const Derived > ndtri(const Eigen::ArrayBase< Derived > &x)
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_isfinite_op< typename Derived::Scalar >, const Derived > isfinite(const Eigen::ArrayBase< Derived > &x)
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_floor_op< typename Derived::Scalar >, const Derived > floor(const Eigen::ArrayBase< Derived > &x)
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_lgamma_op< typename Derived::Scalar >, const Derived > lgamma(const Eigen::ArrayBase< Derived > &x)
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_erf_op< typename Derived::Scalar >, const Derived > erf(const Eigen::ArrayBase< Derived > &x)
const CwiseBinaryOp< internal::scalar_sum_op< typename DenseDerived::Scalar, typename SparseDerived::Scalar >, const DenseDerived, const SparseDerived > operator+(const MatrixBase< DenseDerived > &a, const SparseMatrixBase< SparseDerived > &b)
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_log1p_op< typename Derived::Scalar >, const Derived > log1p(const Eigen::ArrayBase< Derived > &x)
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_real_op< typename Derived::Scalar >, const Derived > real(const Eigen::ArrayBase< Derived > &x)
const Eigen::CwiseBinaryOp< Eigen::internal::scalar_igamma_der_a_op< typename Derived::Scalar >, const Derived, const ExponentDerived > igamma_der_a(const Eigen::ArrayBase< Derived > &a, const Eigen::ArrayBase< ExponentDerived > &x)
const Product< Inverse< PermutationType >, SparseDerived, AliasFreeProduct > operator*(const InverseImpl< PermutationType, PermutationStorage > &tperm, const SparseMatrixBase< SparseDerived > &matrix)
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_log2_op< typename Derived::Scalar >, const Derived > log2(const Eigen::ArrayBase< Derived > &x)
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_round_op< typename Derived::Scalar >, const Derived > round(const Eigen::ArrayBase< Derived > &x)
const Eigen::CwiseBinaryOp< Eigen::internal::scalar_zeta_op< typename DerivedX::Scalar >, const DerivedX, const DerivedQ > zeta(const Eigen::ArrayBase< DerivedX > &x, const Eigen::ArrayBase< DerivedQ > &q)
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_cube_op< typename Derived::Scalar >, const Derived > cube(const Eigen::ArrayBase< Derived > &x)
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_abs_op< typename Derived::Scalar >, const Derived > abs(const Eigen::ArrayBase< Derived > &x)
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_bessel_i1_op< typename Derived::Scalar >, const Derived > bessel_i1(const Eigen::ArrayBase< Derived > &x)
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_exp_op< typename Derived::Scalar >, const Derived > exp(const Eigen::ArrayBase< Derived > &x)
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_bessel_i1e_op< typename Derived::Scalar >, const Derived > bessel_i1e(const Eigen::ArrayBase< Derived > &x)
EIGEN_CONSTEXPR bool operator!=(const Pair< U, V > &x, const Pair< U, V > &y)
Definition: TensorMeta.h:246
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_expm1_op< typename Derived::Scalar >, const Derived > expm1(const Eigen::ArrayBase< Derived > &x)
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_log_op< typename Derived::Scalar >, const Derived > log(const Eigen::ArrayBase< Derived > &x)
EIGEN_ALWAYS_INLINE const T1 & choose(Cond< true >, const T1 &first, const T2 &)
Definition: TensorMeta.h:20
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_inverse_op< typename Derived::Scalar >, const Derived > inverse(const Eigen::ArrayBase< Derived > &x)
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_bessel_i0e_op< typename Derived::Scalar >, const Derived > bessel_i0e(const Eigen::ArrayBase< Derived > &x)
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_square_op< typename Derived::Scalar >, const Derived > square(const Eigen::ArrayBase< Derived > &x)
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_digamma_op< typename Derived::Scalar >, const Derived > digamma(const Eigen::ArrayBase< Derived > &x)
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_sqrt_op< typename Derived::Scalar >, const Derived > sqrt(const Eigen::ArrayBase< Derived > &x)
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_bessel_k1e_op< typename Derived::Scalar >, const Derived > bessel_k1e(const Eigen::ArrayBase< Derived > &x)
const Eigen::CwiseBinaryOp< Eigen::internal::scalar_gamma_sample_der_alpha_op< typename AlphaDerived::Scalar >, const AlphaDerived, const SampleDerived > gamma_sample_der_alpha(const Eigen::ArrayBase< AlphaDerived > &alpha, const Eigen::ArrayBase< SampleDerived > &sample)