| Stan Math Library 2.6.3 probability, sampling & optimization

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerator Friends Macros
length_mvt.hpp
Go to the documentation of this file.
1 #ifndef STAN_MATH_PRIM_SCAL_META_LENGTH_MVT_HPP
2 #define STAN_MATH_PRIM_SCAL_META_LENGTH_MVT_HPP
3
4 #include <stan/math/prim/mat/fun/Eigen.hpp>
5 #include <stdexcept>
6 #include <vector>
7
8 namespace stan {
9
10 // length_mvt() should only be applied to std vector or Eigen matrix
11 template <typename T>
12 size_t length_mvt(const T& ) {
13 throw std::out_of_range("length_mvt passed to an unrecognized type.");
14 return 1U;
15 }
16 template <typename T, int R, int C>
17 size_t length_mvt(const Eigen::Matrix<T, R, C>& ) {
18 return 1U;
19 }
20 template <typename T, int R, int C>
21 size_t length_mvt(const std::vector<Eigen::Matrix<T, R, C> >& x) {
22 return x.size();
23 }
24
25 }
26 #endif
27
stan::length_mvt
size_t length_mvt(const T &)
Definition: length_mvt.hpp:12
stan::math::out_of_range
void out_of_range(const char *function, const int max, const int index, const char *msg1="", const char *msg2="")
Throw an out_of_range exception with a consistently formatted message.
Definition: out_of_range.hpp:30
Eigen.hpp

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