All Classes Namespaces Files Functions Variables Typedefs Enumerator Friends Macros
sort_asc.hpp
Go to the documentation of this file.
#ifndef STAN_MATH_REV_MAT_FUN_SORT_ASC_HPP
#define STAN_MATH_REV_MAT_FUN_SORT_ASC_HPP
#include <stan/math/rev/core.hpp>
#include <stan/math/prim/mat/fun/Eigen.hpp>
#include <algorithm> // std::sort
#include <functional> // std::greater
#include <valarray>
#include <vector>
namespace stan {
namespace math {
inline std::vector<var> sort_asc(std::vector<var> xs) {
std::sort(xs.begin(), xs.end());
return xs;
}
template <int R, int C>
inline typename Eigen::Matrix<var, R, C>
sort_asc(Eigen::Matrix<var, R, C> xs) {
std::sort(xs.data(), xs.data()+xs.size());
return xs;
}
}
}
#endif
core.hpp
Eigen.hpp
stan::math::sort_asc
std::vector< fvar< T > > sort_asc(std::vector< fvar< T > > xs)
Definition: sort_asc.hpp:17

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