Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
stan
math
fwd
scal
fun
round.hpp
Go to the documentation of this file.
1
#ifndef STAN_MATH_FWD_SCAL_FUN_ROUND_HPP
2
#define STAN_MATH_FWD_SCAL_FUN_ROUND_HPP
3
4
#include <
stan/math/fwd/core.hpp
>
5
#include <
stan/math/prim/scal/fun/is_nan.hpp
>
6
#include <
stan/math/prim/scal/fun/round.hpp
>
7
#include <limits>
8
9
namespace
stan
{
10
namespace
math
{
11
12
/**
13
* Return the closest integer to the specified argument, with
14
* halfway cases rounded away from zero.
15
*
16
* The derivative is always zero.
17
*
18
* @tparam T Scalar type for autodiff variable.
19
* @param x Argument.
20
* @return The rounded value of the argument.
21
*/
22
template
<
typename
T>
23
inline
fvar<T>
round
(
const
fvar<T>
&
x
) {
24
return
fvar<T>
(
round
(x.
val_
),
is_nan
(x.
val_
)
25
? std::numeric_limits<double>::quiet_NaN()
26
: 0.0);
27
}
28
29
}
// namespace math
30
}
// namespace stan
31
#endif
core.hpp
is_nan.hpp
stan
Definition:
StanTypedefs.h:9
stan::math::round
fvar< T > round(const fvar< T > &x)
Definition:
round.hpp:23
submit_syst.x
x
Definition:
submit_syst.py:249
stan::math::fvar::val_
T val_
Definition:
fvar.hpp:46
math
round.hpp
stan::math::is_nan
int is_nan(const fvar< T > &x)
Definition:
is_nan.hpp:19
stan::math::fvar
Definition:
fvar.hpp:42
Generated on Sat Jan 23 2021 14:14:34 for NOvA by
1.8.11