File: sobol.h

package info (click to toggle)
argyll 2.0.1%2Brepack-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 38,928 kB
  • sloc: ansic: 380,801; xml: 1,551; sh: 655; makefile: 604
file content (52 lines) | stat: -rwxr-xr-x 825 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#ifndef SOBOL_H
#define SOBOL_H

#ifdef __cplusplus
	extern "C" {
#endif

#define SOBOL_MAXBIT 30
#define SOBOL_MAXDIM 40

/* Object definition */
struct _sobol {
	/* Private: */
	int          dim;			/* dimension we're set for */
	unsigned int count;
	double       recipd;
	int          lastq[SOBOL_MAXDIM];
	int          dir[SOBOL_MAXBIT][SOBOL_MAXDIM];

	/* Public: */
	/* Methods */

	/* Get the next sobol vector, return nz if we've run out */
	/* Values are between 0.0 and 1.0 */
	int (*next)(struct _sobol *s, double *v);

	/* Rest to the begining of the sequence */
	void (*reset)(struct _sobol *s);

	/* We're done with the object */
	void (*del)(struct _sobol *s);

}; typedef struct _sobol sobol;

/* Return NULL on error */
sobol *new_sobol(int dim);

#ifdef __cplusplus
	}
#endif

#endif /* SOBOL_H */