Skip to content

Commit f6a157e

Browse files
committed
Allow constraint tolerance to be adjusted with a compile-time define
1 parent d88c95f commit f6a157e

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

stan/math/prim/err/constraint_tolerance.hpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,21 @@
11
#ifndef STAN_MATH_PRIM_ERR_CONSTRAINT_TOLERANCE_HPP
22
#define STAN_MATH_PRIM_ERR_CONSTRAINT_TOLERANCE_HPP
33

4+
#ifndef STAN_MATH_CONSTRAINT_TOLERANCE
5+
#define STAN_MATH_CONSTRAINT_TOLERANCE 1E-8
6+
#endif
7+
48
#include <stan/math/prim/meta.hpp>
59
namespace stan {
610
namespace math {
711

812
/**
913
* The tolerance for checking arithmetic bounds in rank and in
1014
* simplexes. The default value is <code>1E-8</code>.
15+
* This can changed by defining <code>STAN_MATH_CONSTRAINT_TOLERANCE</code>
16+
* at compile time.
1117
*/
12-
const double CONSTRAINT_TOLERANCE = 1E-8;
18+
const double CONSTRAINT_TOLERANCE = STAN_MATH_CONSTRAINT_TOLERANCE;
1319

1420
} // namespace math
1521
} // namespace stan

0 commit comments

Comments
 (0)