.. _program_listing_file_src_navtk_utils_human_readable.hpp: Program Listing for File human_readable.hpp =========================================== |exhale_lsh| :ref:`Return to documentation for file ` (``src/navtk/utils/human_readable.hpp``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp #pragma once #include #include #include #include // To support GCC's oddball name mangling #ifdef __GNUG__ # include # include #endif namespace navtk { namespace utils { std::string repr(const Matrix& matrix, const std::string& decl); std::string repr(const Matrix& matrix); template std::string repr(const xt::xexpression& expr) { return repr(expr, "(expr)"); } std::string diff(const std::string& before_name, const std::string& after_name, const Matrix& before, const Matrix& after, double rtol = 1e-05, double atol = 1e-08); std::string diff(const Matrix& before, const Matrix& after, double rtol = 1e-05, double atol = 1e-08); template std::string identify_type() { #ifdef __GNUG__ int err; typedef std::unique_ptr CStrPtr; CStrPtr buffer{__cxxabiv1::__cxa_demangle(typeid(T).name(), nullptr, 0, &err), &std::free}; std::string out{err ? "" : buffer.get()}; #else std::string out{typeid(T).name()}; #endif if (std::is_rvalue_reference::value) return out + "&&"; else if (std::is_reference::value) return out + "&"; return out; } } // namespace utils } // namespace navtk