All Classes Namespaces Files Functions Variables Typedefs Enumerator Friends Macros Groups
ceil.hpp
Go to the documentation of this file.
#ifndef STAN_MATH_REV_SCAL_FUN_CEIL_HPP
#define STAN_MATH_REV_SCAL_FUN_CEIL_HPP
#include <stan/math/rev/core.hpp>
#include <stan/math/prim/scal/meta/likely.hpp>
#include <boost/math/special_functions/fpclassify.hpp>
#include <cmath>
#include <limits>
namespace stan {
namespace math {
namespace {
class ceil_vari : public op_v_vari {
public:
explicit ceil_vari(vari* avi) :
op_v_vari(std::ceil(avi->val_), avi) {
}
void chain() {
if (unlikely(boost::math::isnan(avi_->val_)))
avi_->adj_ = std::numeric_limits<double>::quiet_NaN();
}
};
}
inline var ceil(const var& a) {
return var(new ceil_vari(a.vi_));
}
}
}
#endif
core.hpp
stan::math::var
Independent (input) and dependent (output) variables for gradients.
Definition: var.hpp:32
boost::math::isnan
bool isnan(const stan::math::var &v)
Checks if the given number is NaN.
Definition: boost_isnan.hpp:22
unlikely
#define unlikely(x)
Definition: likely.hpp:9
stan::math::var::vi_
vari * vi_
Pointer to the implementation of this variable.
Definition: var.hpp:44
likely.hpp
stan::math::ceil
fvar< T > ceil(const fvar< T > &x)
Definition: ceil.hpp:11

[ Stan Home Page ] © 2011–2015, Stan Development Team.