eigenpy 3.12.0
Bindings between Numpy and Eigen using Boost.Python
Loading...
Searching...
No Matches
scalar-name.hpp
1/*
2 * Copyright 2020 INRIA
3 */
4
5#ifndef __eigenpy_utils_scalar_name_hpp__
6#define __eigenpy_utils_scalar_name_hpp__
7
8#include <complex>
9#include <string>
10
11namespace eigenpy {
12template <typename Scalar>
13struct scalar_name {
14 static std::string shortname();
15};
16
17template <>
18struct scalar_name<float> {
19 static std::string shortname() { return "f"; };
20};
21
22template <>
23struct scalar_name<double> {
24 static std::string shortname() { return "d"; };
25};
26
27template <>
28struct scalar_name<long double> {
29 static std::string shortname() { return "ld"; };
30};
31
32template <typename Scalar>
33struct scalar_name<std::complex<Scalar>> {
34 static std::string shortname() { return "c" + scalar_name<Scalar>(); };
35};
36} // namespace eigenpy
37
38#endif // ifndef __eigenpy_utils_scalar_name_hpp__