#include <cmath>
#include "Eigen/Dense"
class Tools {
   public:
    constexpr static void mat_sqrt(Eigen::Matrix2d &mat) {
        const auto size = static_cast<unsigned long>(mat.size());
        for (unsigned long index = 0; index < size; index++) {
            mat.data()[index] = sqrt(mat.data()[index]);
        }
    }

    constexpr static double M_Pl =
        3.141592653589793238462643383279502884; /* pi */

    constexpr static double D_para(double D0, double p) {
        return D0 / (M_Pl * 2.0) *
               (log(p) - 0.1401 + 1.034 / p - 0.228 / (p * p));
    }
    constexpr static double D_ortho(double D0, double p) {
        return D0 / (M_Pl * 4.0) *
               (log(p) + 0.8369 + 0.5551 / p - 0.06066 / (p * p));
    }
    constexpr static double D_rot(double D0, double p) {
        return 3 * D0 / (M_Pl * p * p) *
               (log(p) - 0.3512 + 0.7804 / p - 0.09801 / (p * p));
    }
};      // namespace Tools
