From 5b2f8231945fedc46425e00f1234dcac90628c1d Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 9 Jul 2015 14:48:31 +0100 Subject: add a SAL_RAND_REPEATABLE for repeatable random nums merge the formula and comphelper ones together Change-Id: I2e7e2cdb176afc6982e384fa1e007da5b914e6f0 --- sc/source/core/opencl/formulagroupcl.cxx | 4 ++-- sc/source/core/tool/interpr1.cxx | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'sc') diff --git a/sc/source/core/opencl/formulagroupcl.cxx b/sc/source/core/opencl/formulagroupcl.cxx index 98c95e7cad99..ed03cce25350 100644 --- a/sc/source/core/opencl/formulagroupcl.cxx +++ b/sc/source/core/opencl/formulagroupcl.cxx @@ -16,7 +16,7 @@ #include "tokenarray.hxx" #include "compiler.hxx" #include "interpre.hxx" -#include +#include #include #include "scmatrix.hxx" @@ -738,7 +738,7 @@ threefry2x32 (threefry2x32_ctr_t in, threefry2x32_key_t k)\n\ /// Create buffer and pass the buffer to a given kernel virtual size_t Marshal( cl_kernel k, int argno, int, cl_program ) SAL_OVERRIDE { - cl_int seed = formula::rng::nRandom(0, SAL_MAX_INT32); + cl_int seed = comphelper::rng::uniform_int_distribution(0, SAL_MAX_INT32); // Pass the scalar result back to the rest of the formula kernel SAL_INFO("sc.opencl", "Kernel " << k << " arg " << argno << ": cl_int: " << seed); cl_int err = clSetKernelArg(k, argno, sizeof(cl_int), static_cast(&seed)); diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx index e1dfd2afa93d..78922695f522 100644 --- a/sc/source/core/tool/interpr1.cxx +++ b/sc/source/core/tool/interpr1.cxx @@ -22,7 +22,6 @@ #include "scitems.hxx" #include #include -#include #include #include #include @@ -1653,7 +1652,7 @@ void ScInterpreter::ScPi() void ScInterpreter::ScRandom() { - PushDouble(formula::rng::fRandom(0, 1)); + PushDouble(::comphelper::rng::uniform_real_distribution()); } void ScInterpreter::ScTrue() -- cgit v1.2.3