Class GenFn

java.lang.Object
  extended by GenFn

public class GenFn
extends java.lang.Object

Class GenFn computes approximations to a function λ(z) to be used in Theorem 3.3, for a specified transition function file, and then computes the corresponding bounds on γ.
In the comments in the code, the notation APPROX(e,n), where e is some expression and n is an integer, denotes the statement that the ratio between the computed numerical value of e and the exact value the expression e would have if all arithmetic were exact (starting with the given value of z and the computed values of v) lies in (ρ-nn), where ρ=1+2-52.


Field Summary
(package private)  int h
          The history length.
(package private)  double maxRatio
          The maximum ratio by which any component of v increases this iteration.
(package private)  double minRatio
          The minimum ratio by which any component of v increases this iteration.
(package private)  int numberOfAcceptingStates
          The number of states, not including the rejecting state
static double TOLERANCE
          The factor controlling how close the ratios between elements of two successive vectors must be before we stop iterating.
(package private)  double[] v
          The last approximation to an eigenvector of Az; see Section 3.1 in the paper.
(package private) static int verbosity
          This controls the level of output.
(package private)  double[] vNew
          The next approximation to an eigenvector of Az.
(package private)  double[] wmuz
          wmuz is computed in method lambda by wmuz[h+i] = wμ,z(Tc,i), where wμ,z is as defined in Section 3.1, and μ and Tc,i are as defined in the overview of the code.
 
Constructor Summary
GenFn(java.lang.String filename)
          Initialize the structure to compute λ values corresponding to the transition function represented in file filename.
 
Method Summary
 void dumpEigen(double z)
          Dump the current approximation to the eigenvector to the file eigen<h>.bin.
 void iterate()
          Carry out one iteration: multiply Az and v, and rescale.
 double lambda(double z)
          Compute a numerical approximation to the λ(z) in Theorem 3.3, using the machine encoded in the file filename.
static void logbase(double x, double b, double eb, int denom)
          Compute and print an integer value p such that logbx≤p/denom, attempting to make p as small as possible so that the round-off error verification described in Section 3.2.2 can be performed.
static void main(java.lang.String[] args)
          The main program is used with the command
GenFn <filename> <z0> <z1> <zdelta>
For each z in the range z0 to z1, with a step size of zdelta, it computes lambda(z) and the resulting upper bound on γ, using the transition function stored in ./data/filename.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

verbosity

static int verbosity
This controls the level of output.


TOLERANCE

public static final double TOLERANCE
The factor controlling how close the ratios between elements of two successive vectors must be before we stop iterating.

See Also:
Constant Field Values

h

int h
The history length.


numberOfAcceptingStates

int numberOfAcceptingStates
The number of states, not including the rejecting state


v

double[] v
The last approximation to an eigenvector of Az; see Section 3.1 in the paper. This vector is indexed by the accepting states.


vNew

double[] vNew
The next approximation to an eigenvector of Az. It is computed by multiplying Az and v.


minRatio

double minRatio
The minimum ratio by which any component of v increases this iteration.


maxRatio

double maxRatio
The maximum ratio by which any component of v increases this iteration.


wmuz

double[] wmuz
wmuz is computed in method lambda by wmuz[h+i] = wμ,z(Tc,i), where wμ,z is as defined in Section 3.1, and μ and Tc,i are as defined in the overview of the code.

Constructor Detail

GenFn

public GenFn(java.lang.String filename)
      throws java.io.IOException
Initialize the structure to compute λ values corresponding to the transition function represented in file filename.

Throws:
java.io.IOException
Method Detail

lambda

public double lambda(double z)
              throws java.io.IOException
Compute a numerical approximation to the λ(z) in Theorem 3.3, using the machine encoded in the file filename.

Throws:
java.io.IOException

iterate

public void iterate()
             throws java.io.IOException
Carry out one iteration: multiply Az and v, and rescale. Set minRatio (resp. maxRatio) to the minimum (resp. maximum) ratio by which any entry in v increases under this multiplication.

Throws:
java.io.IOException

logbase

public static void logbase(double x,
                           double b,
                           double eb,
                           int denom)
Compute and print an integer value p such that logbx≤p/denom, attempting to make p as small as possible so that the round-off error verification described in Section 3.2.2 can be performed. Parameter b and eb must be satisfy APPROX(b,eb); parameter x is assumed to be exact.


dumpEigen

public void dumpEigen(double z)
               throws java.io.IOException
Dump the current approximation to the eigenvector to the file eigen<h>.bin.

Throws:
java.io.IOException

main

public static void main(java.lang.String[] args)
                 throws java.io.IOException
The main program is used with the command
GenFn <filename> <z0> <z1> <zdelta>
For each z in the range z0 to z1, with a step size of zdelta, it computes lambda(z) and the resulting upper bound on γ, using the transition function stored in ./data/filename.

Throws:
java.io.IOException