Class Psi

java.lang.Object
gov.nih.mipav.model.algorithms.Psi

public class Psi extends Object

This code calculates the psi function of an input argument x.

A typical real variable usage would be:
 double result[] = new double[1];
 Psi psiTest = new Psi(5.0, result);
 psiTest.run();
 Preferences.debug("Psi(5.0) = " + result[0] + "\n");
 UI.setDataText("Psi(5.0) = " + result[0] + "\n");
 

A typical complex variable usage would be:

 double realResult[] = new double[1];
 double imagResult[] = new double[1];
 Psi psiTest = new Psi(5.0, -1.0, realResult, imagResult);
 psiTest.run();
 Preferences.debug("Psi(5.0,-1.0) = " + realResult[0] + ", " + imagResult[0] + "\n");
 


The FORTRAN code this class is based upon is from Computation of Special Functions by Shanjie Zhang and Jianming Jin and copyright 1996 John Wiley & Sons, Inc.

From the diskette that the FORTRAN code came on:

 DISCLAIMER OF WARRANTY
 
 Although we have made a great effort to test and validate the 
 computer programs, we make no warranties, express or implied, that 
 these  programs  are  free  of  error,  or are consistent with any 
 particular  standard  of  merchantability,  or that they will meet 
 your requirements for any particular application.  They should not 
 be relied on for  solving problems  whose incorrect solution could 
 result in  injury to  a person or loss of property.  If you do use 
 the programs in such a manner, it is at your own risk. The authors 
 and publisher  disclaim all liability for  direct or consequential 
 damages resulting from your use of the programs.
 

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
     
    private double[]
    Imaginary part of output result
    private double
    Imaginary part of input argument
    static final int
     
    private double[]
    Real part of output result
    private double
    Real part of input argument
    private double[]
    output result
    private int
    REAL_VERSION or COMPLEX_VERSION
    private double
    input argument
  • Constructor Summary

    Constructors
    Constructor
    Description
    Psi()
     
    Psi(double x, double[] result)
     
    Psi(double realX, double imagX, double[] realResult, double[] imagResult)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    This code is a port of the FORTRAN routine CPSI from the book Computation of Special Functions by Shanjie Zhang and Jianming Jin, John Wiley invalid input: '&' Sons, Inc., 1996, pp. 59-60.
    void
    Cleanup memory.
    void
    This code is a port of the FORTRAN routine PSI from the book Computation of Special Functions by Shanjie Zhang and Jianming Jin, John Wiley invalid input: '&' Sons, Inc., 1996, pp. 58-59.
    void
    run()
     
    void
     
    void
     

    Methods inherited from class java.lang.Object

    clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • REAL_VERSION

      public static final int REAL_VERSION
      See Also:
    • COMPLEX_VERSION

      public static final int COMPLEX_VERSION
      See Also:
    • x

      private double x
      input argument
    • result

      private double[] result
      output result
    • version

      private int version
      REAL_VERSION or COMPLEX_VERSION
    • realX

      private double realX
      Real part of input argument
    • imagX

      private double imagX
      Imaginary part of input argument
    • realResult

      private double[] realResult
      Real part of output result
    • imagResult

      private double[] imagResult
      Imaginary part of output result
  • Constructor Details

    • Psi

      public Psi()
    • Psi

      public Psi(double x, double[] result)
      Parameters:
      x - Input argument
      result - outputted psi(x)
    • Psi

      public Psi(double realX, double imagX, double[] realResult, double[] imagResult)
      Parameters:
      realX - real part of input argument
      imagX - imaginary part of input argument
      realResult - real part of outputted psi(x)
      imagResult - imaginary part of outputted psi(x)
  • Method Details

    • finalize

      public void finalize() throws Throwable
      Cleanup memory.
      Overrides:
      finalize in class Object
      Throws:
      Throwable - DOCUMENT ME!
    • run

      public void run()
    • testrealPsi

      public void testrealPsi()
    • testcomplexPsi

      public void testcomplexPsi()
    • realPsi

      public void realPsi()
      This code is a port of the FORTRAN routine PSI from the book Computation of Special Functions by Shanjie Zhang and Jianming Jin, John Wiley invalid input: '&' Sons, Inc., 1996, pp. 58-59.
    • complexPsi

      public void complexPsi()
      This code is a port of the FORTRAN routine CPSI from the book Computation of Special Functions by Shanjie Zhang and Jianming Jin, John Wiley invalid input: '&' Sons, Inc., 1996, pp. 59-60.