# dotCall64: An Efficient Interface to Compiled C/C++ and Fortran Code   Supporting Long Vectors

**Authors:** Florian Gerber, Kaspar M\"osinger, Reinhard Furrer

arXiv: 1702.08188 · 2018-08-20

## TL;DR

The paper introduces dotCall64, an R package that enables efficient calling of C/C++ and Fortran code with support for long vectors exceeding 2^31 elements, overcoming limitations of existing interfaces.

## Contribution

It presents a new R interface, .C64(), that supports long vectors and reduces memory overhead, improving upon the traditional foreign function interface in R.

## Key findings

- Supports vectors with more than 2^31 elements
- Reduces unnecessary copying for efficiency
- Provides transparent casting for 64-bit integer arguments

## Abstract

The R functions .C() and .Fortran() can be used to call compiled C/C++ and Fortran code from R. This so-called foreign function interface is convenient, since it does not require any interactions with the C API of R. However, it does not support long vectors (i.e., vectors of more than 2^31 elements). To overcome this limitation, the R package dotCall64 provides .C64(), which can be used to call compiled C/C++ and Fortran functions. It transparently supports long vectors and does the necessary castings to pass numeric R vectors to 64-bit integer arguments of the compiled code. Moreover, .C64() features a mechanism to avoid unnecessary copies of function arguments, making it efficient in terms of speed and memory usage.

## Full text

_Full body text omitted from this summary view._ Fetch the complete paper as Markdown: https://tomesphere.com/paper/1702.08188/full.md

## Figures

6 figures with captions in the complete paper: https://tomesphere.com/paper/1702.08188/full.md

## References

31 references — full list in the complete paper: https://tomesphere.com/paper/1702.08188/full.md

---
Source: https://tomesphere.com/paper/1702.08188