Statistics
| Revision:

root / tmp / org.txm.statsengine.r.core.win32 / res / win32 / include / S.h @ 2486

History | View | Annotate | Download (2.1 kB)

1 2486 sjacqu01
/*
2 2486 sjacqu01
 *  R : A Computer Language for Statistical Data Analysis
3 2486 sjacqu01
 *  Copyright (C) 1995, 1996  Robert Gentleman and Ross Ihaka
4 2486 sjacqu01
 *  Copyright (C) 1997--2003 The R Core Team.
5 2486 sjacqu01
 *
6 2486 sjacqu01
 *  This program is free software; you can redistribute it and/or modify
7 2486 sjacqu01
 *  it under the terms of the GNU Lesser General Public License as published by
8 2486 sjacqu01
 *  the Free Software Foundation; either version 2.1 of the License, or
9 2486 sjacqu01
 *  (at your option) any later version.
10 2486 sjacqu01
 *
11 2486 sjacqu01
 *  This program is distributed in the hope that it will be useful,
12 2486 sjacqu01
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13 2486 sjacqu01
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 2486 sjacqu01
 *  GNU Lesser General Public License for more details.
15 2486 sjacqu01
 *
16 2486 sjacqu01
 *  You should have received a copy of the GNU Lesser General Public License
17 2486 sjacqu01
 *  along with this program; if not, a copy is available at
18 2486 sjacqu01
 *  http://www.r-project.org/Licenses/
19 2486 sjacqu01
 *
20 2486 sjacqu01
 *  Much of this is from Doug Bates.
21 2486 sjacqu01
 */
22 2486 sjacqu01
23 2486 sjacqu01
#ifndef R_S_H
24 2486 sjacqu01
#define R_S_H
25 2486 sjacqu01
26 2486 sjacqu01
#ifndef USING_R
27 2486 sjacqu01
# define USING_R
28 2486 sjacqu01
/* is this a good idea? - conflicts with many versions of f2c.h */
29 2486 sjacqu01
# define longint int
30 2486 sjacqu01
#endif
31 2486 sjacqu01
32 2486 sjacqu01
#ifdef __cplusplus
33 2486 sjacqu01
extern "C" {
34 2486 sjacqu01
#endif
35 2486 sjacqu01
36 2486 sjacqu01
#include <stddef.h>
37 2486 sjacqu01
#include <stdlib.h>
38 2486 sjacqu01
#include <stdio.h>
39 2486 sjacqu01
#include <limits.h>
40 2486 sjacqu01
#include <float.h>
41 2486 sjacqu01
# include <math.h>
42 2486 sjacqu01
43 2486 sjacqu01
#include <Rconfig.h>
44 2486 sjacqu01
#include <R_ext/Constants.h>
45 2486 sjacqu01
#include <R_ext/Memory.h>        /* S_alloc */
46 2486 sjacqu01
47 2486 sjacqu01
/* subset of those in Random.h */
48 2486 sjacqu01
extern void seed_in(long *);
49 2486 sjacqu01
extern void seed_out(long *);
50 2486 sjacqu01
extern double unif_rand(void);
51 2486 sjacqu01
extern double norm_rand(void);
52 2486 sjacqu01
53 2486 sjacqu01
/* Macros for S/R Compatibility */
54 2486 sjacqu01
55 2486 sjacqu01
#include <R_ext/RS.h>
56 2486 sjacqu01
/* for PROBLEM ... Calloc, Realloc, Free, Memcpy, F77_xxxx */
57 2486 sjacqu01
58 2486 sjacqu01
/* S4 uses macros equivalent to */
59 2486 sjacqu01
#define Salloc(n,t) (t*)S_alloc(n, sizeof(t))
60 2486 sjacqu01
#define Srealloc(p,n,old,t) (t*)S_realloc(p,n,old,sizeof(t))
61 2486 sjacqu01
62 2486 sjacqu01
/* S's complex is different, and is a define to S_complex now */
63 2486 sjacqu01
typedef struct {
64 2486 sjacqu01
        double re;
65 2486 sjacqu01
        double im;
66 2486 sjacqu01
} S_complex;
67 2486 sjacqu01
68 2486 sjacqu01
#ifdef S_OLD_COMPLEX
69 2486 sjacqu01
# define complex S_complex
70 2486 sjacqu01
#endif
71 2486 sjacqu01
72 2486 sjacqu01
#ifndef NO_CALL_R
73 2486 sjacqu01
/* Not quite full compatibility: beware! */
74 2486 sjacqu01
/* void        call_R(char*, long, void**, char**, long*, char**, long, char**);*/
75 2486 sjacqu01
#define call_S call_R
76 2486 sjacqu01
#endif
77 2486 sjacqu01
78 2486 sjacqu01
79 2486 sjacqu01
#ifdef __cplusplus
80 2486 sjacqu01
}
81 2486 sjacqu01
#endif
82 2486 sjacqu01
83 2486 sjacqu01
#endif /* !R_S_H */