The R Project SVN R

Rev

Rev 60266 | Rev 68554 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
7727 ripley 1
/*
2
 *  R : A Computer Language for Statistical Data Analysis
59752 ripley 3
 *  Copyright (C) 1998-2012    The R Core Team
7727 ripley 4
 *
5
 *  This program is free software; you can redistribute it and/or modify
12778 pd 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
7727 ripley 8
 *  (at your option) any later version.
9
 *
10
 *  This program is distributed in the hope that it will be useful,
11
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12778 pd 13
 *  GNU Lesser General Public License for more details.
7727 ripley 14
 *
12778 pd 15
 *  You should have received a copy of the GNU Lesser General Public License
42308 ripley 16
 *  along with this program; if not, a copy is available at
17
 *  http://www.r-project.org/Licenses/
7727 ripley 18
 *
19
 *
20
 * Generally useful  UTILITIES  *NOT* relying on R internals (from Defn.h)
21
 */
22
 
60253 ripley 23
/* Included by R.h: API */
24
 
7754 ripley 25
#ifndef R_EXT_UTILS_H_
26
#define R_EXT_UTILS_H_
7727 ripley 27
 
19500 hornik 28
#include <R_ext/Boolean.h>
29
#include <R_ext/Complex.h>
59091 ripley 30
#include <stddef.h>
7727 ripley 31
 
7824 ripley 32
#define revsort       Rf_revsort
33
#define iPsort        Rf_iPsort
34
#define rPsort        Rf_rPsort
35
#define cPsort        Rf_cPsort
36
#define IndexWidth    Rf_IndexWidth
59100 ripley 37
#define setIVector    Rf_setIVector
38
#define setRVector    Rf_setRVector
7824 ripley 39
#define StringFalse   Rf_StringFalse
40
#define StringTrue    Rf_StringTrue
41
#define isBlankString Rf_isBlankString
7754 ripley 42
 
11211 ripley 43
#ifdef  __cplusplus
44
extern "C" {
45
#endif
46
 
18812 maechler 47
/* ../../main/sort.c : */
7829 ripley 48
void	R_isort(int*, int);
49
void	R_rsort(double*, int);
50
void	R_csort(Rcomplex*, int);
7727 ripley 51
void    rsort_with_index(double *, int *, int);
52
void	revsort(double*, int*, int);/* reverse; sort i[] alongside */
53
void	iPsort(int*,    int, int);
54
void	rPsort(double*, int, int);
55
void	cPsort(Rcomplex*, int, int);
56
 
18812 maechler 57
/* ../../main/qsort.c : */
59091 ripley 58
void R_qsort    (double *v,         size_t i, size_t j);
18843 maechler 59
void R_qsort_I  (double *v, int *I, int i, int j);
59091 ripley 60
void R_qsort_int  (int *iv,         size_t i, size_t j);
18843 maechler 61
void R_qsort_int_I(int *iv, int *I, int i, int j);
31682 ripley 62
#ifdef R_RS_H
63
void F77_NAME(qsort4)(double *v, int *indx, int *ii, int *jj);
64
void F77_NAME(qsort3)(double *v,            int *ii, int *jj);
65
#endif
18812 maechler 66
 
67
/* ../../main/util.c  and others : */
41781 ripley 68
const char *R_ExpandFileName(const char *);
59100 ripley 69
void	setIVector(int*, int, int);
70
void	setRVector(double*, int, double);
41853 ripley 71
Rboolean StringFalse(const char *);
72
Rboolean StringTrue(const char *);
41807 rgentlem 73
Rboolean isBlankString(const char *);
7727 ripley 74
 
44841 ripley 75
/* These two are guaranteed to use '.' as the decimal point,
76
   and to accept "NA".
77
 */
78
double R_atof(const char *str);
79
double R_strtod(const char *c, char **end);
11139 maechler 80
 
44841 ripley 81
char *R_tmpnam(const char *prefix, const char *tempdir);
54876 murdoch 82
char *R_tmpnam2(const char *prefix, const char *tempdir, const char *fileext);
44841 ripley 83
 
25212 luke 84
void R_CheckUserInterrupt(void);
35899 ripley 85
void R_CheckStack(void);
59752 ripley 86
void R_CheckStack2(size_t);
25212 luke 87
 
59083 maechler 88
 
35102 ripley 89
/* ../../appl/interv.c: also in Applic.h */
31682 ripley 90
int findInterval(double *xt, int n, double x,
91
		 Rboolean rightmost_closed,  Rboolean all_inside, int ilo,
92
		 int *mflag);
93
#ifdef R_RS_H
94
int F77_SUB(interv)(double *xt, int *n, double *x,
95
		    Rboolean *rightmost_closed, Rboolean *all_inside,
96
		    int *ilo, int *mflag);
97
#endif
98
void find_interv_vec(double *xt, int *n,	double *x,   int *nx,
99
		     int *rightmost_closed, int *all_inside, int *indx);
100
 
35102 ripley 101
/* ../../appl/maxcol.c: also in Applic.h */
34890 maechler 102
void R_max_col(double *matrix, int *nr, int *nc, int *maxes, int *ties_meth);
31682 ripley 103
 
11211 ripley 104
#ifdef  __cplusplus
105
}
7727 ripley 106
#endif
11211 ripley 107
 
108
#endif /* R_EXT_UTILS_H_ */