Stan Math Library  2.20.0
reverse mode automatic differentiation
as_scalar.hpp
Go to the documentation of this file.
1 #ifndef STAN_MATH_PRIM_MAT_FUN_AS_SCALAR_HPP
2 #define STAN_MATH_PRIM_MAT_FUN_AS_SCALAR_HPP
3 
5 #include <stdexcept>
6 
7 namespace stan {
8 namespace math {
9 
20 template <typename Derived>
21 inline double as_scalar(const Eigen::DenseBase<Derived>& a) {
22  throw std::runtime_error("A matrix can not be used as a scalar!");
23 }
24 
25 } // namespace math
26 } // namespace stan
27 
28 #endif
double as_scalar(const std::vector< T > &a)
Converts input to a scalar.
Definition: as_scalar.hpp:20

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