derivative.hpp
Go to the documentation of this file.
#ifndef STAN_MATH_MIX_MAT_FUNCTOR_DERIVATIVE_HPP
#define STAN_MATH_MIX_MAT_FUNCTOR_DERIVATIVE_HPP
#include <stan/math/fwd/core.hpp>
#include <stan/math/prim/mat/fun/Eigen.hpp>
#include <stan/math/rev/core.hpp>
#include <vector>
namespace stan {
namespace math {
template <typename T, typename F>
void
derivative(const F& f,
const T& x,
T& fx,
T& dfx_dx) {
fvar<T> x_fvar = fvar<T>(x, 1.0);
fvar<T> fx_fvar = f(x_fvar);
fx = fx_fvar.val_;
dfx_dx = fx_fvar.d_;
}
}
}
#endif
core.hpp
core.hpp
stan::math::fvar::d_
T d_
Definition: fvar.hpp:16
stan
Definition: log_sum_exp.hpp:8
stan::math::fvar::val_
T val_
Definition: fvar.hpp:15
stan::math::derivative
void derivative(const F &f, const T &x, T &fx, T &dfx_dx)
Return the derivative of the specified univariate function at the specified argument.
Definition: derivative.hpp:25
Eigen.hpp
stan::math::fvar
Definition: fvar.hpp:14

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