Rcpp Version 0.12.12
cauchy.h
Go to the documentation of this file.
1 // -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; indent-tabs-mode: nil; -*-
2 //
3 // cauchy.h: Rcpp R/C++ interface class library --
4 //
5 // Copyright (C) 2010 - 2016 Douglas Bates, Dirk Eddelbuettel and Romain Francois
6 //
7 // This file is part of Rcpp.
8 //
9 // Rcpp is free software: you can redistribute it and/or modify it
10 // under the terms of the GNU General Public License as published by
11 // the Free Software Foundation, either version 2 of the License, or
12 // (at your option) any later version.
13 //
14 // Rcpp is distributed in the hope that it will be useful, but
15 // WITHOUT ANY WARRANTY; without even the implied warranty of
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 // GNU General Public License for more details.
18 //
19 // You should have received a copy of the GNU General Public License
20 // along with Rcpp. If not, see <http://www.gnu.org/licenses/>.
21 
22 #ifndef Rcpp__stats__cauchy_h
23 #define Rcpp__stats__cauchy_h
24 
25 namespace Rcpp{
26 namespace stats{
27 
28 inline double dcauchy_0(double x, int give_log) {
29  return ::Rf_dcauchy(x,0.0,1.0, give_log) ;
30 }
31 
32 inline double dcauchy_1(double x, double location, int give_log) {
33  return ::Rf_dcauchy(x,location,1.0, give_log) ;
34 }
35 
36 inline double pcauchy_0(double x, int lower_tail, int log_p) {
37  return ::Rf_pcauchy(x,0.0,1.0,lower_tail, log_p) ;
38 }
39 
40 inline double pcauchy_1(double x, double location, int lower_tail, int log_p) {
41  return ::Rf_pcauchy(x,location,1.0,lower_tail, log_p) ;
42 }
43 
44 inline double qcauchy_0(double p, int lower_tail, int log_p) {
45  return ::Rf_qcauchy(p, 0.0, 1.0, lower_tail, log_p ) ;
46 }
47 inline double qcauchy_1(double p, double location, int lower_tail, int log_p) {
48  return ::Rf_qcauchy(p, location, 1.0, lower_tail, log_p ) ;
49 }
50 
51 } // stats
52 } // Rcpp
53 
54 
57 RCPP_DPQ_2(cauchy,::Rf_dcauchy,::Rf_pcauchy,::Rf_qcauchy)
58 
59 
60 #endif
61 
double qcauchy_1(double p, double location, int lower_tail, int log_p)
Definition: cauchy.h:47
double dcauchy_0(double x, int give_log)
Definition: cauchy.h:28
#define RCPP_DPQ_1(__NAME__, __D__, __P__, __Q__)
Definition: dpq.h:340
double qcauchy_0(double p, int lower_tail, int log_p)
Definition: cauchy.h:44
double pcauchy_0(double x, int lower_tail, int log_p)
Definition: cauchy.h:36
#define give_log
Definition: macros.h:24
#define RCPP_DPQ_2(__NAME__, __D__, __P__, __Q__)
Definition: dpq.h:363
double dcauchy_1(double x, double location, int give_log)
Definition: cauchy.h:32
Rcpp API.
Definition: algo.h:28
#define RCPP_DPQ_0(__NAME__, __D__, __P__, __Q__)
Definition: dpq.h:318
double pcauchy_1(double x, double location, int lower_tail, int log_p)
Definition: cauchy.h:40