Loading [MathJax]/extensions/TeX/AMSmath.js
Automatic Differentiation
 
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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 ScalarT, require_stan_scalar_t<ScalarT>* = nullptr>
30int64_t size_mvt(const std::vector<ScalarT>& /* unused */) {
31 return 1;
32}
33
34template <typename MatrixT, require_matrix_t<MatrixT>* = nullptr>
35int64_t size_mvt(const MatrixT& /* unused */) {
36 return 1;
37}
38
39template <typename MatrixT, require_matrix_t<MatrixT>* = nullptr>
40int64_t size_mvt(const std::vector<MatrixT>& x) {
41 return x.size();
42}
43
44template <typename StdVectorT, require_std_vector_t<StdVectorT>* = nullptr>
45int64_t size_mvt(const std::vector<StdVectorT>& x) {
46 return x.size();
47}
48
49} // namespace math
50} // namespace stan
51#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 ...