Automatic Differentiation
 
Loading...
Searching...
No Matches
size_mvt.hpp
Go to the documentation of this file.
1#ifndef STAN_MATH_PRIM_FUN_SIZE_MVT_HPP
2#define STAN_MATH_PRIM_FUN_SIZE_MVT_HPP
3
6#include <stdexcept>
7#include <vector>
8
9namespace stan {
10namespace math {
11
23template <typename ScalarT, require_stan_scalar_t<ScalarT>* = nullptr>
24size_t size_mvt(const ScalarT& /* unused */) {
25 throw std::invalid_argument("size_mvt passed to an unrecognized type.");
26}
27
28template <typename MatrixT, require_matrix_t<MatrixT>* = nullptr>
29size_t size_mvt(const MatrixT& /* unused */) {
30 return 1U;
31}
32
33template <typename MatrixT, require_matrix_t<MatrixT>* = nullptr>
34size_t size_mvt(const std::vector<MatrixT>& x) {
35 return x.size();
36}
37
38} // namespace math
39} // namespace stan
40#endif
size_t size_mvt(const ScalarT &)
Provides the size of a multivariate argument.
Definition size_mvt.hpp:24
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...
Definition fvar.hpp:9