mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
added CustomIndex capability only to Tensor and not yet to TensorBase.
using Sfinae and is_base_of to select correct template which converts to array<Index,NumIndices> user: Gabriel Nützi <gnuetzi@gmx.ch> branch 'default' added unsupported/Eigen/CXX11/src/Tensor/TensorMetaMacros.h added unsupported/test/cxx11_tensor_customIndex.cpp changed unsupported/Eigen/CXX11/Tensor changed unsupported/Eigen/CXX11/src/Tensor/Tensor.h changed unsupported/Eigen/CXX11/src/Tensor/TensorMeta.h changed unsupported/test/CMakeLists.txt
This commit is contained in:
33
unsupported/Eigen/CXX11/src/Tensor/TensorMetaMacros.h
Normal file
33
unsupported/Eigen/CXX11/src/Tensor/TensorMetaMacros.h
Normal file
@@ -0,0 +1,33 @@
|
||||
// This file is part of Eigen, a lightweight C++ template library
|
||||
// for linear algebra.
|
||||
//
|
||||
// Copyright (C) 2015 Benoit Steiner <benoit.steiner.goog@gmail.com>
|
||||
//
|
||||
// This Source Code Form is subject to the terms of the Mozilla
|
||||
// Public License v. 2.0. If a copy of the MPL was not distributed
|
||||
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
#ifndef EIGEN_CXX11_TENSOR_TENSOR_META_MACROS_H
|
||||
#define EIGEN_CXX11_TENSOR_TENSOR_META_MACROS_H
|
||||
|
||||
|
||||
/** use this macro in sfinae selection in templated functions
|
||||
*
|
||||
* template<typename T,
|
||||
* typename std::enable_if< isBanana<T>::value , int >::type = 0
|
||||
* >
|
||||
* void foo(){}
|
||||
*
|
||||
* becomes =>
|
||||
*
|
||||
* template<typename TopoType,
|
||||
* SFINAE_ENABLE_IF( isBanana<T>::value )
|
||||
* >
|
||||
* void foo(){}
|
||||
*/
|
||||
|
||||
#define EIGEN_SFINAE_ENABLE_IF( __condition__ ) \
|
||||
typename internal::enable_if< ( __condition__ ) , int >::type = 0
|
||||
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user