eigenpy 3.12.0
Bindings between Numpy and Eigen using Boost.Python
Loading...
Searching...
No Matches
scalar-conversion.hpp
1//
2// Copyright (c) 2014-2024 CNRS INRIA
3//
4
5#ifndef __eigenpy_scalar_conversion_hpp__
6#define __eigenpy_scalar_conversion_hpp__
7
8#include "eigenpy/config.hpp"
9#include <boost/numeric/conversion/conversion_traits.hpp>
10#include <complex>
11
12namespace eigenpy {
13
14template <typename Source, typename Target>
16 : public boost::mpl::if_c<std::is_same<Source, Target>::value,
17 std::true_type,
18 typename boost::numeric::conversion_traits<
19 Source, Target>::subranged>::type {};
20
22template <typename ScalarSource, typename ScalarTarget>
23struct FromTypeToType<std::complex<ScalarSource>, std::complex<ScalarTarget>>
24 : public boost::mpl::if_c<
25 std::is_same<ScalarSource, ScalarTarget>::value, std::true_type,
26 typename boost::numeric::conversion_traits<
27 ScalarSource, ScalarTarget>::subranged>::type {};
28
29} // namespace eigenpy
30
31#endif // __eigenpy_scalar_conversion_hpp__