File: evalCpp.Rd

package info (click to toggle)
rcpp 1.0.10-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 11,432 kB
  • sloc: ansic: 44,024; cpp: 40,602; sh: 53; makefile: 2
file content (67 lines) | stat: -rw-r--r-- 1,804 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
\name{evalCpp}
\alias{evalCpp}
\alias{areMacrosDefined}
\title{
Evaluate a C++ Expression
}
\description{
Evaluates a C++ expression. This creates a C++ function using 
\code{\link{cppFunction}} and calls it to get the result. 
}
\usage{
evalCpp(code, depends = character(), plugins = character(), includes = character(), 
        rebuild = FALSE, cacheDir = getOption("rcpp.cache.dir", tempdir()),
        showOutput = verbose, verbose = getOption("verbose"))

areMacrosDefined(names, depends = character(), includes = character(), 
        rebuild = FALSE, showOutput = verbose, 
        verbose = getOption("verbose"))
}
\arguments{
  \item{code}{
C++ expression to evaluate
}
  \item{names}{
names of the macros we want to test
}
  \item{plugins}{
see \code{\link{cppFunction}}
}
  \item{depends}{
see \code{\link{cppFunction}}
}
  \item{includes}{
see \code{\link{cppFunction}}
}
  \item{rebuild}{
see \code{\link{cppFunction}}
}
  \item{cacheDir}{
    Directory to use for caching shared libraries. If the underlying code passed to \code{sourceCpp} has not changed since the last invocation then a cached version of the shared library is used. The default value of \code{tempdir()} results in the cache being valid only for the current R session. Pass an alternate directory to preserve the cache across R sessions.
}
  \item{showOutput}{
see \code{\link{cppFunction}}
}
  \item{verbose}{
see \code{\link{cppFunction}}
}
}
\note{
    The result type of the C++ expression must be compatible with \code{Rcpp::wrap}.     
}
\value{
    The result of the evaluated C++ expression. 
}
\seealso{
\code{\link{sourceCpp}}, \code{\link{cppFunction}}
}
\examples{
\dontrun{

evalCpp( "__cplusplus" )
evalCpp( "std::numeric_limits<double>::max()" )
    
areMacrosDefined( c("__cplusplus", "HAS_TR1" ) )

}
}