CR2RE Pipeline Reference Manual 1.6.8
hdrl_random.h
1/*
2 * This file is part of the HDRL
3 * Copyright (C) 2016 European Southern Observatory
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19
20#ifndef HDRL_RANDOM_H
21#define HDRL_RANDOM_H
22
23#include <cpl.h>
24#include <stdint.h>
25
26CPL_BEGIN_DECLS
27
28/*-----------------------------------------------------------------------------
29 Experimental declarations - can be used, but no guarantees on api stability
30 -----------------------------------------------------------------------------*/
31#if defined HDRL_USE_EXPERIMENTAL || defined HDRL_USE_PRIVATE
32/* currently intended for unit/regression testing purposes only */
33typedef struct hdrl_random_state_ hdrl_random_state;
34
35hdrl_random_state * hdrl_random_state_new(int type, uint64_t * seed);
36void hdrl_random_state_delete(hdrl_random_state * state);
37
38int64_t hdrl_random_uniform_int64(hdrl_random_state * state,
39 int64_t minval, int64_t maxval);
40double hdrl_random_uniform_double(hdrl_random_state * state,
41 double minval, double maxval);
42uint64_t hdrl_random_poisson(hdrl_random_state * state, double lam);
43double hdrl_random_normal(hdrl_random_state * state, double mean, double sigma);
44
45#endif
46
47CPL_END_DECLS
48
49#endif