From 70f1d4a80457b22dea93979e676e173869f3c6b4 Mon Sep 17 00:00:00 2001 From: Varun Agrawal Date: Thu, 28 Dec 2023 12:51:09 -0500 Subject: [PATCH] mark GTSAM_EXPORT and update docstring --- gtsam/nonlinear/internal/ChiSquaredInverse.h | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/gtsam/nonlinear/internal/ChiSquaredInverse.h b/gtsam/nonlinear/internal/ChiSquaredInverse.h index 78eb73f67..5a25a030e 100644 --- a/gtsam/nonlinear/internal/ChiSquaredInverse.h +++ b/gtsam/nonlinear/internal/ChiSquaredInverse.h @@ -21,6 +21,7 @@ #pragma once #include +#include namespace gtsam { @@ -29,14 +30,19 @@ namespace internal { /** * @brief Compute the quantile function of the Chi-Squared distribution. * + * The quantile function of the Chi-squared distribution is the quantile of + * the specific (inverse) incomplete Gamma distribution. + * + * We have a dedicated function so we can unit test any issues easily while also + * allowing it to be updated in the future without any backwards-compatibility + * issues. + * * @param dofs Degrees of freedom * @param alpha Quantile value * @return double */ -double chi_squared_quantile(const double dofs, const double alpha) { - // The quantile function of the Chi-squared distribution is the quantile of - // the specific (inverse) incomplete Gamma distribution - // return 2 * internal::igami(dofs / 2, alpha); +double GTSAM_EXPORT chi_squared_quantile(const double dofs, + const double alpha) { return 2 * cephes_igami(dofs / 2, alpha); }