GeneralProduct.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) 2006-2008 Benoit Jacob <jacob.benoit.1@gmail.com>
5 // Copyright (C) 2008-2011 Gael Guennebaud <gael.guennebaud@inria.fr>
6 //
7 // This Source Code Form is subject to the terms of the Mozilla
8 // Public License v. 2.0. If a copy of the MPL was not distributed
9 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 
11 #ifndef EIGEN_GENERAL_PRODUCT_H
12 #define EIGEN_GENERAL_PRODUCT_H
13 
14 // IWYU pragma: private
15 #include "./InternalHeaderCheck.h"
16 
17 namespace Eigen {
18 
19 enum { Large = 2, Small = 3 };
20 
21 // Define the threshold value to fallback from the generic matrix-matrix product
22 // implementation (heavy) to the lightweight coeff-based product one.
23 // See generic_product_impl<Lhs,Rhs,DenseShape,DenseShape,GemmProduct>
24 // in products/GeneralMatrixMatrix.h for more details.
25 // TODO This threshold should also be used in the compile-time selector below.
26 #ifndef EIGEN_GEMM_TO_COEFFBASED_THRESHOLD
27 // This default value has been obtained on a Haswell architecture.
28 #define EIGEN_GEMM_TO_COEFFBASED_THRESHOLD 20
29 #endif
30 
31 namespace internal {
32 
33 template <int Rows, int Cols, int Depth>
35 
36 template <int Size, int MaxSize>
38  enum {
39 #ifndef EIGEN_GPU_COMPILE_PHASE
40  is_large = MaxSize == Dynamic || Size >= EIGEN_CACHEFRIENDLY_PRODUCT_THRESHOLD ||
41  (Size == Dynamic && MaxSize >= EIGEN_CACHEFRIENDLY_PRODUCT_THRESHOLD),
42 #else
43  is_large = 0,
44 #endif
45  value = is_large ? Large
46  : Size == 1 ? 1
47  : Small
48  };
49 };
50 
51 template <typename Lhs, typename Rhs>
52 struct product_type {
55  enum {
62  };
63 
64  // the splitting into different lines of code here, introducing the _select enums and the typedef below,
65  // is to work around an internal compiler error with gcc 4.1 and 4.2.
66  private:
67  enum {
71  };
73 
74  public:
76 #ifdef EIGEN_DEBUG_PRODUCT
77  static void debug() {
85  }
86 #endif
87 };
88 
89 /* The following allows to select the kind of product at compile time
90  * based on the three dimensions of the product.
91  * This is a compile time mapping from {1,Small,Large}^3 -> {product types} */
92 // FIXME I'm not sure the current mapping is the ideal one.
93 template <int M, int N>
94 struct product_type_selector<M, N, 1> {
95  enum { ret = OuterProduct };
96 };
97 template <int M>
98 struct product_type_selector<M, 1, 1> {
100 };
101 template <int N>
102 struct product_type_selector<1, N, 1> {
104 };
105 template <int Depth>
106 struct product_type_selector<1, 1, Depth> {
107  enum { ret = InnerProduct };
108 };
109 template <>
110 struct product_type_selector<1, 1, 1> {
111  enum { ret = InnerProduct };
112 };
113 template <>
116 };
117 template <>
120 };
121 template <>
124 };
125 template <>
128 };
129 template <>
132 };
133 template <>
136 };
137 template <>
140 };
141 template <>
143  enum { ret = GemvProduct };
144 };
145 template <>
148 };
149 template <>
152 };
153 template <>
155  enum { ret = GemvProduct };
156 };
157 template <>
160 };
161 template <>
163  enum { ret = GemmProduct };
164 };
165 template <>
167  enum { ret = GemmProduct };
168 };
169 template <>
171  enum { ret = GemmProduct };
172 };
173 template <>
175  enum { ret = GemmProduct };
176 };
177 template <>
180 };
181 template <>
184 };
185 template <>
187  enum { ret = GemmProduct };
188 };
189 
190 } // end namespace internal
191 
192 /***********************************************************************
193  * Implementation of Inner Vector Vector Product
194  ***********************************************************************/
195 
196 // FIXME : maybe the "inner product" could return a Scalar
197 // instead of a 1x1 matrix ??
198 // Pro: more natural for the user
199 // Cons: this could be a problem if in a meta unrolled algorithm a matrix-matrix
200 // product ends up to a row-vector times col-vector product... To tackle this use
201 // case, we could have a specialization for Block<MatrixType,1,1> with: operator=(Scalar x);
202 
203 /***********************************************************************
204  * Implementation of Outer Vector Vector Product
205  ***********************************************************************/
206 
207 /***********************************************************************
208  * Implementation of General Matrix Vector Product
209  ***********************************************************************/
210 
211 /* According to the shape/flags of the matrix we have to distinghish 3 different cases:
212  * 1 - the matrix is col-major, BLAS compatible and M is large => call fast BLAS-like colmajor routine
213  * 2 - the matrix is row-major, BLAS compatible and N is large => call fast BLAS-like rowmajor routine
214  * 3 - all other cases are handled using a simple loop along the outer-storage direction.
215  * Therefore we need a lower level meta selector.
216  * Furthermore, if the matrix is the rhs, then the product has to be transposed.
217  */
218 namespace internal {
219 
220 template <int Side, int StorageOrder, bool BlasCompatible>
222 
223 } // end namespace internal
224 
225 namespace internal {
226 
227 template <typename Scalar, int Size, int MaxSize, bool Cond>
229 
230 template <typename Scalar, int Size, int MaxSize>
231 struct gemv_static_vector_if<Scalar, Size, MaxSize, false> {
233  eigen_internal_assert(false && "should never be called");
234  return 0;
235  }
236 };
237 
238 template <typename Scalar, int Size>
239 struct gemv_static_vector_if<Scalar, Size, Dynamic, true> {
241 };
242 
243 template <typename Scalar, int Size, int MaxSize>
244 struct gemv_static_vector_if<Scalar, Size, MaxSize, true> {
245 #if EIGEN_MAX_STATIC_ALIGN_BYTES != 0
247  EIGEN_STRONG_INLINE constexpr Scalar* data() { return m_data.array; }
248 #else
249  // Some architectures cannot align on the stack,
250  // => let's manually enforce alignment by allocating more data and return the address of the first aligned element.
253  return reinterpret_cast<Scalar*>((std::uintptr_t(m_data.array) & ~(std::size_t(EIGEN_MAX_ALIGN_BYTES - 1))) +
255  }
256 #endif
257 };
258 
259 // The vector is on the left => transposition
260 template <int StorageOrder, bool BlasCompatible>
261 struct gemv_dense_selector<OnTheLeft, StorageOrder, BlasCompatible> {
262  template <typename Lhs, typename Rhs, typename Dest>
263  static void run(const Lhs& lhs, const Rhs& rhs, Dest& dest, const typename Dest::Scalar& alpha) {
264  Transpose<Dest> destT(dest);
265  enum { OtherStorageOrder = StorageOrder == RowMajor ? ColMajor : RowMajor };
266  gemv_dense_selector<OnTheRight, OtherStorageOrder, BlasCompatible>::run(rhs.transpose(), lhs.transpose(), destT,
267  alpha);
268  }
269 };
270 
271 template <>
273  template <typename Lhs, typename Rhs, typename Dest>
274  static inline void run(const Lhs& lhs, const Rhs& rhs, Dest& dest, const typename Dest::Scalar& alpha) {
275  typedef typename Lhs::Scalar LhsScalar;
276  typedef typename Rhs::Scalar RhsScalar;
277  typedef typename Dest::Scalar ResScalar;
278 
279  typedef internal::blas_traits<Lhs> LhsBlasTraits;
280  typedef typename LhsBlasTraits::DirectLinearAccessType ActualLhsType;
281  typedef internal::blas_traits<Rhs> RhsBlasTraits;
282  typedef typename RhsBlasTraits::DirectLinearAccessType ActualRhsType;
283 
285  MappedDest;
286 
287  ActualLhsType actualLhs = LhsBlasTraits::extract(lhs);
288  ActualRhsType actualRhs = RhsBlasTraits::extract(rhs);
289 
290  ResScalar actualAlpha = combine_scalar_factors(alpha, lhs, rhs);
291 
292  // make sure Dest is a compile-time vector type (bug 1166)
293  typedef std::conditional_t<Dest::IsVectorAtCompileTime, Dest, typename Dest::ColXpr> ActualDest;
294 
295  enum {
296  // FIXME find a way to allow an inner stride on the result if packet_traits<Scalar>::size==1
297  // on, the other hand it is good for the cache to pack the vector anyways...
298  EvalToDestAtCompileTime = (ActualDest::InnerStrideAtCompileTime == 1),
300  MightCannotUseDest = ((!EvalToDestAtCompileTime) || ComplexByReal) && (ActualDest::MaxSizeAtCompileTime != 0)
301  };
302 
305  RhsScalar compatibleAlpha = get_factor<ResScalar, RhsScalar>::run(actualAlpha);
306 
307  if (!MightCannotUseDest) {
308  // shortcut if we are sure to be able to use dest directly,
309  // this ease the compiler to generate cleaner and more optimzized code for most common cases
310  general_matrix_vector_product<Index, LhsScalar, LhsMapper, ColMajor, LhsBlasTraits::NeedToConjugate, RhsScalar,
311  RhsMapper, RhsBlasTraits::NeedToConjugate>::run(actualLhs.rows(), actualLhs.cols(),
312  LhsMapper(actualLhs.data(),
313  actualLhs.outerStride()),
314  RhsMapper(actualRhs.data(),
315  actualRhs.innerStride()),
316  dest.data(), 1, compatibleAlpha);
317  } else {
318  gemv_static_vector_if<ResScalar, ActualDest::SizeAtCompileTime, ActualDest::MaxSizeAtCompileTime,
319  MightCannotUseDest>
320  static_dest;
321 
322  const bool alphaIsCompatible = (!ComplexByReal) || (numext::is_exactly_zero(numext::imag(actualAlpha)));
323  const bool evalToDest = EvalToDestAtCompileTime && alphaIsCompatible;
324 
325  ei_declare_aligned_stack_constructed_variable(ResScalar, actualDestPtr, dest.size(),
326  evalToDest ? dest.data() : static_dest.data());
327 
328  if (!evalToDest) {
329 #ifdef EIGEN_DENSE_STORAGE_CTOR_PLUGIN
330  constexpr int Size = Dest::SizeAtCompileTime;
331  Index size = dest.size();
332  EIGEN_DENSE_STORAGE_CTOR_PLUGIN
333 #endif
334  if (!alphaIsCompatible) {
335  MappedDest(actualDestPtr, dest.size()).setZero();
336  compatibleAlpha = RhsScalar(1);
337  } else
338  MappedDest(actualDestPtr, dest.size()) = dest;
339  }
340 
341  general_matrix_vector_product<Index, LhsScalar, LhsMapper, ColMajor, LhsBlasTraits::NeedToConjugate, RhsScalar,
342  RhsMapper, RhsBlasTraits::NeedToConjugate>::run(actualLhs.rows(), actualLhs.cols(),
343  LhsMapper(actualLhs.data(),
344  actualLhs.outerStride()),
345  RhsMapper(actualRhs.data(),
346  actualRhs.innerStride()),
347  actualDestPtr, 1, compatibleAlpha);
348 
349  if (!evalToDest) {
350  if (!alphaIsCompatible)
351  dest.matrix() += actualAlpha * MappedDest(actualDestPtr, dest.size());
352  else
353  dest = MappedDest(actualDestPtr, dest.size());
354  }
355  }
356  }
357 };
358 
359 template <>
361  template <typename Lhs, typename Rhs, typename Dest>
362  static void run(const Lhs& lhs, const Rhs& rhs, Dest& dest, const typename Dest::Scalar& alpha) {
363  typedef typename Lhs::Scalar LhsScalar;
364  typedef typename Rhs::Scalar RhsScalar;
365  typedef typename Dest::Scalar ResScalar;
366 
367  typedef internal::blas_traits<Lhs> LhsBlasTraits;
368  typedef typename LhsBlasTraits::DirectLinearAccessType ActualLhsType;
369  typedef internal::blas_traits<Rhs> RhsBlasTraits;
370  typedef typename RhsBlasTraits::DirectLinearAccessType ActualRhsType;
371  typedef internal::remove_all_t<ActualRhsType> ActualRhsTypeCleaned;
372 
373  std::add_const_t<ActualLhsType> actualLhs = LhsBlasTraits::extract(lhs);
374  std::add_const_t<ActualRhsType> actualRhs = RhsBlasTraits::extract(rhs);
375 
376  ResScalar actualAlpha = combine_scalar_factors(alpha, lhs, rhs);
377 
378  enum {
379  // FIXME find a way to allow an inner stride on the result if packet_traits<Scalar>::size==1
380  // on, the other hand it is good for the cache to pack the vector anyways...
381  DirectlyUseRhs =
382  ActualRhsTypeCleaned::InnerStrideAtCompileTime == 1 || ActualRhsTypeCleaned::MaxSizeAtCompileTime == 0
383  };
384 
385  gemv_static_vector_if<RhsScalar, ActualRhsTypeCleaned::SizeAtCompileTime,
386  ActualRhsTypeCleaned::MaxSizeAtCompileTime, !DirectlyUseRhs>
387  static_rhs;
388 
390  RhsScalar, actualRhsPtr, actualRhs.size(),
391  DirectlyUseRhs ? const_cast<RhsScalar*>(actualRhs.data()) : static_rhs.data());
392 
393  if (!DirectlyUseRhs) {
394 #ifdef EIGEN_DENSE_STORAGE_CTOR_PLUGIN
395  constexpr int Size = ActualRhsTypeCleaned::SizeAtCompileTime;
396  Index size = actualRhs.size();
397  EIGEN_DENSE_STORAGE_CTOR_PLUGIN
398 #endif
399  Map<typename ActualRhsTypeCleaned::PlainObject>(actualRhsPtr, actualRhs.size()) = actualRhs;
400  }
401 
404  general_matrix_vector_product<Index, LhsScalar, LhsMapper, RowMajor, LhsBlasTraits::NeedToConjugate, RhsScalar,
405  RhsMapper, RhsBlasTraits::NeedToConjugate>::
406  run(actualLhs.rows(), actualLhs.cols(), LhsMapper(actualLhs.data(), actualLhs.outerStride()),
407  RhsMapper(actualRhsPtr, 1), dest.data(),
408  dest.col(0).innerStride(), // NOTE if dest is not a vector at compile-time, then dest.innerStride() might
409  // be wrong. (bug 1166)
410  actualAlpha);
411  }
412 };
413 
414 template <>
416  template <typename Lhs, typename Rhs, typename Dest>
417  static void run(const Lhs& lhs, const Rhs& rhs, Dest& dest, const typename Dest::Scalar& alpha) {
419  EIGEN_INTERNAL_COMPILATION_ERROR_OR_YOU_MADE_A_PROGRAMMING_MISTAKE);
420  // TODO if rhs is large enough it might be beneficial to make sure that dest is sequentially stored in memory,
421  // otherwise use a temp
422  typename nested_eval<Rhs, 1>::type actual_rhs(rhs);
423  const Index size = rhs.rows();
424  for (Index k = 0; k < size; ++k) dest += (alpha * actual_rhs.coeff(k)) * lhs.col(k);
425  }
426 };
427 
428 template <>
430  template <typename Lhs, typename Rhs, typename Dest>
431  static void run(const Lhs& lhs, const Rhs& rhs, Dest& dest, const typename Dest::Scalar& alpha) {
433  EIGEN_INTERNAL_COMPILATION_ERROR_OR_YOU_MADE_A_PROGRAMMING_MISTAKE);
434  typename nested_eval<Rhs, Lhs::RowsAtCompileTime>::type actual_rhs(rhs);
435  const Index rows = dest.rows();
436  for (Index i = 0; i < rows; ++i)
437  dest.coeffRef(i) += alpha * (lhs.row(i).cwiseProduct(actual_rhs.transpose())).sum();
438  }
439 };
440 
441 } // end namespace internal
442 
443 /***************************************************************************
444  * Implementation of matrix base methods
445  ***************************************************************************/
446 
453 template <typename Derived>
454 template <typename OtherDerived>
456  const MatrixBase<OtherDerived>& other) const {
457  // A note regarding the function declaration: In MSVC, this function will sometimes
458  // not be inlined since DenseStorage is an unwindable object for dynamic
459  // matrices and product types are holding a member to store the result.
460  // Thus it does not help tagging this function with EIGEN_STRONG_INLINE.
461  enum {
462  ProductIsValid = Derived::ColsAtCompileTime == Dynamic || OtherDerived::RowsAtCompileTime == Dynamic ||
463  int(Derived::ColsAtCompileTime) == int(OtherDerived::RowsAtCompileTime),
464  AreVectors = Derived::IsVectorAtCompileTime && OtherDerived::IsVectorAtCompileTime,
465  SameSizes = EIGEN_PREDICATE_SAME_MATRIX_SIZE(Derived, OtherDerived)
466  };
467  // note to the lost user:
468  // * for a dot product use: v1.dot(v2)
469  // * for a coeff-wise product use: v1.cwiseProduct(v2)
471  ProductIsValid || !(AreVectors && SameSizes),
472  INVALID_VECTOR_VECTOR_PRODUCT__IF_YOU_WANTED_A_DOT_OR_COEFF_WISE_PRODUCT_YOU_MUST_USE_THE_EXPLICIT_FUNCTIONS)
473  EIGEN_STATIC_ASSERT(ProductIsValid || !(SameSizes && !AreVectors),
474  INVALID_MATRIX_PRODUCT__IF_YOU_WANTED_A_COEFF_WISE_PRODUCT_YOU_MUST_USE_THE_EXPLICIT_FUNCTION)
475  EIGEN_STATIC_ASSERT(ProductIsValid || SameSizes, INVALID_MATRIX_PRODUCT)
476 #ifdef EIGEN_DEBUG_PRODUCT
478 #endif
479 
480  return Product<Derived, OtherDerived>(derived(), other.derived());
481 }
482 
494 template <typename Derived>
495 template <typename OtherDerived>
498  enum {
499  ProductIsValid = Derived::ColsAtCompileTime == Dynamic || OtherDerived::RowsAtCompileTime == Dynamic ||
500  int(Derived::ColsAtCompileTime) == int(OtherDerived::RowsAtCompileTime),
501  AreVectors = Derived::IsVectorAtCompileTime && OtherDerived::IsVectorAtCompileTime,
502  SameSizes = EIGEN_PREDICATE_SAME_MATRIX_SIZE(Derived, OtherDerived)
503  };
504  // note to the lost user:
505  // * for a dot product use: v1.dot(v2)
506  // * for a coeff-wise product use: v1.cwiseProduct(v2)
508  ProductIsValid || !(AreVectors && SameSizes),
509  INVALID_VECTOR_VECTOR_PRODUCT__IF_YOU_WANTED_A_DOT_OR_COEFF_WISE_PRODUCT_YOU_MUST_USE_THE_EXPLICIT_FUNCTIONS)
510  EIGEN_STATIC_ASSERT(ProductIsValid || !(SameSizes && !AreVectors),
511  INVALID_MATRIX_PRODUCT__IF_YOU_WANTED_A_COEFF_WISE_PRODUCT_YOU_MUST_USE_THE_EXPLICIT_FUNCTION)
512  EIGEN_STATIC_ASSERT(ProductIsValid || SameSizes, INVALID_MATRIX_PRODUCT)
513 
514  return Product<Derived, OtherDerived, LazyProduct>(derived(), other.derived());
515 }
516 
517 } // end namespace Eigen
518 
519 #endif // EIGEN_PRODUCT_H
#define EIGEN_CACHEFRIENDLY_PRODUCT_THRESHOLD
Definition: AltiVec/PacketMath.h:21
AnnoyingScalar imag(const AnnoyingScalar &)
Definition: AnnoyingScalar.h:132
int i
Definition: BiCGSTAB_step_by_step.cpp:9
#define EIGEN_MAX_ALIGN_BYTES
Definition: ConfigureVectorization.h:163
#define eigen_internal_assert(x)
Definition: Macros.h:916
#define EIGEN_DEBUG_VAR(x)
Definition: Macros.h:815
#define EIGEN_DEVICE_FUNC
Definition: Macros.h:892
#define EIGEN_STRONG_INLINE
Definition: Macros.h:834
int data[]
Definition: Map_placement_new.cpp:1
#define ei_declare_aligned_stack_constructed_variable(TYPE, NAME, SIZE, BUFFER)
Definition: Memory.h:806
#define EIGEN_STATIC_ASSERT(X, MSG)
Definition: StaticAssert.h:26
#define EIGEN_PREDICATE_SAME_MATRIX_SIZE(TYPE0, TYPE1)
Definition: StaticAssert.h:66
int rows
Definition: Tutorial_commainit_02.cpp:1
Scalar Scalar int size
Definition: benchVecAdd.cpp:17
SCALAR Scalar
Definition: bench_gemm.cpp:45
A matrix or vector expression mapping an existing array of data.
Definition: Map.h:96
Base class for all dense matrices, vectors, and expressions.
Definition: MatrixBase.h:52
EIGEN_DEVICE_FUNC const Product< Derived, OtherDerived, LazyProduct > lazyProduct(const MatrixBase< OtherDerived > &other) const
EIGEN_DEVICE_FUNC const Product< Derived, OtherDerived > operator*(const MatrixBase< OtherDerived > &other) const
The matrix class, also used for vectors and row-vectors.
Definition: Eigen/Eigen/src/Core/Matrix.h:186
Expression of the product of two arbitrary matrices or vectors.
Definition: Product.h:202
Expression of the transpose of a matrix.
Definition: Transpose.h:56
Definition: BlasUtil.h:443
@ N
Definition: constructor.cpp:22
@ GemvProduct
Definition: Constants.h:510
@ InnerProduct
Definition: Constants.h:509
@ CoeffBasedProductMode
Definition: Constants.h:506
@ OuterProduct
Definition: Constants.h:508
@ GemmProduct
Definition: Constants.h:511
@ LazyCoeffBasedProductMode
Definition: Constants.h:507
@ AlignedMax
Definition: Constants.h:254
@ ColMajor
Definition: Constants.h:318
@ RowMajor
Definition: Constants.h:320
@ OnTheLeft
Definition: Constants.h:331
@ OnTheRight
Definition: Constants.h:333
return int(ret)+1
Eigen::DenseIndex ret
Definition: level1_cplx_impl.h:43
RealScalar alpha
Definition: level1_cplx_impl.h:151
char char char int int * k
Definition: level2_impl.h:374
constexpr int plain_enum_min(A a, B b)
Definition: Meta.h:649
@ Lhs
Definition: TensorContractionMapper.h:20
@ Rhs
Definition: TensorContractionMapper.h:20
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE ResScalar combine_scalar_factors(const ResScalar &alpha, const Lhs &lhs, const Rhs &rhs)
Definition: BlasUtil.h:609
constexpr int min_size_prefer_fixed(A a, B b)
Definition: Meta.h:683
typename remove_all< T >::type remove_all_t
Definition: Meta.h:142
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bool is_exactly_zero(const X &x)
Definition: Meta.h:592
Namespace containing all symbols from the Eigen library.
Definition: bench_norm.cpp:70
auto run(Kernel kernel, Args &&... args) -> decltype(kernel(args...))
Definition: gpu_test_helper.h:414
squared absolute value
Definition: GlobalFunctions.h:87
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:83
@ Small
Definition: GeneralProduct.h:19
@ Large
Definition: GeneralProduct.h:19
const int Dynamic
Definition: Constants.h:25
Definition: Eigen_Colamd.h:49
Holds information about the various numeric (i.e. scalar) types allowed by Eigen.
Definition: NumTraits.h:217
Definition: BlasUtil.h:459
static void run(const Lhs &lhs, const Rhs &rhs, Dest &dest, const typename Dest::Scalar &alpha)
Definition: GeneralProduct.h:263
static void run(const Lhs &lhs, const Rhs &rhs, Dest &dest, const typename Dest::Scalar &alpha)
Definition: GeneralProduct.h:417
static void run(const Lhs &lhs, const Rhs &rhs, Dest &dest, const typename Dest::Scalar &alpha)
Definition: GeneralProduct.h:274
static void run(const Lhs &lhs, const Rhs &rhs, Dest &dest, const typename Dest::Scalar &alpha)
Definition: GeneralProduct.h:431
static void run(const Lhs &lhs, const Rhs &rhs, Dest &dest, const typename Dest::Scalar &alpha)
Definition: GeneralProduct.h:362
Definition: GeneralProduct.h:221
EIGEN_STRONG_INLINE constexpr EIGEN_DEVICE_FUNC Scalar * data()
Definition: GeneralProduct.h:240
EIGEN_STRONG_INLINE constexpr EIGEN_DEVICE_FUNC Scalar * data()
Definition: GeneralProduct.h:232
internal::plain_array< Scalar, internal::min_size_prefer_fixed(Size, MaxSize)+EIGEN_MAX_ALIGN_BYTES, 0 > m_data
Definition: GeneralProduct.h:251
constexpr EIGEN_STRONG_INLINE Scalar * data()
Definition: GeneralProduct.h:252
Definition: GeneralProduct.h:228
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE To run(const From &x)
Definition: BlasUtil.h:46
Definition: XprHelper.h:533
std::conditional_t< Evaluate, PlainObject, typename ref_selector< T >::type > type
Definition: XprHelper.h:549
Definition: GenericPacketMath.h:108
Definition: DenseStorage.h:54
Definition: GeneralProduct.h:37
Definition: GeneralProduct.h:34
Definition: GeneralProduct.h:52
@ value
Definition: GeneralProduct.h:75
@ ret
Definition: GeneralProduct.h:75
@ rows_select
Definition: GeneralProduct.h:68
@ cols_select
Definition: GeneralProduct.h:69
@ depth_select
Definition: GeneralProduct.h:70
remove_all_t< Rhs > Rhs_
Definition: GeneralProduct.h:54
product_type_selector< rows_select, cols_select, depth_select > selector
Definition: GeneralProduct.h:72
remove_all_t< Lhs > Lhs_
Definition: GeneralProduct.h:53
@ MaxDepth
Definition: GeneralProduct.h:60
@ Cols
Definition: GeneralProduct.h:59
@ MaxRows
Definition: GeneralProduct.h:56
@ Depth
Definition: GeneralProduct.h:61
@ MaxCols
Definition: GeneralProduct.h:58
@ Rows
Definition: GeneralProduct.h:57
Definition: ForwardDeclarations.h:21
void run(const string &dir_name, LinearSolver *linear_solver_pt, const unsigned nel_1d, bool mess_up_order)
Definition: two_d_poisson_compare_solvers.cc:317