1 /*****************************************************************************
2  *                                                                           *
3  *          UNURAN -- Universal Non-Uniform Random number generator          *
4  *                                                                           *
5  *****************************************************************************
6  *                                                                           *
7  *   FILE: urng_gsl.h                                                        *
8  *                                                                           *
9  *   PURPOSE:                                                                *
10  *     Function prototypes for using URNG of type GSL:                       *
11  *     uniform random number from GSL (GNU Scientific Library),              *
12  *     see http://www.gnu.org/software/gsl/.                                 *
13  *                                                                           *
14  *   USAGE:                                                                  *
15  *         only included in unuran.h                                         *
16  *                                                                           *
17  *****************************************************************************
18  *                                                                           *
19  *   Copyright (c) 2000-2006 Wolfgang Hoermann and Josef Leydold             *
20  *   Department of Statistics and Mathematics, WU Wien, Austria              *
21  *                                                                           *
22  *   This program is free software; you can redistribute it and/or modify    *
23  *   it under the terms of the GNU General Public License as published by    *
24  *   the Free Software Foundation; either version 2 of the License, or       *
25  *   (at your option) any later version.                                     *
26  *                                                                           *
27  *   This program is distributed in the hope that it will be useful,         *
28  *   but WITHOUT ANY WARRANTY; without even the implied warranty of          *
29  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the           *
30  *   GNU General Public License for more details.                            *
31  *                                                                           *
32  *   You should have received a copy of the GNU General Public License       *
33  *   along with this program; if not, write to the                           *
34  *   Free Software Foundation, Inc.,                                         *
35  *   59 Temple Place, Suite 330, Boston, MA 02111-1307, USA                  *
36  *                                                                           *
37  *****************************************************************************/
38 
39 /*---------------------------------------------------------------------------*/
40 #ifndef URNG_GSL_H_SEEN
41 #define URNG_GSL_H_SEEN
42 /*---------------------------------------------------------------------------*/
43 #include <gsl/gsl_rng.h>
44 /*---------------------------------------------------------------------------*/
45 
46 /*
47    =NODE  URNG-GSL  Interface to GSL uniform random number generators
48 
49    =UP URNG [20]
50 
51    =DESCRIPTION
52       Interface to the uniform random number generators from the
53       GNU Scientific Library (GSL). Documentation and source code
54       of this library is available from
55       @uref{http://www.gnu.org/software/gsl/}.
56 
57       The interface to the GSL must be compiled into UNU.RAN using the
58       configure flag @code{--with-urng-gsl}.
59       Notice that the GSL has to be installed before running
60       @code{./configure}.
61 
62    =HOWTOUSE
63       When using this interface @file{unuran_urng_gsl.h} must be included
64       in the corresponding C file, i.e., one must add the line
65       @smallexample
66       #include <unuran_urng_gsl.h>
67       @end smallexample
68 
69       Moreover, one must not forget to link the executable against
70       @file{libgsl}.
71 
72       The following routines are supported for URNG objects of
73       type GSL:
74 
75       @itemize @minus
76       @item unur_urng_sample()
77       @item unur_urng_sample_array()
78       @item unur_urng_seed()
79       @item unur_urng_reset()
80       @item unur_urng_free()
81       @end itemize
82 
83       @smallexample
84       @include ref_example_gsl.texi
85       @end smallexample
86 
87    =END
88 
89 */
90 
91 /*---------------------------------------------------------------------------*/
92 
93 /* =ROUTINES */
94 
95 /*---------------------------------------------------------------------------*/
96 
97 UNUR_URNG *unur_urng_gsl_new( const gsl_rng_type *urngtype );
98 /*
99    Make object for URNGs from the @file{GSL} (GNU Scientific Library).
100    @var{urngtype} is the type of the chosen generator as described in the
101    GSL manual (see Section Random Number Generation). This library is
102    available from @uref{http://www.gnu.org/software/gsl/}.
103 */
104 
105 UNUR_URNG *unur_urng_gslptr_new( gsl_rng *urng );
106 /*
107    Similar to unur_urng_gsl_new() but it uses a pointer to a
108    generator object as returned by @code{gsl_rng_alloc(rng_type)};
109    see @file{GSL} manual for details.
110 
111    @emph{Notice}: There is a subtle but important difference between
112    these two calls. When a generator object is created by a
113    unur_urng_gsl_new() call, then resetting of the generator works.
114    When a generator object is created by a unur_urng_gslptr_new()
115    call, then resetting only works after a
116    @code{unur_urng_seed(urng,myseed)} call.
117 */
118 
119 /* =END */
120 
121 /*---------------------------------------------------------------------------*/
122 #endif  /* URNG_GSL_H_SEEN */
123 /*---------------------------------------------------------------------------*/
124