ReshapedHelper.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) 2017 Gael Guennebaud <gael.guennebaud@inria.fr>
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_RESHAPED_HELPER_H
11 #define EIGEN_RESHAPED_HELPER_H
12 
13 // IWYU pragma: private
14 #include "../InternalHeaderCheck.h"
15 
16 namespace Eigen {
17 
19 const int AutoOrder = 2;
20 
21 namespace internal {
22 
23 template <typename SizeType, typename OtherSize, int TotalSize>
26 };
27 
28 template <typename SizeType>
31 }
32 
33 template <typename OtherSize, int TotalSize>
34 struct get_compiletime_reshape_size<AutoSize_t, OtherSize, TotalSize> {
35  enum {
37  value = (TotalSize == Dynamic || other_size == Dynamic) ? Dynamic : TotalSize / other_size
38  };
39 };
40 
41 inline Index get_runtime_reshape_size(AutoSize_t /*size*/, Index other, Index total) { return total / other; }
42 
43 constexpr inline int get_compiletime_reshape_order(int flags, int order) {
44  return order == AutoOrder ? flags & RowMajorBit : order;
45 }
46 
47 } // namespace internal
48 
49 } // end namespace Eigen
50 
51 #endif // EIGEN_RESHAPED_HELPER_H
Scalar Scalar int size
Definition: benchVecAdd.cpp:17
const unsigned int RowMajorBit
Definition: Constants.h:70
Index get_runtime_reshape_size(SizeType size, Index, Index)
Definition: ReshapedHelper.h:29
constexpr int get_compiletime_reshape_order(int flags, int order)
Definition: ReshapedHelper.h:43
EIGEN_DEVICE_FUNC Index get_runtime_value(const T &x)
Definition: IntegralConstant.h:175
Namespace containing all symbols from the Eigen library.
Definition: bench_norm.cpp:70
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:83
const int AutoOrder
Definition: ReshapedHelper.h:19
AutoSize_t
Definition: ReshapedHelper.h:18
@ AutoSize
Definition: ReshapedHelper.h:18
const int Dynamic
Definition: Constants.h:25
Definition: Eigen_Colamd.h:49
unsigned SizeType
Use 32-bit array/string indices even for 64-bit platform, instead of using size_t.
Definition: rapidjson.h:67
Definition: ReshapedHelper.h:24
@ value
Definition: ReshapedHelper.h:25
Definition: IntegralConstant.h:155