escript  Revision_
Random.h
Go to the documentation of this file.
1 /*****************************************************************************
2 *
3 * Copyright (c) 2013-2018 by The University of Queensland
4 * http://www.uq.edu.au
5 *
6 * Primary Business: Queensland, Australia
7 * Licensed under the Apache License, version 2.0
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Development until 2012 by Earth Systems Science Computational Center (ESSCC)
11 * Development 2012-2013 by School of Earth Sciences
12 * Development from 2014-2017 by Centre for Geoscience Computing (GeoComp)
13 * Development from 2019 by School of Earth and Environmental Sciences
14 **
15 *****************************************************************************/
16 
17 #ifndef __ESCRIPT_RANDOM_H__
18 #define __ESCRIPT_RANDOM_H__
19 
20 #include "system_dep.h"
21 
22 namespace escript
23 {
24 /* \brief put n random doubles (from [0.0, 1.0]) in array (uses OpenMP).
25  If using this on Data, then be sure to CHECK_EX_WRITE first
26 */
28 void randomFillArray(long seed, double* array, size_t n);
29 
30 
32 void patternFillArray2D(size_t x, size_t y, double* array, size_t spacing,
33  size_t basex, size_t basey, size_t numpoints);
34 
35 // Intended for debugging use only
36 void patternFillArray(int pattern, size_t x, size_t y, size_t z, double* array,
37  size_t spacing, size_t basex, size_t basey, size_t basez,
38  size_t numpoints);
39 
40 }
41 
42 #endif // __ESCRIPT_RANDOM_H__
43 
#define ESCRIPT_DLL_API
Definition: escriptcore/src/system_dep.h:30
Definition: AbstractContinuousDomain.cpp:23
void randomFillArray(long seed, double *array, size_t n)
Definition: Random.cpp:79
void patternFillArray(int pattern, size_t x, size_t y, size_t z, double *array, size_t spacing, size_t basex, size_t basey, size_t basez, size_t numpoints)
Definition: Random.cpp:168
void patternFillArray2D(size_t x, size_t y, double *array, size_t spacing, size_t basex, size_t basey, size_t numpoints)
Definition: Random.cpp:138