High-Level Data Reduction Library 1.6.0
High-Level data reduction routines for ESO pipelines
Loading...
Searching...
No Matches
hdrl_random.h
Go to the documentation of this file.
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
hdrl_random_state * hdrl_random_state_new(int type, uint64_t *seed)
create random number generator state
Definition hdrl_random.c:108
double hdrl_random_normal(hdrl_random_state *state, double mean, double sigma)
generatore normal distributed values
Definition hdrl_random.c:308
double hdrl_random_uniform_double(hdrl_random_state *state, double minval, double maxval)
generatore uniformly distributed double within range
Definition hdrl_random.c:206
void hdrl_random_state_delete(hdrl_random_state *state)
delete random number generator state structure
Definition hdrl_random.c:130
uint64_t hdrl_random_poisson(hdrl_random_state *state, double lam)
generatore poisson distributed values
Definition hdrl_random.c:279
int64_t hdrl_random_uniform_int64(hdrl_random_state *state, int64_t minval, int64_t maxval)
generatore uniformly distributed 64 bit integers within range
Definition hdrl_random.c:153
Definition hdrl_random.c:65
uint64_t state
Definition hdrl_random.c:66