string_utils/eigen.hpp
Go to the documentation of this file.
1 #pragma once
2 
11 #include <sstream>
12 #include <string>
13 
14 #include <Eigen/Core>
15 #include <Eigen/Geometry>
16 
17 namespace cras
18 {
19 
20 template<typename Scalar, int Rows, int Cols, int Options, int MaxRows, int MaxCols>
21 inline ::std::string to_string(const ::Eigen::Matrix<Scalar, Rows, Cols, Options, MaxRows, MaxCols>& value)
22 {
23  ::std::stringstream ss;
24  ss << value.format({6, ::Eigen::DontAlignCols, ", ", "; ", "[", "]", "[", "]"});
25  return ss.str();
26 }
27 
28 template<typename Derived, int Dim>
29 inline ::std::string to_string(const ::Eigen::RotationBase<Derived, Dim>& value)
30 {
31  ::std::stringstream ss;
32  ss << value.matrix().format({6, ::Eigen::DontAlignCols, ", ", "; ", "[", "]", "[", "]"});
33  return ss.str();
34 }
35 
36 template<typename Scalar, int Dim, int Mode, int Options>
37 inline ::std::string to_string(const ::Eigen::Transform<Scalar, Dim, Mode, Options>& value)
38 {
39  ::std::stringstream ss;
40  ss << value.matrix().format({6, ::Eigen::DontAlignCols, ", ", "; ", "[", "]", "[", "]"});
41  return ss.str();
42 }
43 
44 }
cras
Definition: any.hpp:15
cras::to_string
inline ::std::string to_string(const ::Eigen::Matrix< Scalar, Rows, Cols, Options, MaxRows, MaxCols > &value)
Definition: string_utils/eigen.hpp:21


cras_cpp_common
Author(s): Martin Pecka
autogenerated on Tue Nov 26 2024 03:49:04