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 <cstdint>
7#include <stdexcept>
8#include <vector>
9
10namespace stan {
11namespace math {
12
24template <typename ScalarT, require_stan_scalar_t<ScalarT>* = nullptr>
25int64_t size_mvt(const ScalarT& /* unused */) {
26 throw std::invalid_argument("size_mvt passed to an unrecognized type.");
27}
28
29template <typename MatrixT, require_matrix_t<MatrixT>* = nullptr>
30int64_t size_mvt(const MatrixT& /* unused */) {
31 return 1;
32}
33
34template <typename MatrixT, require_matrix_t<MatrixT>* = nullptr>
35int64_t size_mvt(const std::vector<MatrixT>& x) {
36 return x.size();
37}
38
39} // namespace math
40} // namespace stan
41#endif
int64_t size_mvt(const ScalarT &)
Provides the size of a multivariate argument.
Definition size_mvt.hpp:25
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...