NumCpp  2.7.0
A Templatized Header Only C++ Implementation of the Python NumPy Library
shuffle.hpp
Go to the documentation of this file.
1 #pragma once
30 
31 #include "NumCpp/NdArray.hpp"
33 
34 #include <algorithm>
35 
36 namespace nc
37 {
38  namespace random
39  {
40  //============================================================================
41  // Method Description:
46  template<typename dtype>
47  void shuffle(NdArray<dtype>& inArray)
48  {
49  std::shuffle(inArray.begin(), inArray.end(), generator_);
50  }
51  } // namespace random
52 } // namespace nc
Holds 1D and 2D arrays, the main work horse of the NumCpp library.
Definition: NdArrayCore.hpp:72
iterator end() noexcept
Definition: NdArrayCore.hpp:1474
iterator begin() noexcept
Definition: NdArrayCore.hpp:1166
static std::mt19937_64 generator_
generator function
Definition: generator.hpp:39
void shuffle(NdArray< dtype > &inArray)
Definition: shuffle.hpp:47
Definition: Coordinate.hpp:45