fun7_eml_rand_mt19937ar_stateful.cpp 708 B

1234567891011121314151617181920212223242526272829303132333435
  1. //
  2. // File: eml_rand_mt19937ar_stateful.cpp
  3. //
  4. // MATLAB Coder version : 5.2
  5. // C/C++ source code generated on : 04-Mar-2023 17:44:30
  6. //
  7. // Include Files
  8. #include "fun7_eml_rand_mt19937ar_stateful.h"
  9. #include "fun7_DRFMRF_data.h"
  10. #include <cstring>
  11. // Function Definitions
  12. //
  13. // Arguments : void
  14. // Return Type : void
  15. //
  16. void eml_rand_mt19937ar_stateful_init()
  17. {
  18. unsigned int r;
  19. std::memset(&state[0], 0, 625U * sizeof(unsigned int));
  20. r = 5489U;
  21. state[0] = 5489U;
  22. for (int mti{0}; mti < 623; mti++) {
  23. r = ((r ^ r >> 30U) * 1812433253U + mti) + 1U;
  24. state[mti + 1] = r;
  25. }
  26. state[624] = 624U;
  27. }
  28. //
  29. // File trailer for eml_rand_mt19937ar_stateful.cpp
  30. //
  31. // [EOF]
  32. //