Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow constraint tolerance to be adjusted with a compile-time define #2921

Merged
merged 1 commit into from
Jul 7, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion stan/math/prim/err/constraint_tolerance.hpp
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
#ifndef STAN_MATH_PRIM_ERR_CONSTRAINT_TOLERANCE_HPP
#define STAN_MATH_PRIM_ERR_CONSTRAINT_TOLERANCE_HPP

#ifndef STAN_MATH_CONSTRAINT_TOLERANCE
#define STAN_MATH_CONSTRAINT_TOLERANCE 1E-8
#endif

#include <stan/math/prim/meta.hpp>
namespace stan {
namespace math {

/**
* The tolerance for checking arithmetic bounds in rank and in
* simplexes. The default value is <code>1E-8</code>.
* This can changed by defining <code>STAN_MATH_CONSTRAINT_TOLERANCE</code>
* at compile time.
*/
const double CONSTRAINT_TOLERANCE = 1E-8;
const double CONSTRAINT_TOLERANCE = STAN_MATH_CONSTRAINT_TOLERANCE;

} // namespace math
} // namespace stan
Expand Down