Stan Math Library
4.9.0
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
4
#include <
stan/math/prim/err.hpp
>
5
#include <stdexcept>
6
#include <vector>
7
8
namespace
stan
{
9
namespace
math {
10
25
inline
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
stan::math::csr_u_to_z
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.
Definition
csr_u_to_z.hpp:25
stan::math::check_range
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.
Definition
check_range.hpp:24
stan
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...
Definition
unit_vector_constrain.hpp:15
err.hpp
stan
math
prim
fun
csr_u_to_z.hpp
[
Stan Home Page
]
© 2011–2019, Stan Development Team.