Automatic Differentiation
 
Loading...
Searching...
No Matches
csr_u_to_z.hpp
Go to the documentation of this file.
1#ifndef STAN_MATH_PRIM_FUN_CSR_U_TO_Z
2#define STAN_MATH_PRIM_FUN_CSR_U_TO_Z
3
5#include <stdexcept>
6#include <vector>
7
8namespace stan {
9namespace math {
10
25inline int csr_u_to_z(const std::vector<int>& u, int i) {
26 check_range("csr_u_to_z", "i", u.size(), i + 1, "index out of range");
27 return u[i + 1] - u[i];
28}
29
30} // namespace math
31} // namespace stan
32
33#endif
int csr_u_to_z(const std::vector< int > &u, int i)
Return the z vector computed from the specified u vector at the index for the z vector.
void check_range(const char *function, const char *name, int max, int index, int nested_level, const char *error_msg)
Check if specified index is within range.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...
Definition fvar.hpp:9