Learn R Programming

elliptic (version 0.4-13)

as.primitive: Converts basic periods to a primitive pair

Description

Given a pair of basic periods, returns a primitive pair and (optionally) the unimodular transformation used.

Usage

as.primitive(p, n = 3, tol = 1e-05, give.answers = FALSE)
is.primitive(p, n = 3, tol = 1e-05)

Arguments

p
Two element vector containing the two basic periods
n
Maximum magnitude of matrix entries considered
tol
Numerical tolerance used to determine reality of period ratios
give.answers
Boolean, with TRUE meaning to return extra information (unimodular matrix and the magnitudes of the primitive periods) and default FALSE meaning to return just the primitive periods.

Value

  • If give.answers is TRUE, return a list with components
  • MThe unimodular matrix used
  • pThe pair of primitive periods
  • magsThe magnitudes of the primitive periods

Details

Primitive periods are not unique. This function follows Chandrasekharan and others (but not, of course, Abramowitz and Stegun) in demanding that the real part of p1, and the imaginary part of p2, are nonnegative.

References

Chandrasekharan

Examples

Run this code
as.primitive(c(3+5i,2+3i))
as.primitive(c(3+5i,2+3i),n=5)

##Rounding error:
is.primitive(c(1,1i))

## Try
 is.primitive(c(1,1.001i))

Run the code above in your browser using DataLab