Stan Math Library  2.20.0
reverse mode automatic differentiation
sort_asc.hpp
Go to the documentation of this file.
1 #ifndef STAN_MATH_PRIM_ARR_FUN_SORT_ASC_HPP
2 #define STAN_MATH_PRIM_ARR_FUN_SORT_ASC_HPP
3 
6 #include <algorithm>
7 #include <vector>
8 
9 namespace stan {
10 namespace math {
11 
20 template <typename T>
21 inline std::vector<T> sort_asc(std::vector<T> xs) {
22  check_not_nan("sort_asc", "container argument", xs);
23  std::sort(xs.begin(), xs.end());
24  return xs;
25 }
26 
27 } // namespace math
28 } // namespace stan
29 #endif
void check_not_nan(const char *function, const char *name, const T_y &y)
Check if y is not NaN.
std::vector< T > sort_asc(std::vector< T > xs)
Return the specified standard vector in ascending order.
Definition: sort_asc.hpp:21

     [ Stan Home Page ] © 2011–2018, Stan Development Team.