All Classes Namespaces Files Functions Variables Typedefs Enumerator Friends Macros Groups
length_mvt.hpp
Go to the documentation of this file.
#ifndef STAN_MATH_PRIM_SCAL_META_LENGTH_MVT_HPP
#define STAN_MATH_PRIM_SCAL_META_LENGTH_MVT_HPP
#include <stan/math/prim/mat/fun/Eigen.hpp>
#include <stdexcept>
#include <vector>
namespace stan {
// length_mvt() should only be applied to std vector or Eigen matrix
template <typename T>
size_t length_mvt(const T& ) {
throw std::out_of_range("length_mvt passed to an unrecognized type.");
return 1U;
}
template <typename T, int R, int C>
size_t length_mvt(const Eigen::Matrix<T, R, C>& ) {
return 1U;
}
template <typename T, int R, int C>
size_t length_mvt(const std::vector<Eigen::Matrix<T, R, C> >& x) {
return x.size();
}
}
#endif
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.