Skip to content
Snippets Groups Projects
Verified Commit 0f6d88d3 authored by Justin Carpentier's avatar Justin Carpentier
Browse files

utils: add name methods for Scalar types

parent d817a31a
No related branches found
No related tags found
No related merge requests found
......@@ -71,6 +71,10 @@ SEARCH_FOR_BOOST()
# ----------------------------------------------------
# --- INCLUDE ----------------------------------------
# ----------------------------------------------------
SET(${PROJECT_NAME}_UTILS_HEADERS
include/eigenpy/utils/scalar-name.hpp
)
SET(${PROJECT_NAME}_SOLVERS_HEADERS
include/eigenpy/solvers/solvers.hpp
include/eigenpy/solvers/preconditioners.hpp
......@@ -83,6 +87,7 @@ SET(${PROJECT_NAME}_SOLVERS_HEADERS
)
SET(${PROJECT_NAME}_HEADERS
${${PROJECT_NAME}_UTILS_HEADERS}
${${PROJECT_NAME}_SOLVERS_HEADERS}
include/eigenpy/computation-info.hpp
include/eigenpy/eigenpy.hpp
......
/*
* Copyright 2020 INRIA
*/
#ifndef __eigenpy_utils_scalar_name_hpp__
#define __eigenpy_utils_scalar_name_hpp__
#include <string>
#include <complex>
namespace eigenpy
{
template<typename Scalar>
struct scalar_name
{
static std::string shortname();
};
template<>
struct scalar_name<float>
{
static std::string shortname() { return "f"; };
};
template<>
struct scalar_name<double>
{
static std::string shortname() { return "d"; };
};
template<>
struct scalar_name<long double>
{
static std::string shortname() { return "ld"; };
};
template<typename Scalar>
struct scalar_name< std::complex<Scalar> >
{
static std::string shortname() { return "c" + scalar_name<Scalar>(); };
};
}
#endif // ifndef __eigenpy_utils_scalar_name_hpp__
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment