On 4 January 2015 at 19:58, Søren Højsgaard wrote:
| Thanks! Probably a stupid question, but where are these functions defined? In 
math.h I see
| 
| VECTORIZED_MATH_1(log,::log)
| 
| but - where to look for the implementation?

You mean where VECTORIZED_MATH is defined?  

Let me introduce you to my friend 'ag' (with a top of the hat to Kevin ...)

edd@max:~/git/rcpp/inst/include/Rcpp/sugar(master)$ ag VECTORIZED_MATH 
block/Vectorized_Math.h
83:#define VECTORIZED_MATH_1(__NAME__,__SYMBOL__)                               
\

functions/math.h
25:VECTORIZED_MATH_1(exp,::exp)
26:VECTORIZED_MATH_1(acos,::acos)
27:VECTORIZED_MATH_1(asin,::asin)
28:VECTORIZED_MATH_1(atan,::atan)
29:VECTORIZED_MATH_1(ceil,::ceil)
30:VECTORIZED_MATH_1(ceiling,::ceil)
31:VECTORIZED_MATH_1(cos,::cos)
32:VECTORIZED_MATH_1(cosh,::cosh)
33:VECTORIZED_MATH_1(floor,::floor)
34:VECTORIZED_MATH_1(log,::log)
35:VECTORIZED_MATH_1(log10,::log10)
36:VECTORIZED_MATH_1(sqrt,::sqrt)
37:VECTORIZED_MATH_1(sin,::sin)
38:VECTORIZED_MATH_1(sinh,::sinh)
39:VECTORIZED_MATH_1(tan,::tan)
40:VECTORIZED_MATH_1(tanh,::tanh)
42:VECTORIZED_MATH_1(abs,::fabs)
44:VECTORIZED_MATH_1(gamma      , ::Rf_gammafn     )
45:VECTORIZED_MATH_1(lgamma     , ::Rf_lgammafn    )
46:VECTORIZED_MATH_1(digamma    , ::Rf_digamma     )
47:VECTORIZED_MATH_1(trigamma   , ::Rf_trigamma    )
48:VECTORIZED_MATH_1(tetragamma , ::Rf_tetragamma  )
49:VECTORIZED_MATH_1(pentagamma , ::Rf_pentagamma  )
50:VECTORIZED_MATH_1(expm1      , ::expm1          )
51:VECTORIZED_MATH_1(log1p      , ::log1p          )
59:VECTORIZED_MATH_1(factorial  , ::Rcpp::internal::factorial   )
60:VECTORIZED_MATH_1(lfactorial , ::Rcpp::internal::lfactorial  )
68:VECTORIZED_MATH_1(trunc, ::Rf_ftrunc)                // truncates to zero 
(cf Writing R Extension, 6.7.3 Numerical Utilities)
edd@max:~/git/rcpp/inst/include/Rcpp/sugar(master)$ 

[ ag is "just" a version of 'grep -r' on steroids, which knows to skip .git,
.svn etc pp -- recommended. In Debian/Ubuntu in package silversearcher-ag as
there already was a package called ag. ]

Dirk

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org
_______________________________________________
Rcpp-devel mailing list
Rcpp-devel@lists.r-forge.r-project.org
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

Reply via email to