Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Francesco Brarda
stan-math-petsc
Commits
9c17e4ba
Commit
9c17e4ba
authored
6 years ago
by
Andrew Johnson
Browse files
Options
Download
Email Patches
Plain Diff
Revert pull to only replace Boost functions not needing error checking
parent
7319007d
No related merge requests found
Changes
153
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
stan/math/fwd/scal.hpp
+0
-1
stan/math/fwd/scal.hpp
stan/math/fwd/scal/fun/gamma_p.hpp
+2
-3
stan/math/fwd/scal/fun/gamma_p.hpp
stan/math/fwd/scal/fun/gamma_q.hpp
+4
-4
stan/math/fwd/scal/fun/gamma_q.hpp
stan/math/fwd/scal/fun/hypot.hpp
+7
-4
stan/math/fwd/scal/fun/hypot.hpp
stan/math/prim/mat/err/check_finite.hpp
+2
-2
stan/math/prim/mat/err/check_finite.hpp
stan/math/prim/mat/fun/cbrt.hpp
+0
-1
stan/math/prim/mat/fun/cbrt.hpp
stan/math/prim/mat/fun/erf.hpp
+0
-1
stan/math/prim/mat/fun/erf.hpp
stan/math/prim/mat/fun/erfc.hpp
+0
-1
stan/math/prim/mat/fun/erfc.hpp
stan/math/prim/mat/fun/expm1.hpp
+0
-1
stan/math/prim/mat/fun/expm1.hpp
stan/math/prim/mat/fun/log_mix.hpp
+2
-2
stan/math/prim/mat/fun/log_mix.hpp
stan/math/prim/mat/fun/tgamma.hpp
+2
-2
stan/math/prim/mat/fun/tgamma.hpp
stan/math/prim/mat/prob/multi_student_t_lpdf.hpp
+1
-2
stan/math/prim/mat/prob/multi_student_t_lpdf.hpp
stan/math/prim/mat/prob/multinomial_lpmf.hpp
+2
-2
stan/math/prim/mat/prob/multinomial_lpmf.hpp
stan/math/prim/mat/prob/ordered_probit_lpmf.hpp
+1
-1
stan/math/prim/mat/prob/ordered_probit_lpmf.hpp
stan/math/prim/scal/err/check_finite.hpp
+3
-3
stan/math/prim/scal/err/check_finite.hpp
stan/math/prim/scal/fun/Phi.hpp
+2
-2
stan/math/prim/scal/fun/Phi.hpp
stan/math/prim/scal/fun/acosh.hpp
+5
-7
stan/math/prim/scal/fun/acosh.hpp
stan/math/prim/scal/fun/asinh.hpp
+2
-10
stan/math/prim/scal/fun/asinh.hpp
stan/math/prim/scal/fun/atanh.hpp
+5
-7
stan/math/prim/scal/fun/atanh.hpp
stan/math/prim/scal/fun/binomial_coefficient_log.hpp
+2
-2
stan/math/prim/scal/fun/binomial_coefficient_log.hpp
with
42 additions
and
58 deletions
+42
-58
stan/math/fwd/scal.hpp
View file @
9c17e4ba
...
...
@@ -54,7 +54,6 @@
#include <stan/math/fwd/scal/fun/is_inf.hpp>
#include <stan/math/fwd/scal/fun/is_nan.hpp>
#include <stan/math/fwd/scal/fun/lbeta.hpp>
#include <stan/math/fwd/scal/fun/ldexp.hpp>
#include <stan/math/fwd/scal/fun/lgamma.hpp>
#include <stan/math/fwd/scal/fun/lmgamma.hpp>
#include <stan/math/fwd/scal/fun/log.hpp>
...
...
This diff is collapsed.
Click to expand it.
stan/math/fwd/scal/fun/gamma_p.hpp
View file @
9c17e4ba
...
...
@@ -6,7 +6,6 @@
#include <stan/math/prim/scal/err/domain_error.hpp>
#include <stan/math/prim/scal/fun/gamma_p.hpp>
#include <stan/math/prim/scal/fun/grad_reg_lower_inc_gamma.hpp>
#include <stan/math/prim/scal/fun/lgamma.hpp>
#include <limits>
namespace
stan
{
...
...
@@ -15,7 +14,7 @@ namespace math {
template
<
typename
T
>
inline
fvar
<
T
>
gamma_p
(
const
fvar
<
T
>
&
x1
,
const
fvar
<
T
>
&
x2
)
{
using
boost
::
math
::
digamma
;
using
st
an
::
math
::
lgamma
;
using
boo
st
::
math
::
lgamma
;
using
std
::
exp
;
using
std
::
fabs
;
using
std
::
log
;
...
...
@@ -61,7 +60,7 @@ inline fvar<T> gamma_p(double x1, const fvar<T> &x2) {
if
(
is_inf
(
x1
))
return
fvar
<
T
>
(
u
,
std
::
numeric_limits
<
double
>::
quiet_NaN
());
T
der2
=
exp
(
-
x2
.
val_
+
(
x1
-
1.0
)
*
log
(
x2
.
val_
)
-
st
an
::
math
::
lgamma
(
x1
));
T
der2
=
exp
(
-
x2
.
val_
+
(
x1
-
1.0
)
*
log
(
x2
.
val_
)
-
boo
st
::
math
::
lgamma
(
x1
));
return
fvar
<
T
>
(
u
,
x2
.
d_
*
der2
);
}
...
...
This diff is collapsed.
Click to expand it.
stan/math/fwd/scal/fun/gamma_q.hpp
View file @
9c17e4ba
...
...
@@ -2,7 +2,7 @@
#define STAN_MATH_FWD_SCAL_FUN_GAMMA_Q_HPP
#include <stan/math/fwd/core.hpp>
#include <stan/math/prim/scal/fun/tgamma.hpp>
#include <stan/math/prim/scal/fun/gamma_q.hpp>
namespace
stan
{
...
...
@@ -11,7 +11,7 @@ namespace math {
template
<
typename
T
>
inline
fvar
<
T
>
gamma_q
(
const
fvar
<
T
>&
x1
,
const
fvar
<
T
>&
x2
)
{
using
boost
::
math
::
digamma
;
using
st
an
::
math
::
tgamma
;
using
boo
st
::
math
::
tgamma
;
using
std
::
exp
;
using
std
::
fabs
;
using
std
::
log
;
...
...
@@ -44,7 +44,7 @@ inline fvar<T> gamma_q(const fvar<T>& x1, const fvar<T>& x2) {
template
<
typename
T
>
inline
fvar
<
T
>
gamma_q
(
const
fvar
<
T
>&
x1
,
double
x2
)
{
using
boost
::
math
::
digamma
;
using
st
an
::
math
::
tgamma
;
using
boo
st
::
math
::
tgamma
;
using
std
::
exp
;
using
std
::
fabs
;
using
std
::
log
;
...
...
@@ -80,7 +80,7 @@ inline fvar<T> gamma_q(double x1, const fvar<T>& x2) {
T
u
=
gamma_q
(
x1
,
x2
.
val_
);
double
g
=
st
an
::
math
::
tgamma
(
x1
);
double
g
=
boo
st
::
math
::
tgamma
(
x1
);
T
der2
=
-
exp
(
-
x2
.
val_
)
*
pow
(
x2
.
val_
,
x1
-
1.0
)
/
g
;
...
...
This diff is collapsed.
Click to expand it.
stan/math/fwd/scal/fun/hypot.hpp
View file @
9c17e4ba
...
...
@@ -23,6 +23,7 @@ namespace math {
*/
template
<
typename
T
>
inline
fvar
<
T
>
hypot
(
const
fvar
<
T
>&
x1
,
const
fvar
<
T
>&
x2
)
{
using
std
::
sqrt
;
T
u
=
hypot
(
x1
.
val_
,
x2
.
val_
);
return
fvar
<
T
>
(
u
,
(
x1
.
d_
*
x1
.
val_
+
x2
.
d_
*
x2
.
val_
)
/
u
);
}
...
...
@@ -40,8 +41,9 @@ inline fvar<T> hypot(const fvar<T>& x1, const fvar<T>& x2) {
* @return Length of hypoteneuse of right triangle with opposite
* and adjacent side lengths x1 and x2.
*/
template
<
typename
T
,
typename
T1
>
inline
fvar
<
T
>
hypot
(
const
fvar
<
T
>&
x1
,
const
T1
&
x2
)
{
template
<
typename
T
>
inline
fvar
<
T
>
hypot
(
const
fvar
<
T
>&
x1
,
double
x2
)
{
using
std
::
sqrt
;
T
u
=
hypot
(
x1
.
val_
,
x2
);
return
fvar
<
T
>
(
u
,
(
x1
.
d_
*
x1
.
val_
)
/
u
);
}
...
...
@@ -59,8 +61,9 @@ inline fvar<T> hypot(const fvar<T>& x1, const T1& x2) {
* @return Length of hypoteneuse of right triangle with opposite
* and adjacent side lengths x1 and x2.
*/
template
<
typename
T
,
typename
T1
>
inline
fvar
<
T
>
hypot
(
const
T1
&
x1
,
const
fvar
<
T
>&
x2
)
{
template
<
typename
T
>
inline
fvar
<
T
>
hypot
(
double
x1
,
const
fvar
<
T
>&
x2
)
{
using
std
::
sqrt
;
T
u
=
hypot
(
x1
,
x2
.
val_
);
return
fvar
<
T
>
(
u
,
(
x2
.
d_
*
x2
.
val_
)
/
u
);
}
...
...
This diff is collapsed.
Click to expand it.
stan/math/prim/mat/err/check_finite.hpp
View file @
9c17e4ba
...
...
@@ -5,7 +5,7 @@
#include <stan/math/prim/scal/err/check_finite.hpp>
#include <stan/math/prim/mat/fun/value_of.hpp>
#include <Eigen/Dense>
#include <
cmath
>
#include <
boost/math/special_functions/fpclassify.hpp
>
namespace
stan
{
namespace
math
{
...
...
@@ -16,7 +16,7 @@ struct finite<Eigen::Matrix<T, R, C>, true> {
const
Eigen
::
Matrix
<
T
,
R
,
C
>&
y
)
{
if
(
!
value_of
(
y
).
allFinite
())
{
for
(
int
n
=
0
;
n
<
y
.
size
();
++
n
)
{
if
(
!
(
std
::
isfinite
)(
value_of_rec
(
stan
::
get
(
y
,
n
)
)))
if
(
!
(
boost
::
math
::
isfinite
)(
y
(
n
)))
domain_error_vec
(
function
,
name
,
y
,
n
,
"is "
,
", but must be finite!"
);
}
...
...
This diff is collapsed.
Click to expand it.
stan/math/prim/mat/fun/cbrt.hpp
View file @
9c17e4ba
...
...
@@ -16,7 +16,6 @@ namespace math {
struct
cbrt_fun
{
template
<
typename
T
>
static
inline
T
fun
(
const
T
&
x
)
{
using
stan
::
math
::
cbrt
;
return
cbrt
(
x
);
}
};
...
...
This diff is collapsed.
Click to expand it.
stan/math/prim/mat/fun/erf.hpp
View file @
9c17e4ba
...
...
@@ -17,7 +17,6 @@ namespace math {
struct
erf_fun
{
template
<
typename
T
>
static
inline
T
fun
(
const
T
&
x
)
{
using
stan
::
math
::
erf
;
return
erf
(
x
);
}
};
...
...
This diff is collapsed.
Click to expand it.
stan/math/prim/mat/fun/erfc.hpp
View file @
9c17e4ba
...
...
@@ -16,7 +16,6 @@ namespace math {
struct
erfc_fun
{
template
<
typename
T
>
static
inline
T
fun
(
const
T
&
x
)
{
using
stan
::
math
::
erfc
;
return
erfc
(
x
);
}
};
...
...
This diff is collapsed.
Click to expand it.
stan/math/prim/mat/fun/expm1.hpp
View file @
9c17e4ba
...
...
@@ -16,7 +16,6 @@ namespace math {
struct
expm1_fun
{
template
<
typename
T
>
static
inline
T
fun
(
const
T
&
x
)
{
using
stan
::
math
::
expm1
;
return
expm1
(
x
);
}
};
...
...
This diff is collapsed.
Click to expand it.
stan/math/prim/mat/fun/log_mix.hpp
View file @
9c17e4ba
#ifndef STAN_MATH_PRIM_MAT_FUN_LOG_MIX_HPP
#define STAN_MATH_PRIM_MAT_FUN_LOG_MIX_HPP
#include <stan/math/prim/arr/meta/get.hpp>
#include <stan/math/prim/arr/meta/length.hpp>
#include <stan/math/prim/mat/meta/is_vector.hpp>
#include <stan/math/prim/mat/meta/get.hpp>
#include <stan/math/prim/mat/meta/length.hpp>
...
...
@@ -12,6 +10,8 @@
#include <stan/math/prim/mat/meta/vector_seq_view.hpp>
#include <stan/math/prim/mat/meta/broadcast_array.hpp>
#include <stan/math/prim/mat/meta/operands_and_partials.hpp>
#include <stan/math/prim/arr/meta/get.hpp>
#include <stan/math/prim/arr/meta/length.hpp>
#include <stan/math/prim/scal/err/check_bounded.hpp>
#include <stan/math/prim/scal/err/check_not_nan.hpp>
#include <stan/math/prim/scal/err/check_consistent_sizes.hpp>
...
...
This diff is collapsed.
Click to expand it.
stan/math/prim/mat/fun/tgamma.hpp
View file @
9c17e4ba
...
...
@@ -2,7 +2,7 @@
#define STAN_MATH_PRIM_MAT_FUN_TGAMMA_HPP
#include <stan/math/prim/mat/vectorize/apply_scalar_unary.hpp>
#include <st
an
/math/
prim/sc
al
/
fun/
t
gamma.hpp>
#include <
boo
st/math/
speci
al
_
fun
ctions
/gamma.hpp>
namespace
stan
{
namespace
math
{
...
...
@@ -17,7 +17,7 @@ namespace math {
struct
tgamma_fun
{
template
<
typename
T
>
static
inline
T
fun
(
const
T
&
x
)
{
using
st
an
::
math
::
tgamma
;
using
boo
st
::
math
::
tgamma
;
return
tgamma
(
x
);
}
};
...
...
This diff is collapsed.
Click to expand it.
stan/math/prim/mat/prob/multi_student_t_lpdf.hpp
View file @
9c17e4ba
...
...
@@ -15,7 +15,6 @@
#include <stan/math/prim/scal/fun/constants.hpp>
#include <stan/math/prim/scal/fun/is_inf.hpp>
#include <stan/math/prim/scal/fun/log1p.hpp>
#include <stan/math/prim/scal/fun/lgamma.hpp>
#include <stan/math/prim/scal/meta/include_summand.hpp>
#include <boost/math/special_functions/gamma.hpp>
#include <boost/random/variate_generator.hpp>
...
...
@@ -37,7 +36,7 @@ typename return_type<T_y, T_dof, T_loc, T_scale>::type multi_student_t_lpdf(
const
T_y
&
y
,
const
T_dof
&
nu
,
const
T_loc
&
mu
,
const
T_scale
&
Sigma
)
{
static
const
char
*
function
=
"multi_student_t"
;
using
st
an
::
math
::
lgamma
;
using
boo
st
::
math
::
lgamma
;
using
std
::
log
;
typedef
typename
scalar_type
<
T_scale
>::
type
T_scale_elem
;
...
...
This diff is collapsed.
Click to expand it.
stan/math/prim/mat/prob/multinomial_lpmf.hpp
View file @
9c17e4ba
#ifndef STAN_MATH_PRIM_MAT_PROB_MULTINOMIAL_LPMF_HPP
#define STAN_MATH_PRIM_MAT_PROB_MULTINOMIAL_LPMF_HPP
#include <boost/math/special_functions/gamma.hpp>
#include <boost/random/uniform_01.hpp>
#include <boost/random/variate_generator.hpp>
#include <stan/math/prim/mat/err/check_simplex.hpp>
...
...
@@ -9,7 +10,6 @@
#include <stan/math/prim/scal/err/check_positive.hpp>
#include <stan/math/prim/scal/fun/multiply_log.hpp>
#include <stan/math/prim/scal/fun/constants.hpp>
#include <stan/math/prim/scal/fun/lgamma.hpp>
#include <stan/math/prim/scal/meta/include_summand.hpp>
#include <vector>
...
...
@@ -23,8 +23,8 @@ typename boost::math::tools::promote_args<T_prob>::type multinomial_lpmf(
const
Eigen
::
Matrix
<
T_prob
,
Eigen
::
Dynamic
,
1
>&
theta
)
{
static
const
char
*
function
=
"multinomial_lpmf"
;
using
boost
::
math
::
lgamma
;
using
boost
::
math
::
tools
::
promote_args
;
using
stan
::
math
::
lgamma
;
typename
promote_args
<
T_prob
>::
type
lp
(
0.0
);
check_nonnegative
(
function
,
"Number of trials variable"
,
ns
);
...
...
This diff is collapsed.
Click to expand it.
stan/math/prim/mat/prob/ordered_probit_lpmf.hpp
View file @
9c17e4ba
...
...
@@ -186,10 +186,10 @@ typename return_type<T_loc, T_cut>::type ordered_probit_lpmf(
check_bounded
(
function
,
"Random variable"
,
y
[
i
],
1
,
K
);
check_greater
(
function
,
"Size of cut points parameter"
,
c
[
i
].
size
(),
0
);
check_ordered
(
function
,
"Cut-points"
,
c
[
i
]);
check_finite
(
function
,
"Cut-points"
,
c
[
i
]);
}
check_finite
(
function
,
"Location parameter"
,
lambda
);
check_finite
(
function
,
"Cut-points"
,
c
);
typename
return_type
<
T_loc
,
T_cut
>::
type
logp_n
(
0.0
);
...
...
This diff is collapsed.
Click to expand it.
stan/math/prim/scal/err/check_finite.hpp
View file @
9c17e4ba
...
...
@@ -6,7 +6,7 @@
#include <stan/math/prim/scal/meta/length.hpp>
#include <stan/math/prim/scal/meta/is_vector_like.hpp>
#include <stan/math/prim/scal/fun/value_of_rec.hpp>
#include <
cmath
>
#include <
boost/math/special_functions/fpclassify.hpp
>
namespace
stan
{
namespace
math
{
...
...
@@ -15,7 +15,7 @@ namespace {
template
<
typename
T_y
,
bool
is_vec
>
struct
finite
{
static
void
check
(
const
char
*
function
,
const
char
*
name
,
const
T_y
&
y
)
{
if
(
!
(
std
::
isfinite
)(
value_of_rec
(
y
)))
if
(
!
(
boost
::
math
::
isfinite
)(
value_of_rec
(
y
)))
domain_error
(
function
,
name
,
y
,
"is "
,
", but must be finite!"
);
}
};
...
...
@@ -25,7 +25,7 @@ struct finite<T_y, true> {
static
void
check
(
const
char
*
function
,
const
char
*
name
,
const
T_y
&
y
)
{
using
stan
::
length
;
for
(
size_t
n
=
0
;
n
<
length
(
y
);
n
++
)
{
if
(
!
(
std
::
isfinite
)(
value_of_rec
(
stan
::
get
(
y
,
n
))))
if
(
!
(
boost
::
math
::
isfinite
)(
value_of_rec
(
stan
::
get
(
y
,
n
))))
domain_error_vec
(
function
,
name
,
y
,
n
,
"is "
,
", but must be finite!"
);
}
}
...
...
This diff is collapsed.
Click to expand it.
stan/math/prim/scal/fun/Phi.hpp
View file @
9c17e4ba
...
...
@@ -31,11 +31,11 @@ inline double Phi(double x) {
if
(
x
<
-
37.5
)
return
0
;
else
if
(
x
<
-
5.0
)
return
0.5
*
stan
::
math
::
erfc
(
-
INV_SQRT_2
*
x
);
return
0.5
*
erfc
(
-
INV_SQRT_2
*
x
);
else
if
(
x
>
8.25
)
return
1
;
else
return
0.5
*
(
1.0
+
stan
::
math
::
erf
(
INV_SQRT_2
*
x
));
return
0.5
*
(
1.0
+
erf
(
INV_SQRT_2
*
x
));
}
}
// namespace math
...
...
This diff is collapsed.
Click to expand it.
stan/math/prim/scal/fun/acosh.hpp
View file @
9c17e4ba
...
...
@@ -4,8 +4,8 @@
#include <stan/math/prim/scal/fun/constants.hpp>
#include <stan/math/prim/scal/fun/is_nan.hpp>
#include <stan/math/prim/scal/meta/likely.hpp>
#include <stan/math/prim/scal/
err/check_greater_or_equal
.hpp>
#include <
cmath
>
#include <stan/math/prim/scal/
fun/boost_policy
.hpp>
#include <
boost/math/special_functions/acosh.hpp
>
namespace
stan
{
namespace
math
{
...
...
@@ -19,12 +19,10 @@ namespace math {
* @throw std::domain_error If argument is less than 1.
*/
inline
double
acosh
(
double
x
)
{
if
(
unlikely
(
is_nan
(
x
)))
{
if
(
unlikely
(
is_nan
(
x
)))
return
x
;
}
else
{
check_greater_or_equal
(
"acosh"
,
"x"
,
x
,
1.0
);
return
std
::
acosh
(
x
);
}
else
return
boost
::
math
::
acosh
(
x
,
boost_policy_t
());
}
/**
...
...
This diff is collapsed.
Click to expand it.
stan/math/prim/scal/fun/asinh.hpp
View file @
9c17e4ba
#ifndef STAN_MATH_PRIM_SCAL_FUN_ASINH_HPP
#define STAN_MATH_PRIM_SCAL_FUN_ASINH_HPP
#include <stan/math/prim/scal/fun/constants.hpp>
#include <stan/math/prim/scal/fun/is_nan.hpp>
#include <stan/math/prim/scal/meta/likely.hpp>
#include <cmath>
namespace
stan
{
...
...
@@ -18,12 +15,7 @@ namespace math {
* @param[in] x Argument.
* @return Inverse hyperbolic sine of the argument.
*/
inline
double
asinh
(
double
x
)
{
if
(
unlikely
(
is_nan
(
x
)))
return
x
;
else
return
std
::
asinh
(
x
);
}
inline
double
asinh
(
double
x
)
{
return
std
::
asinh
(
x
);
}
/**
* Integer version of asinh.
...
...
@@ -31,7 +23,7 @@ inline double asinh(double x) {
* @param[in] x Argument.
* @return Inverse hyperbolic sine of the argument.
*/
inline
double
asinh
(
int
x
)
{
return
asinh
(
static_cast
<
double
>
(
x
)
);
}
inline
double
asinh
(
int
x
)
{
return
std
::
asinh
(
x
);
}
}
// namespace math
}
// namespace stan
...
...
This diff is collapsed.
Click to expand it.
stan/math/prim/scal/fun/atanh.hpp
View file @
9c17e4ba
...
...
@@ -4,8 +4,8 @@
#include <stan/math/prim/scal/fun/constants.hpp>
#include <stan/math/prim/scal/fun/is_nan.hpp>
#include <stan/math/prim/scal/meta/likely.hpp>
#include <stan/math/prim/scal/
err/check_bounded
.hpp>
#include <
cmath
>
#include <stan/math/prim/scal/
fun/boost_policy
.hpp>
#include <
boost/math/special_functions/atanh.hpp
>
namespace
stan
{
namespace
math
{
...
...
@@ -21,12 +21,10 @@ namespace math {
* @throw std::domain_error If argument is not in [-1, 1].
*/
inline
double
atanh
(
double
x
)
{
if
(
unlikely
(
is_nan
(
x
)))
{
if
(
unlikely
(
is_nan
(
x
)))
return
x
;
}
else
{
check_bounded
(
"atanh"
,
"x"
,
x
,
-
1.0
,
1.0
);
return
std
::
atanh
(
x
);
}
else
return
boost
::
math
::
atanh
(
x
,
boost_policy_t
());
}
/**
...
...
This diff is collapsed.
Click to expand it.
stan/math/prim/scal/fun/binomial_coefficient_log.hpp
View file @
9c17e4ba
#ifndef STAN_MATH_PRIM_SCAL_FUN_BINOMIAL_COEFFICIENT_LOG_HPP
#define STAN_MATH_PRIM_SCAL_FUN_BINOMIAL_COEFFICIENT_LOG_HPP
#include <st
an
/math/
prim/sc
al
/
fun/
l
gamma.hpp>
#include <
boo
st/math/
speci
al
_
fun
ctions
/gamma.hpp>
#include <boost/math/tools/promotion.hpp>
namespace
stan
{
...
...
@@ -59,7 +59,7 @@ namespace math {
template
<
typename
T_N
,
typename
T_n
>
inline
typename
boost
::
math
::
tools
::
promote_args
<
T_N
,
T_n
>::
type
binomial_coefficient_log
(
const
T_N
N
,
const
T_n
n
)
{
using
st
an
::
math
::
lgamma
;
using
boo
st
::
math
::
lgamma
;
using
std
::
log
;
const
double
CUTOFF
=
1000
;
if
(
N
-
n
<
CUTOFF
)
{
...
...
This diff is collapsed.
Click to expand it.
Prev
1
2
3
4
5
…
8
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help