1 #ifndef STAN_MATH_PRIM_MAT_FUN_RANK_HPP 2 #define STAN_MATH_PRIM_MAT_FUN_RANK_HPP 21 inline int rank(
const std::vector<T> & v,
int s) {
22 int size =
static_cast<int>(v.size());
27 for (
int i = 0; i <
size; ++i)
42 template <
typename T,
int R,
int C>
43 inline int rank(
const Eigen::Matrix<T, R, C> & v,
int s) {
47 const T * vv = v.data();
50 for (
int i = 0; i <
size; ++i)
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.
int rank(const std::vector< T > &v, int s)
Return the number of components of v less than v[s].
int size(const std::vector< T > &x)
Return the size of the specified standard vector.