Please, help us to better know about our user community by answering the following short survey: https://forms.gle/wpyrxWi18ox9Z5ae9
Eigen  3.4.0
 
Loading...
Searching...
No Matches
ReshapedHelper.h
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
11#ifndef EIGEN_RESHAPED_HELPER_H
12#define EIGEN_RESHAPED_HELPER_H
13
14namespace Eigen {
15
16enum AutoSize_t { AutoSize };
17const int AutoOrder = 2;
18
19namespace internal {
20
21template<typename SizeType,typename OtherSize, int TotalSize>
22struct get_compiletime_reshape_size {
23 enum { value = get_fixed_value<SizeType>::value };
24};
25
26template<typename SizeType>
27Index get_runtime_reshape_size(SizeType size, Index /*other*/, Index /*total*/) {
28 return internal::get_runtime_value(size);
29}
30
31template<typename OtherSize, int TotalSize>
32struct get_compiletime_reshape_size<AutoSize_t,OtherSize,TotalSize> {
33 enum {
34 other_size = get_fixed_value<OtherSize>::value,
35 value = (TotalSize==Dynamic || other_size==Dynamic) ? Dynamic : TotalSize / other_size };
36};
37
38inline Index get_runtime_reshape_size(AutoSize_t /*size*/, Index other, Index total) {
39 return total/other;
40}
41
42template<int Flags, int Order>
43struct get_compiletime_reshape_order {
44 enum { value = Order == AutoOrder ? Flags & RowMajorBit : Order };
45};
46
47}
48
49} // end namespace Eigen
50
51#endif // EIGEN_RESHAPED_HELPER_H
const unsigned int RowMajorBit
Definition: Constants.h:66
Namespace containing all symbols from the Eigen library.
Definition: Core:141
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:74
const int Dynamic
Definition: Constants.h:22