Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/eigen3/Eigen/src/Core/util/ReshapedHelper.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // This file is part of Eigen, a lightweight C++ template library
0002 // for linear algebra.
0003 //
0004 // Copyright (C) 2017 Gael Guennebaud <gael.guennebaud@inria.fr>
0005 //
0006 // This Source Code Form is subject to the terms of the Mozilla
0007 // Public License v. 2.0. If a copy of the MPL was not distributed
0008 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
0009 
0010 
0011 #ifndef EIGEN_RESHAPED_HELPER_H
0012 #define EIGEN_RESHAPED_HELPER_H
0013 
0014 namespace Eigen {
0015 
0016 enum AutoSize_t   { AutoSize };
0017 const int AutoOrder = 2;
0018 
0019 namespace internal {
0020 
0021 template<typename SizeType,typename OtherSize, int TotalSize>
0022 struct get_compiletime_reshape_size {
0023   enum { value = get_fixed_value<SizeType>::value };
0024 };
0025 
0026 template<typename SizeType>
0027 Index get_runtime_reshape_size(SizeType size, Index /*other*/, Index /*total*/) {
0028   return internal::get_runtime_value(size);
0029 }
0030 
0031 template<typename OtherSize, int TotalSize>
0032 struct get_compiletime_reshape_size<AutoSize_t,OtherSize,TotalSize> {
0033   enum {
0034     other_size = get_fixed_value<OtherSize>::value,
0035     value = (TotalSize==Dynamic || other_size==Dynamic) ? Dynamic : TotalSize / other_size };
0036 };
0037 
0038 inline Index get_runtime_reshape_size(AutoSize_t /*size*/, Index other, Index total) {
0039   return total/other;
0040 }
0041 
0042 template<int Flags, int Order>
0043 struct get_compiletime_reshape_order {
0044   enum { value = Order == AutoOrder ? Flags & RowMajorBit : Order };
0045 };
0046 
0047 }
0048 
0049 } // end namespace Eigen
0050 
0051 #endif // EIGEN_RESHAPED_HELPER_H