| Server IP : 217.160.0.212 / Your IP : 216.73.216.141 Web Server : Apache System : Linux www 6.18.51-i1-ampere #1196 SMP Fri Sep 11 20:43:55 CEST 2026 aarch64 User : sws1073854427 ( 1073854427) PHP Version : 8.4.23 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /lib/python3/dist-packages/pythran/pythonic/include/numpy/random/ |
Upload File : |
#ifndef PYTHONIC_INCLUDE_NUMPY_RANDOM_CHOICE_HPP
#define PYTHONIC_INCLUDE_NUMPY_RANDOM_CHOICE_HPP
#include "pythonic/include/utils/functor.hpp"
#include "pythonic/include/numpy/random/randint.hpp"
#include "pythonic/include/types/ndarray.hpp"
#include "pythonic/include/types/tuple.hpp"
PYTHONIC_NS_BEGIN
namespace numpy
{
namespace random
{
template <class pS, class P>
types::ndarray<long, pS> choice(long max, pS const &shape, bool replace,
P const &p);
template <class P>
types::ndarray<long, types::pshape<long>> choice(long max, long size,
bool replace, P &&p);
template <class T>
auto choice(long max, T &&size)
-> decltype(randint(0, max, std::forward<T>(size)));
long choice(long max);
template <class T>
typename T::dtype choice(T const &a);
template <class T, class pS>
types::ndarray<typename T::dtype, pS> choice(T const &a, pS const &shape);
template <class T>
types::ndarray<typename T::dtype, types::pshape<long>> choice(T &&a,
long size);
template <class T, class pS, class P>
types::ndarray<typename T::dtype, pS> choice(T const &a, pS const &shape,
bool replace, P const &p);
template <class T, class P>
types::ndarray<typename T::dtype, types::pshape<long>>
choice(T &&a, long size, bool replace, P &&p);
DEFINE_FUNCTOR(pythonic::numpy::random, choice);
}
}
PYTHONIC_NS_END
#endif