Skip to content

Commit

Permalink
doc
Browse files Browse the repository at this point in the history
  • Loading branch information
stla committed Nov 10, 2023
1 parent b0de008 commit 1b09a30
Show file tree
Hide file tree
Showing 9 changed files with 48 additions and 39 deletions.
6 changes: 3 additions & 3 deletions R/HeumanLambda.R
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#' @title Heuman Lambda function
#' @description Evaluates the Heuman Lambda function.
#'
#' @param phi Jacobi amplitude, a complex number
#' @param m parameter, a complex number
#' @param phi Jacobi amplitude, a complex number/vector
#' @param m parameter, a complex number/vector
#' @param minerror the bound on the relative error passed to
#' \code{\link{elliptic_F}} and \code{\link{elliptic_Z}}
#'
#' @return A complex number.
#' @return A complex number or vector.
#' @export
Lambda0 <- function(phi, m, minerror = 1e-14) {
if(m == 0) {
Expand Down
8 changes: 4 additions & 4 deletions R/elliptic_E.R
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#' Incomplete elliptic integral of the second kind
#' @description Evaluate the incomplete elliptic integral of the second kind.
#'
#' @param phi amplitude, real or complex number
#' @param m parameter, real or complex number
#' @param phi amplitude, real or complex number/vector
#' @param m parameter, real or complex number/vector
#' @param minerror the bound on the relative error passed to
#' \code{\link{Carlson_RF}} and \code{\link{Carlson_RD}}
#'
#' @return A complex number, the value of the incomplete elliptic integral
#' \ifelse{html}{\out{E(&phi;,m)}}{\eqn{E(\phi,m)}{E(phi,m)}}.
#' @return A complex number or vector, the value(s) of the incomplete elliptic
#' integral \ifelse{html}{\out{E(&phi;,m)}}{\eqn{E(\phi,m)}{E(phi,m)}}.
#' @export
#'
#' @examples elliptic_E(1, 0.2)
Expand Down
30 changes: 19 additions & 11 deletions R/elliptic_PI.R
Original file line number Diff line number Diff line change
@@ -1,28 +1,36 @@
#' Incomplete elliptic integral of the third kind
#' @description Evaluate the incomplete elliptic integral of the third kind.
#'
#' @param phi amplitude, real or complex number
#' @param n characteristic, real or complex number
#' @param m parameter, real or complex number
#' @param phi amplitude, real or complex number/vector
#' @param n characteristic, real or complex number/vector
#' @param m parameter, real or complex number/vector
#' @param minerror the bound on the relative error passed to
#' \code{\link{Carlson_RF}} and \code{\link{Carlson_RJ}}
#'
#' @return A complex number, the value of the incomplete elliptic integral
#' @return A complex number or vector, the value(s) of the incomplete elliptic
#' integral
#' \ifelse{html}{\out{&Pi;(&phi;,n,m)}}{\eqn{\Pi(\phi,n,m)}{PI(phi,n,m)}}.
#' @export
#'
#' @examples elliptic_PI(1, 0.8, 0.2)
#' gsl::ellint_P(1, sqrt(0.2), -0.8)
elliptic_PI <- function(phi, n, m, minerror = 1e-15){
elliptic_PI <- function(phi, n, m, minerror = 1e-15) {
phi <- as.complex(phi)
n <- as.complex(n)
m <- as.complex(m)
if(length(phi) == 1L) {
phi <- rep(phi, length(m))
} else if(length(m) == 1L) {
m <- rep(m, length(phi))
} else if(length(phi) != length(m)) {
stop("Incompatible lengths of `phi` and `m`.")
lgths <- c(length(phi), length(n), length(m))
L <- max(lgths)
stopifnot(all(lgths %in% c(1L, L)))
if(L != 1L && any(lgths == 1L)) {
if(length(phi) == 1L) {
phi <- rep(phi, L)
}
if(length(n) == 1L) {
n <- rep(n, L)
}
if(length(m) == 1L) {
m <- rep(m, L)
}
}
ellPIcpp(phi, n, m, minerror)
# if(phi == 0 || (is.infinite(Re(m)) && Im(m) == 0) ||
Expand Down
6 changes: 3 additions & 3 deletions R/elliptic_Z.R
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#' Jacobi zeta function
#' @description Evaluate the Jacobi zeta function.
#'
#' @param phi amplitude, real or complex number
#' @param m parameter, real or complex number
#' @param phi amplitude, real or complex number/vector
#' @param m parameter, real or complex number/vector
#' @param minerror bound on relative error passed to \code{\link{elliptic_E}}
#' and \code{\link{elliptic_F}}
#'
#' @return A complex number, the value of the Jacobi zeta function
#' @return A complex number or vector, the value(s) of the Jacobi zeta function
#' \ifelse{html}{\out{Z(&phi;,m)}}{\eqn{Z(\phi,m)}{Z(phi,m)}}.
#' @export
elliptic_Z <- function(phi, m, minerror = 1e-15) {
Expand Down
6 changes: 3 additions & 3 deletions man/Lambda0.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions man/elliptic_E.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions man/elliptic_F.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions man/elliptic_PI.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions man/elliptic_Z.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1b09a30

Please sign in to comment.