Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dotCall64
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Reinhard Furrer
dotCall64
Commits
c184c8a9
Commit
c184c8a9
authored
7 years ago
by
Florian Gerber
Browse files
Options
Downloads
Patches
Plain Diff
.
parent
de6bdb03
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
R/dotCall64.R
+5
-5
5 additions, 5 deletions
R/dotCall64.R
man/dotCall64.Rd
+5
-5
5 additions, 5 deletions
man/dotCall64.Rd
with
10 additions
and
10 deletions
R/dotCall64.R
+
5
−
5
View file @
c184c8a9
...
...
@@ -5,7 +5,7 @@
#' \enumerate{
#' \item supports long vectors, i.e., vectors with more than \code{2^31-1} elements
#' \item does the necessary castings to expose the R representation of "64-bit integers" (numeric vectors)
#' to 64-bit integer
s
arguments of the compiled function. The latter are int64_t in C code and integer (kind = 8) in Fortran code
#' to 64-bit integer arguments of the compiled function. The latter are int64_t in C code and integer (kind = 8) in Fortran code
#' \item provides a mechanism the control duplication of the R objects exposed to the compiled code
#' \item checks if the provided R objects are of the expected types and coerces them if necessary
#' }
...
...
@@ -13,11 +13,11 @@
#' \code{SIGNATURE} specifies the types of the arguments of the compiled function.
#' \code{INTENT} indicates whether the compiled function "reads", "writes",
#' or "read and writes" to the R objects passed to the compiled function.
#' This is then used to duplicate R objects if and only if necessary.
#' This
information
is then used to duplicate R objects if and only if necessary.
#'
#' @param .NAME character vector of length 1. Name of the compiled function to be called.
#' @param SIGNATURE character vector of the same length as the number of arguments of the compiled function.
#' Accepted strings are \code{"double"}, \code{"integer"}, \code{"int64"}.
#' Accepted strings are \code{"double"}, \code{"integer"},
and
\code{"int64"}.
#' They describe the signature of each argument of the compiled function.
#' @param ... arguments passed to the compiled function. One R object for each argument. Up to 65 arguments are supported.
#' @param INTENT character vector of the same length as the number of arguments of the compiled function.
...
...
@@ -67,7 +67,7 @@
#' ## output[0] = input[index[0] - 1];
#' ## }
#' ##
#' ## We can use .C64() to call
it
from R:
#' ## We can use .C64() to call
get_c()
from R:
#' .C64("get_c", SIGNATURE = c("double", "integer", "double"),
#' input = 1:10, index = 9, output = double(1))$output
#'
...
...
@@ -87,7 +87,7 @@
#' ## output[0] = input[index[0] - 1];
#' ## }
#'
#' ## Now, we can use .C64() to call
the function
from R.
#' ## Now, we can use .C64() to call
get64_c()
from R.
#' .C64("get64_c", SIGNATURE = c("double", "int64", "double"),
#' input = x_long, index = 2^31, output = double(1))$output
#' ## Note that 2^31 is of type double and .C64() casts it into an
...
...
This diff is collapsed.
Click to expand it.
man/dotCall64.Rd
+
5
−
5
View file @
c184c8a9
...
...
@@ -12,7 +12,7 @@
\item{.NAME}{character vector of length 1. Name of the compiled function to be called.}
\item{SIGNATURE}{character vector of the same length as the number of arguments of the compiled function.
Accepted strings are \code{"double"}, \code{"integer"}, \code{"int64"}.
Accepted strings are \code{"double"}, \code{"integer"},
and
\code{"int64"}.
They describe the signature of each argument of the compiled function.}
\item{...}{arguments passed to the compiled function. One R object for each argument. Up to 65 arguments are supported.}
...
...
@@ -57,7 +57,7 @@ The objects of the list reflect the changes made by the compiled C or Fortran fu
\enumerate{
\item supports long vectors, i.e., vectors with more than \code{2^31-1} elements
\item does the necessary castings to expose the R representation of "64-bit integers" (numeric vectors)
to 64-bit integer
s
arguments of the compiled function. The latter are int64_t in C code and integer (kind = 8) in Fortran code
to 64-bit integer arguments of the compiled function. The latter are int64_t in C code and integer (kind = 8) in Fortran code
\item provides a mechanism the control duplication of the R objects exposed to the compiled code
\item checks if the provided R objects are of the expected types and coerces them if necessary
}
...
...
@@ -65,7 +65,7 @@ Compared to \code{\link{.C}}, \code{.C64} has the additional arguments \code{SIG
\code{SIGNATURE} specifies the types of the arguments of the compiled function.
\code{INTENT} indicates whether the compiled function "reads", "writes",
or "read and writes" to the R objects passed to the compiled function.
This is then used to duplicate R objects if and only if necessary.
This
information
is then used to duplicate R objects if and only if necessary.
}
\examples{
## Consider the following C function, which is included
...
...
@@ -74,7 +74,7 @@ This is then used to duplicate R objects if and only if necessary.
## output[0] = input[index[0] - 1];
## }
##
## We can use .C64() to call
it
from R:
## We can use .C64() to call
get_c()
from R:
.C64("get_c", SIGNATURE = c("double", "integer", "double"),
input = 1:10, index = 9, output = double(1))$output
...
...
@@ -94,7 +94,7 @@ x_long[9] <- 9; x_long[2^31] <- -1
## output[0] = input[index[0] - 1];
## }
## Now, we can use .C64() to call
the function
from R.
## Now, we can use .C64() to call
get64_c()
from R.
.C64("get64_c", SIGNATURE = c("double", "int64", "double"),
input = x_long, index = 2^31, output = double(1))$output
## Note that 2^31 is of type double and .C64() casts it into an
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment