| Title: | 'Rcpp' Bindings for the 'Faddeeva' Package |
|---|---|
| Description: | Access to a family of Gauss error functions for arbitrary complex arguments is provided via the 'Faddeeva' package by Steven G. Johnson (see <http://ab-initio.mit.edu/wiki/index.php/Faddeeva_Package> for more information). |
| Authors: | Baptiste Auguié [aut, cre], Dirk Eddelbuettel [aut], Steven G. Johnson [aut, cph] (Author of Faddeeva), Dennis Feehan [ctb], Ivan Krylov [ctb] |
| Maintainer: | Baptiste Auguié <[email protected]> |
| License: | GPL (>= 2) |
| Version: | 0.2.3 |
| Built: | 2026-05-23 06:35:09 UTC |
| Source: | https://github.com/nano-optics/RcppFaddeeva |
'Rcpp' Bindings for the 'Faddeeva' Package
Access to a family of Gauss error functions for arbitrary complex arguments is provided via the 'Faddeeva' package by Steven G. Johnson (see <http://ab-initio.mit.edu/wiki/index.php/Faddeeva_Package> for more information).
Maintainer: Baptiste Auguié [email protected]
Authors:
Dirk Eddelbuettel [email protected]
Steven G. Johnson (Author of Faddeeva) [copyright holder]
Other contributors:
Dennis Feehan [contributor]
Ivan Krylov [contributor]
The Faddeeva Package wiki page details the algorithms implemented by Steve G. Johnson, http://ab-initio.mit.edu/wiki/index.php/Faddeeva_Package
Useful links:
Report bugs at https://github.com/nano-optics/RcppFaddeeva/issues
the Faddeeva function
Faddeeva_w(z, relerr = 0) erfcx(z, relerr = 0) erf(z, relerr = 0) erfi(z, relerr = 0) erfc(z, relerr = 0) Dawson(z, relerr = 0)Faddeeva_w(z, relerr = 0) erfcx(z, relerr = 0) erf(z, relerr = 0) erfi(z, relerr = 0) erfc(z, relerr = 0) Dawson(z, relerr = 0)
z |
complex vector |
relerr |
double, requested error |
complex vector
Faddeeva_w(): compute
erfcx(): compute
erf(): compute
erfi(): compute
erfc(): compute
Dawson(): compute
Faddeeva_w(1:10 + 1i) erfcx(1:10 + 1i) erf(1:10 + 1i) erfi(1:10 + 1i) erfc(1:10 + 1i) Dawson(1:10 + 1i)Faddeeva_w(1:10 + 1i) erfcx(1:10 + 1i) erf(1:10 + 1i) erfi(1:10 + 1i) erfc(1:10 + 1i) Dawson(1:10 + 1i)
Voigt distribution
Lorentzian distribution
Gaussian distribution
Voigt(x, x0, sigma, gamma, real = TRUE, ...) Lorentz(x, x0, gamma) Gauss(x, x0, sigma)Voigt(x, x0, sigma, gamma, real = TRUE, ...) Lorentz(x, x0, gamma) Gauss(x, x0, sigma)
x |
numeric vector |
x0 |
scalar, peak position |
sigma |
parameter of the gaussian |
gamma |
parameter of the lorentzian |
real |
logical, return only the real part of the complex Faddeeva |
... |
passed to Faddeeva_w |
numeric or complex vector
Voigt(): Voigt lineshape function
Lorentz(): Lorentzian lineshape function
Gauss(): Gaussian lineshape function
baptiste Auguie
## should integrate to 1 in all cases integrate(Lorentz, -Inf, Inf, x0=200, gamma=100) integrate(Gauss, -Inf, Inf, x0=200, sigma=50) integrate(Voigt, -Inf, Inf, x0=200, sigma=50, gamma=100) ## visual comparison x <- seq(-1000, 1000) x0 <- 200 l <- Lorentz(x, x0, 30) g <- Gauss(x, x0, 100) N <- length(x) c <- convolve(Gauss(x, 0, 100), rev(Lorentz(x, x0, 30)), type="o")[seq(N/2, length=N)] v <- Voigt(x, x0, 100, 30) matplot(x, cbind(v, l, g, c), t="l", lty=c(1,2,2,1), xlab="x", ylab="") legend("topleft", legend = c("Voigt", "Lorentz", "Gauss", "Convolution"), bty="n", lty=c(1,2,2,1), col=1:4)## should integrate to 1 in all cases integrate(Lorentz, -Inf, Inf, x0=200, gamma=100) integrate(Gauss, -Inf, Inf, x0=200, sigma=50) integrate(Voigt, -Inf, Inf, x0=200, sigma=50, gamma=100) ## visual comparison x <- seq(-1000, 1000) x0 <- 200 l <- Lorentz(x, x0, 30) g <- Gauss(x, x0, 100) N <- length(x) c <- convolve(Gauss(x, 0, 100), rev(Lorentz(x, x0, 30)), type="o")[seq(N/2, length=N)] v <- Voigt(x, x0, 100, 30) matplot(x, cbind(v, l, g, c), t="l", lty=c(1,2,2,1), xlab="x", ylab="") legend("topleft", legend = c("Voigt", "Lorentz", "Gauss", "Convolution"), bty="n", lty=c(1,2,2,1), col=1:4)