rng_state.cpp 935 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /******************************************************************************
  2. *
  3. * Copyright (C) 2020 by
  4. * The Salk Institute for Biological Studies
  5. *
  6. * Use of this source code is governed by an MIT-style
  7. * license that can be found in the LICENSE file or at
  8. * https://opensource.org/licenses/MIT.
  9. *
  10. ******************************************************************************/
  11. #include "api/rng_state.h"
  12. #include "rng.h"
  13. using namespace std;
  14. namespace MCell {
  15. namespace API {
  16. RngState::RngState(const rng_state& rng) {
  17. assert(RNG_SIZE == RANDSIZ);
  18. randcnt = rng.randcnt;
  19. aa = rng.aa;
  20. bb = rng.bb;
  21. cc = rng.cc;
  22. cc = rng.cc;
  23. std::copy(&rng.randrsl[0], &rng.randrsl[RANDSIZ], std::back_inserter(randslr));
  24. std::copy(&rng.mm[0], &rng.mm[RANDSIZ], std::back_inserter(mm));
  25. rngblocks = rng.rngblocks; // counter for simulation stats, does not affect simulation
  26. }
  27. } // namespace API
  28. } // namespace MCell