mark GTSAM_EXPORT and update docstring

release/4.3a0
Varun Agrawal 2023-12-28 12:51:09 -05:00
parent b1ce501afe
commit 70f1d4a804
1 changed files with 10 additions and 4 deletions

View File

@ -21,6 +21,7 @@
#pragma once
#include <gtsam/3rdparty/cephes/cephes.h>
#include <gtsam/dllexport.h>
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);
}