The R Project SVN R

Rev

Rev 24068 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

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