sobol_primitives.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /* StarPU --- Runtime system for heterogeneous multicore architectures.
  2. *
  3. * Copyright (C) 2010 Université de Bordeaux 1
  4. *
  5. * StarPU is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU Lesser General Public License as published by
  7. * the Free Software Foundation; either version 2.1 of the License, or (at
  8. * your option) any later version.
  9. *
  10. * StarPU is distributed in the hope that it will be useful, but
  11. * WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  13. *
  14. * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  15. */
  16. /*
  17. * Copyright 1993-2009 NVIDIA Corporation. All rights reserved.
  18. *
  19. * NVIDIA Corporation and its licensors retain all intellectual property and
  20. * proprietary rights in and to this software and related documentation and
  21. * any modifications thereto. Any use, reproduction, disclosure, or distribution
  22. * of this software and related documentation without an express license
  23. * agreement from NVIDIA Corporation is strictly prohibited.
  24. *
  25. */
  26. /*
  27. * Portions Copyright (c) 1993-2009 NVIDIA Corporation. All rights reserved.
  28. * Portions Copyright (c) 2009 Mike Giles, Oxford University. All rights reserved.
  29. * Portions Copyright (c) 2008 Frances Y. Kuo and Stephen Joe. All rights reserved.
  30. *
  31. * Sobol Quasi-random Number Generator example
  32. *
  33. * Based on CUDA code submitted by Mike Giles, Oxford University, United Kingdom
  34. * http://people.maths.ox.ac.uk/~gilesm/
  35. *
  36. * and C code developed by Stephen Joe, University of Waikato, New Zealand
  37. * and Frances Kuo, University of New South Wales, Australia
  38. * http://web.maths.unsw.edu.au/~fkuo/sobol/
  39. *
  40. * For theoretical background see:
  41. *
  42. * P. Bratley and B.L. Fox.
  43. * Implementing Sobol's quasirandom sequence generator
  44. * http://portal.acm.org/citation.cfm?id=42288
  45. * ACM Trans. on Math. Software, 14(1):88-100, 1988
  46. *
  47. * S. Joe and F. Kuo.
  48. * Remark on algorithm 659: implementing Sobol's quasirandom sequence generator.
  49. * http://portal.acm.org/citation.cfm?id=641879
  50. * ACM Trans. on Math. Software, 29(1):49-57, 2003
  51. *
  52. */
  53. #ifndef SOBOL_PRIMITIVES_H
  54. #define SOBOL_PRIMITIVES_H
  55. #define max_m 17
  56. /* Each primitive is stored as a struct where
  57. dimension is the dimension number of the polynomial (unused)
  58. degree is the degree of the polynomial
  59. a is a binary word representing the coefficients
  60. m is the array of m values */
  61. struct primitive
  62. {
  63. unsigned int dimension;
  64. unsigned int degree;
  65. unsigned int a;
  66. unsigned int m[max_m];
  67. };
  68. extern const struct primitive sobol_primitives[];
  69. #endif