1 #ifndef STAN__MATH__MATRIX__RANK_HPP
2 #define STAN__MATH__MATRIX__RANK_HPP
18 inline size_t rank(
const std::vector<T> & v,
int s) {
19 size_t size = v.size();
24 for (
size_t i = 0U; i <
size; ++i)
25 if (v[i]<compare) count++;
35 template <
typename T,
int R,
int C>
36 inline size_t rank(
const Eigen::Matrix<T,R,C> & v,
int s) {
37 size_t size = v.size();
40 const T * vv = v.data();
43 for (
size_t i = 0U; i <
size; ++i)
44 if (vv[i]<compare) count++;
int size(const std::vector< T > &x)
void check_range(size_t max, size_t i, const char *msg, size_t idx)
size_t rank(const std::vector< T > &v, int s)
Return the number of components of v less than v[s].