-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathREADME.rmd
64 lines (41 loc) · 1.91 KB
/
README.rmd
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
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# RcppFaddeeva
[![](https://www.r-pkg.org/badges/version/RcppFaddeeva)](https://CRAN.R-project.org/package=RcppFaddeeva)
[![](https://cranlogs.r-pkg.org/badges/grand-total/RcppFaddeeva)](https://CRAN.R-project.org/package=RcppFaddeeva)
Wrapper to the
[Faddeeva Package by Steven G. Johnson](http://ab-initio.mit.edu/wiki/index.php/Faddeeva_Package)
## Installation
``` r
install.packages('RcppFaddeeva', repos = c('https://nano-optics.r-universe.dev', 'https://cloud.r-project.org'))
```
You can also install the development version of RcppFaddeeva from source via [GitHub](https://github.com/) with:
``` r
# install.packages("remotes")
remotes::install_github("nano-optics/RcppFaddeeva")
```
## What is Faddeeva?
The [Faddeeva](http://ab-initio.mit.edu/wiki/index.php/Faddeeva_Package)
package provides C++ code to compute the various error functions of arbitrary
complex arguments, in particular the Faddeeva function, error function,
complementary error function, scaled complementary error function and
imaginary error function as well as the Dawson function. With these, Voigt
functions, Fresnel integrals and more can be computed.
```{r, echo=FALSE, out.width=100, fig.align='center'}
knitr::include_graphics("overview.png")
```
### Why this package?
The package was created to provide a fast implementation of the Voigt lineshape, formally defined as the convolution between a Lorentzian and a Gaussian. The imaginary part of the Faddeeva function, properly scaled, provides directly the result.
This package also results in a nice example for creating Rcpp wrappers for a small and
self-contained C++ library, in this case a single header file along with a
single code file.