.. _program_listing_file_include_ruckig_utils.hpp: Program Listing for File utils.hpp ================================== |exhale_lsh| :ref:`Return to documentation for file ` (``include/ruckig/utils.hpp``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp #pragma once #include #include #include #include #include #include #include namespace ruckig { constexpr static size_t DynamicDOFs {0}; template using StandardVector = typename std::conditional= 1, std::array, std::vector>::type; template using StandardSizeVector = typename std::conditional= 1, std::array, std::vector>::type; #ifdef EIGEN_VERSION_AT_LEAST #if EIGEN_VERSION_AT_LEAST(3,3,7) template using EigenVector = typename std::conditional= 1, Eigen::Matrix, Eigen::Matrix>::type; #endif #endif template inline std::string join(const Vector& array, bool high_precision = false) { std::ostringstream ss; for (size_t i = 0; i < array.size(); ++i) { if (i) ss << ", "; if (high_precision) ss << std::setprecision(16); ss << array[i]; } return ss.str(); } inline std::tuple integrate(double t, double p0, double v0, double a0, double j) { return std::make_tuple( p0 + t * (v0 + t * (a0 / 2 + t * j / 6)), v0 + t * (a0 + t * j / 2), a0 + t * j ); } } // namespace ruckig