private void _nonsymetricOrthes ()
  {
    // This is derived from the Algol procedures orthes and ortran,
    // by Martin and Wilkinson, Handbook for Auto. Comp.,
    // Vol.ii-Linear Algebra, and the corresponding
    // Fortran subroutines in EISPACK.

    final int low = 0;
    final int high = m_nDim - 1;

    for (int m = low + 1; m <= high - 1; m++)
    {
      // Scale column.
      double scale = 0.0;
      for (int i = m; i <= high; i++)
        scale += MathHelper.abs (m_aHessenBerg[i][m - 1]);
      if (scale != 0.0)
      {
        // Compute Householder transformation.
        double h = 0.0;
        for (int i = high; i >= m; i--)
        {
          m_aOrt[i] = m_aHessenBerg[i][m - 1] / scale;
          h += m_aOrt[i] * m_aOrt[i];
        }
        double g = Math.sqrt (h);
        if (m_aOrt[m] > 0)
        {
          g = -g;
        }
        h -= m_aOrt[m] * g;
        m_aOrt[m] = m_aOrt[m] - g;

        // Apply Householder similarity transformation
        // H = (I-u*u'/h)*H*(I-u*u')/h)

        for (int j = m; j < m_nDim; j++)
        {
          double f = 0.0;
          for (int i = high; i >= m; i--)
          {
            f += m_aOrt[i] * m_aHessenBerg[i][j];
          }
          f /= h;
          for (int i = m; i <= high; i++)
          {
            m_aHessenBerg[i][j] -= f * m_aOrt[i];
          }
        }

        for (int i = 0; i <= high; i++)
        {
          double f = 0.0;
          for (int j = high; j >= m; j--)
          {
            f += m_aOrt[j] * m_aHessenBerg[i][j];
          }
          f /= h;
          for (int j = m; j <= high; j++)
          {
            m_aHessenBerg[i][j] -= f * m_aOrt[j];
          }
        }
        m_aOrt[m] = scale * m_aOrt[m];
        m_aHessenBerg[m][m - 1] = scale * g;
      }
    }

    // Accumulate transformations (Algol's ortran).
    for (int i = 0; i < m_nDim; i++)
    {
      final double [] aRow = m_aEigenVector[i];
      for (int j = 0; j < m_nDim; j++)
      {
        aRow[j] = (i == j ? 1d : 0d);
      }
    }

    for (int m = high - 1; m >= low + 1; m--)
    {
      if (m_aHessenBerg[m][m - 1] != 0.0)
      {
        for (int i = m + 1; i <= high; i++)
        {
          m_aOrt[i] = m_aHessenBerg[i][m - 1];
        }
        for (int j = m; j <= high; j++)
        {
          double g = 0.0;
          for (int i = m; i <= high; i++)
          {
            g += m_aOrt[i] * m_aEigenVector[i][j];
          }
          // Double division avoids possible underflow
          g = (g / m_aOrt[m]) / m_aHessenBerg[m][m - 1];
          for (int i = m; i <= high; i++)
          {
            m_aEigenVector[i][j] += g * m_aOrt[i];
          }
        }
      }
    }
  }
private void _nonsymetricOrthes ( ) { final int low = 0 ; final int high = m_nDim - 1 ; for ( int m = low + 1 ; m <= high - 1 ; m ++ ) { double scale = 0.0 ; for ( int i = m ; i <= high ; i ++ ) scale += MathHelper . abs ( m_aHessenBerg [ i ] [ m - 1 ] ) ; if ( scale != 0.0 ) { double h = 0.0 ; for ( int i = high ; i >= m ; i -- ) { m_aOrt [ i ] = m_aHessenBerg [ i ] [ m - 1 ] / scale ; h += m_aOrt [ i ] * m_aOrt [ i ] ; } double g = Math . sqrt ( h ) ; if ( m_aOrt [ m ] > 0 ) { g = - g ; } h -= m_aOrt [ m ] * g ; m_aOrt [ m ] = m_aOrt [ m ] - g ; for ( int j = m ; j < m_nDim ; j ++ ) { double f = 0.0 ; for ( int i = high ; i >= m ; i -- ) { f += m_aOrt [ i ] * m_aHessenBerg [ i ] [ j ] ; } f /= h ; for ( int i = m ; i <= high ; i ++ ) { m_aHessenBerg [ i ] [ j ] -= f * m_aOrt [ i ] ; } } for ( int i = 0 ; i <= high ; i ++ ) { double f = 0.0 ; for ( int j = high ; j >= m ; j -- ) { f += m_aOrt [ j ] * m_aHessenBerg [ i ] [ j ] ; } f /= h ; for ( int j = m ; j <= high ; j ++ ) { m_aHessenBerg [ i ] [ j ] -= f * m_aOrt [ j ] ; } } m_aOrt [ m ] = scale * m_aOrt [ m ] ; m_aHessenBerg [ m ] [ m - 1 ] = scale * g ; } } for ( int i = 0 ; i < m_nDim ; i ++ ) { final double [ ] aRow = m_aEigenVector [ i ] ; for ( int j = 0 ; j < m_nDim ; j ++ ) { aRow [ j ] = ( i == j ? 1d : 0d ) ; } } for ( int m = high - 1 ; m >= low + 1 ; m -- ) { if ( m_aHessenBerg [ m ] [ m - 1 ] != 0.0 ) { for ( int i = m + 1 ; i <= high ; i ++ ) { m_aOrt [ i ] = m_aHessenBerg [ i ] [ m - 1 ] ; } for ( int j = m ; j <= high ; j ++ ) { double g = 0.0 ; for ( int i = m ; i <= high ; i ++ ) { g += m_aOrt [ i ] * m_aEigenVector [ i ] [ j ] ; } g = ( g / m_aOrt [ m ] ) / m_aHessenBerg [ m ] [ m - 1 ] ; for ( int i = m ; i <= high ; i ++ ) { m_aEigenVector [ i ] [ j ] += g * m_aOrt [ i ] ; } } } } }
Nonsymmetric reduction to Hessenberg form.