Statistics
| Revision:

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

History | View | Annotate | Download (3.4 kB)

1
/*
2
 *  R : A Computer Language for Statistical Data Analysis
3
 *  Copyright (C) 1998-2012    The R Core Team
4
 *
5
 *  This program is free software; you can redistribute it and/or modify
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
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
13
 *  GNU Lesser General Public License for more details.
14
 *
15
 *  You should have received a copy of the GNU Lesser General Public License
16
 *  along with this program; if not, a copy is available at
17
 *  http://www.r-project.org/Licenses/
18
 *
19
 *
20
 * Generally useful  UTILITIES  *NOT* relying on R internals (from Defn.h)
21
 */
22

    
23
/* Included by R.h: API */
24

    
25
#ifndef R_EXT_UTILS_H_
26
#define R_EXT_UTILS_H_
27

    
28
#include <R_ext/Boolean.h>
29
#include <R_ext/Complex.h>
30
#include <stddef.h>
31

    
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
37
#define setIVector    Rf_setIVector
38
#define setRVector    Rf_setRVector
39
#define StringFalse   Rf_StringFalse
40
#define StringTrue    Rf_StringTrue
41
#define isBlankString Rf_isBlankString
42

    
43
#ifdef  __cplusplus
44
extern "C" {
45
#endif
46

    
47
/* ../../main/sort.c : */
48
void        R_isort(int*, int);
49
void        R_rsort(double*, int);
50
void        R_csort(Rcomplex*, int);
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

    
57
/* ../../main/qsort.c : */
58
/* dummy renamed to II to avoid problems with g++ on Solaris */
59
void R_qsort    (double *v,         size_t i, size_t j);
60
void R_qsort_I  (double *v, int *II, int i, int j);
61
void R_qsort_int  (int *iv,         size_t i, size_t j);
62
void R_qsort_int_I(int *iv, int *II, int i, int j);
63
#ifdef R_RS_H
64
void F77_NAME(qsort4)(double *v, int *indx, int *ii, int *jj);
65
void F77_NAME(qsort3)(double *v,            int *ii, int *jj);
66
#endif
67

    
68
/* ../../main/util.c  and others : */
69
const char *R_ExpandFileName(const char *);
70
void        setIVector(int*, int, int);
71
void        setRVector(double*, int, double);
72
Rboolean StringFalse(const char *);
73
Rboolean StringTrue(const char *);
74
Rboolean isBlankString(const char *);
75

    
76
/* These two are guaranteed to use '.' as the decimal point,
77
   and to accept "NA".
78
 */
79
double R_atof(const char *str);
80
double R_strtod(const char *c, char **end);
81

    
82
char *R_tmpnam(const char *prefix, const char *tempdir);
83
char *R_tmpnam2(const char *prefix, const char *tempdir, const char *fileext);
84

    
85
void R_CheckUserInterrupt(void);
86
void R_CheckStack(void);
87
void R_CheckStack2(size_t);
88

    
89

    
90
/* ../../appl/interv.c: also in Applic.h */
91
int findInterval(double *xt, int n, double x,
92
                 Rboolean rightmost_closed,  Rboolean all_inside, int ilo,
93
                 int *mflag);
94
#ifdef R_RS_H
95
int F77_SUB(interv)(double *xt, int *n, double *x,
96
                    Rboolean *rightmost_closed, Rboolean *all_inside,
97
                    int *ilo, int *mflag);
98
#endif
99
void find_interv_vec(double *xt, int *n,        double *x,   int *nx,
100
                     int *rightmost_closed, int *all_inside, int *indx);
101

    
102
/* ../../appl/maxcol.c: also in Applic.h */
103
void R_max_col(double *matrix, int *nr, int *nc, int *maxes, int *ties_meth);
104

    
105
#ifdef  __cplusplus
106
}
107
#endif
108

    
109
#endif /* R_EXT_UTILS_H_ */