SCM

SCM Repository

[rmetrics] Diff of /pkg/randtoolbox/src/init.c
ViewVC logotype

Diff of /pkg/randtoolbox/src/init.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3644, Thu Oct 30 22:03:31 2008 UTC revision 4229, Fri Jul 3 15:44:58 2009 UTC
# Line 1  Line 1 
1  /**********************************************************************************************  /**
2   *   Copyright (c) 2008 Christophe Dutang                                                                    *   * @file  init.c
3   *                                                                                                                                           *   * @brief init file for all RNGs
4   *   This program is free software; you can redistribute it and/or modify                 *   *
5   *   it under the terms of the GNU General Public License as published by           *   * @author Christophe Dutang
6   *   the Free Software Foundation; either version 2 of the License, or                     *   * @author Petr Savicky
7   *   (at your option) any later version.                                                                              *   *
8   *                                                                                                                                           *   *
9   *   This program is distributed in the hope that it will be useful,                               *   * Copyright (C) 2009, Christophe Dutang,
10   *   but WITHOUT ANY WARRANTY; without even the implied warranty of            *   * Petr Savicky, Academy of Sciences of the Czech Republic.
11   *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the   *   * All rights reserved.
12   *   GNU General Public License for more details.                                                      *   *
13   *                                                                                                                                           *   * The new BSD License is applied to this software.
14   *   You should have received a copy of the GNU General Public License             *   * Copyright (c) 2009 Christophe Dutang, Petr Savicky.
15   *   along with this program; if not, write to the                                                             *   * All rights reserved.
16   *   Free Software Foundation, Inc.,                                                                                *   *
17   *   59 Temple Place, Suite 330, Boston, MA 02111-1307, USA                               *   *      Redistribution and use in source and binary forms, with or without
18   *                                                                                                                                           *   *      modification, are permitted provided that the following conditions are
19   **********************************************************************************************/   *      met:
20     *
21     *          - Redistributions of source code must retain the above copyright
22     *          notice, this list of conditions and the following disclaimer.
23     *          - Redistributions in binary form must reproduce the above
24     *          copyright notice, this list of conditions and the following
25     *          disclaimer in the documentation and/or other materials provided
26     *          with the distribution.
27     *          - Neither the name of the Academy of Sciences of the Czech Republic
28     *          nor the names of its contributors may be used to endorse or promote
29     *          products derived from this software without specific prior written
30     *          permission.
31     *
32     *      THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
33     *      "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
34     *      LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
35     *      A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
36     *      OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
37     *      SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
38     *      LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
39     *      DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
40     *      THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
41     *      (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
42     *      OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
43     *
44     */
45  /*  /*
46   *  Torus algorithm to generate quasi random numbers   *  randtoolbox to generate pseudo and quasi random sequences
47   *   *
48   *              init file   *              init file
49   *   *
# Line 45  Line 70 
70          {NULL, NULL, 0}          {NULL, NULL, 0}
71  };  };
72    
73    
74    //table of registered routines
75  void R_init_randtoolbox(DllInfo *info)  void R_init_randtoolbox(DllInfo *info)
76  {  {
77          //register method accessed with .Call          //register method accessed with .Call
78          R_registerRoutines(info, NULL, callMethods, NULL, NULL);          R_registerRoutines(info, NULL, callMethods, NULL, NULL);
79    
80          //make randtoolbox C functions available from other packages          //make randtoolbox C functions available from other packages
81          R_RegisterCCallable("randtoolbox", "torus", (DL_FUNC) torus);          R_RegisterCCallable("randtoolbox", "torus", (DL_FUNC) torus);
82          R_RegisterCCallable("randtoolbox", "setSeed", (DL_FUNC) setSeed);          R_RegisterCCallable("randtoolbox", "setSeed", (DL_FUNC) setSeed);
# Line 56  Line 84 
84          R_RegisterCCallable("randtoolbox", "SFmersennetwister", (DL_FUNC) SFmersennetwister);          R_RegisterCCallable("randtoolbox", "SFmersennetwister", (DL_FUNC) SFmersennetwister);
85          R_RegisterCCallable("randtoolbox", "pokerTest", (DL_FUNC) pokerTest);          R_RegisterCCallable("randtoolbox", "pokerTest", (DL_FUNC) pokerTest);
86          R_RegisterCCallable("randtoolbox", "collisionTest", (DL_FUNC) collisionTest);          R_RegisterCCallable("randtoolbox", "collisionTest", (DL_FUNC) collisionTest);
         R_RegisterCCallable("randtoolbox", "WELLrng", (DL_FUNC) WELLrng);  
87          R_RegisterCCallable("randtoolbox", "knuthTAOCP", (DL_FUNC) knuthTAOCP);          R_RegisterCCallable("randtoolbox", "knuthTAOCP", (DL_FUNC) knuthTAOCP);
88    
89                    //retrieve WELL rng entry point in the rngWELL pkg
90                    WELLrng = (void (*) (double *, int, int, int, int, int)) R_GetCCallable("rngWELL", "WELLrng");
91    
92  }  }
93    
94    
95    

Legend:
Removed from v.3644  
changed lines
  Added in v.4229

root@r-forge.r-project.org
ViewVC Help
Powered by ViewVC 1.0.0  
Thanks to:
Vienna University of Economics and Business Powered By FusionForge