Skip Navigation Links
Numerical Libraries
Linear Algebra
Differential Equations
Optimization
Samples
Skip Navigation Links
Linear Algebra
CSLapack
CSBlas
   1:  #region Translated by Jose Antonio De Santiago-Castillo.
   2:   
   3:  //Translated by Jose Antonio De Santiago-Castillo. 
   4:  //E-mail:JAntonioDeSantiago@gmail.com
   5:  //Web: www.DotNumerics.com
   6:  //
   7:  //Fortran to C# Translation.
   8:  //Translated by:
   9:  //F2CSharp Version 0.71 (November 10, 2009)
  10:  //Code Optimizations: None
  11:  //
  12:  #endregion
  13:   
  14:  using System;
  15:  using DotNumerics.FortranLibrary;
  16:   
  17:  namespace DotNumerics.CSLapack
  18:  {
  19:      /// <summary>
  20:      /// -- LAPACK auxiliary routine (version 3.1) --
  21:      /// Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
  22:      /// November 2006
  23:      /// Purpose
  24:      /// =======
  25:      /// 
  26:      /// DLABAD takes as input the values computed by DLAMCH for underflow and
  27:      /// overflow, and returns the square root of each of these values if the
  28:      /// log of LARGE is sufficiently large.  This subroutine is intended to
  29:      /// identify machines with a large exponent range, such as the Crays, and
  30:      /// redefine the underflow and overflow limits to be the square roots of
  31:      /// the values computed by DLAMCH.  This subroutine is needed because
  32:      /// DLAMCH does not compensate for poor arithmetic in the upper half of
  33:      /// the exponent range, as is found on a Cray.
  34:      /// 
  35:      ///</summary>
  36:      public class DLABAD
  37:      {
  38:      
  39:          public DLABAD()
  40:          {
  41:      
  42:          }
  43:      
  44:          /// <summary>
  45:          /// Purpose
  46:          /// =======
  47:          /// 
  48:          /// DLABAD takes as input the values computed by DLAMCH for underflow and
  49:          /// overflow, and returns the square root of each of these values if the
  50:          /// log of LARGE is sufficiently large.  This subroutine is intended to
  51:          /// identify machines with a large exponent range, such as the Crays, and
  52:          /// redefine the underflow and overflow limits to be the square roots of
  53:          /// the values computed by DLAMCH.  This subroutine is needed because
  54:          /// DLAMCH does not compensate for poor arithmetic in the upper half of
  55:          /// the exponent range, as is found on a Cray.
  56:          /// 
  57:          ///</summary>
  58:          /// <param name="SMALL">
  59:          /// (input/output) DOUBLE PRECISION
  60:          /// On entry, the underflow threshold as computed by DLAMCH.
  61:          /// On exit, if LOG10(LARGE) is sufficiently large, the square
  62:          /// root of SMALL, otherwise unchanged.
  63:          ///</param>
  64:          /// <param name="LARGE">
  65:          /// (input/output) DOUBLE PRECISION
  66:          /// On entry, the overflow threshold as computed by DLAMCH.
  67:          /// On exit, if LOG10(LARGE) is sufficiently large, the square
  68:          /// root of LARGE, otherwise unchanged.
  69:          ///</param>
  70:          public void Run(ref double SMALL, ref double LARGE)
  71:          {
  72:   
  73:              #region Prolog
  74:              
  75:              // *
  76:              // *  -- LAPACK auxiliary routine (version 3.1) --
  77:              // *     Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
  78:              // *     November 2006
  79:              // *
  80:              // *     .. Scalar Arguments ..
  81:              // *     ..
  82:              // *
  83:              // *  Purpose
  84:              // *  =======
  85:              // *
  86:              // *  DLABAD takes as input the values computed by DLAMCH for underflow and
  87:              // *  overflow, and returns the square root of each of these values if the
  88:              // *  log of LARGE is sufficiently large.  This subroutine is intended to
  89:              // *  identify machines with a large exponent range, such as the Crays, and
  90:              // *  redefine the underflow and overflow limits to be the square roots of
  91:              // *  the values computed by DLAMCH.  This subroutine is needed because
  92:              // *  DLAMCH does not compensate for poor arithmetic in the upper half of
  93:              // *  the exponent range, as is found on a Cray.
  94:              // *
  95:              // *  Arguments
  96:              // *  =========
  97:              // *
  98:              // *  SMALL   (input/output) DOUBLE PRECISION
  99:              // *          On entry, the underflow threshold as computed by DLAMCH.
 100:              // *          On exit, if LOG10(LARGE) is sufficiently large, the square
 101:              // *          root of SMALL, otherwise unchanged.
 102:              // *
 103:              // *  LARGE   (input/output) DOUBLE PRECISION
 104:              // *          On entry, the overflow threshold as computed by DLAMCH.
 105:              // *          On exit, if LOG10(LARGE) is sufficiently large, the square
 106:              // *          root of LARGE, otherwise unchanged.
 107:              // *
 108:              // *  =====================================================================
 109:              // *
 110:              // *     .. Intrinsic Functions ..
 111:              //      INTRINSIC          LOG10, SQRT;
 112:              // *     ..
 113:              // *     .. Executable Statements ..
 114:              // *
 115:              // *     If it looks like we're on a Cray, take the square root of
 116:              // *     SMALL and LARGE to avoid overflow and underflow problems.
 117:              // *
 118:   
 119:              #endregion
 120:   
 121:              if (Math.Log10(LARGE) > 2000.0E0)
 122:              {
 123:                  SMALL = Math.Sqrt(SMALL);
 124:                  LARGE = Math.Sqrt(LARGE);
 125:              }
 126:              // *
 127:              return;
 128:              // *
 129:              // *     End of DLABAD
 130:              // *
 131:          }
 132:      }
 133:  }