Package jdistlib.math

Class LinPack

java.lang.Object
jdistlib.math.LinPack

public class LinPack extends Object

Routines that I took from LINPACK library. So far, only dpbfa and dpbsl are taken. I hand-translated them from FORTRAN. I don't change the method names, just in case if you people are familiar with it already. Also, please pay attention to the parameter names. I removed all superfluous indices.

See: http://www.netlib.org/linpack/

  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static final int
    dpbfa(double[][] abd, int m)
    dpbfa factors a double precision symmetric positive definite matrix stored in band form.
    static final void
    dpbsl(double[][] abd, int m, double[] b)
    dpbsl solves the double precision symmetric positive definite band system a*x = b using the factors computed by dpbco or dpbfa.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • LinPack

      public LinPack()
  • Method Details

    • dpbsl

      public static final void dpbsl(double[][] abd, int m, double[] b)

      dpbsl solves the double precision symmetric positive definite band system a*x = b using the factors computed by dpbco or dpbfa.

      (Taken from LINPACK_D)

      On return

      error condition
       a division by zero will occur if the input factor contains
       a zero on the diagonal.  technically this indicates singularity
       but it is usually caused by improper subroutine arguments.
       it will not occur if the subroutines are called correctly and  info == 0 .
       
       to compute  inverse(a) * c  where  c  is a matrix with  p  columns
       
       call dpbco(abd,lda,n,rcond,z,info)
       if (rcond is too small .or. info .ne. 0) go to ...
          do 10 j = 1, p
             call dpbsl(abd,lda,n,c(1,j))
          10 continue
       
       linpack.  this version dated 08/14/78
       cleve moler, university of new mexico, argonne national lab.
       
      Parameters:
      abd - Banded matrix. (the output from dpbco or dpbfa)
      m - Band width (the number of diagonals above the main diagonal)
      b - the Y vector. Holds the output after the routine ends. (the right hand side vector)
    • dpbfa

      public static final int dpbfa(double[][] abd, int m)

      dpbfa factors a double precision symmetric positive definite matrix stored in band form.

      dpbfa is usually called by dpbco, but it can be called directly with a saving in time if rcond is not needed.

      (Taken from LINPACK_D)

       on entry
       abd     double precision(lda, n)
               the matrix to be factored.  the columns of the upper
               triangle are stored in the columns of abd and the
               diagonals of the upper triangle are stored in the
               rows of abd .  see the comments below for details.
       
       lda     integer
               the leading dimension of the array abd. lda must be >= m + 1
       
       n       integer
               the order of the matrix  a .
       
       m       integer
               the number of diagonals above the main diagonal. 0 <= m < n
       
       on return
       abd     an upper triangular matrix  r , stored in band form, so that a = trans(r)*r .
       info    integer
               = 0  for normal return.
               = k  if the leading minor of order  k  is not positive definite.
       
       band storage
       if  a  is a symmetric positive definite band matrix,
       the following program segment will set up the input.
           m = (band width above diagonal)
           do 20 j = 1, n
              i1 = max0(1, j-m)
              do 10 i = i1, j
                 k = i-j+m+1
                 abd(k,j) = a(i,j)
              10    continue
           20 continue
       linpack.  this version dated 08/14/78 .
       cleve moler, university of new mexico, argonne national lab.
       begin block with ...exits to 40
       
      Parameters:
      abd - Banded matrix
      m - Band width