亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? jama_eig.h

?? 在MATLAB環(huán)境下的level set方法的實現(xiàn)
?? H
?? 第 1 頁 / 共 2 頁
字號:
#ifndef JAMA_EIG_H
#define JAMA_EIG_H


#include "tnt_array1d.h"
#include "tnt_array2d.h"
#include "tnt_math_utils.h"


// using namespace TNT;


namespace JAMA
{

/** 

    Computes eigenvalues and eigenvectors of a real (non-complex)
    matrix. 
<P>
    If A is symmetric, then A = V*D*V' where the eigenvalue matrix D is
    diagonal and the eigenvector matrix V is orthogonal. That is,
	the diagonal values of D are the eigenvalues, and
    V*V' = I, where I is the identity matrix.  The columns of V 
    represent the eigenvectors in the sense that A*V = V*D.
    
<P>
    If A is not symmetric, then the eigenvalue matrix D is block diagonal
    with the real eigenvalues in 1-by-1 blocks and any complex eigenvalues,
    a + i*b, in 2-by-2 blocks, [a, b; -b, a].  That is, if the complex
    eigenvalues look like
<pre>

          u + iv     .        .          .      .    .
            .      u - iv     .          .      .    .
            .        .      a + ib       .      .    .
            .        .        .        a - ib   .    .
            .        .        .          .      x    .
            .        .        .          .      .    y
</pre>
        then D looks like
<pre>

            u        v        .          .      .    .
           -v        u        .          .      .    . 
            .        .        a          b      .    .
            .        .       -b          a      .    .
            .        .        .          .      x    .
            .        .        .          .      .    y
</pre>
    This keeps V a real matrix in both symmetric and non-symmetric
    cases, and A*V = V*D.
    
    
    
    <p>
    The matrix V may be badly
    conditioned, or even singular, so the validity of the equation
    A = V*D*inverse(V) depends upon the condition number of V.

   <p>
	(Adapted from JAMA, a Java Matrix Library, developed by jointly 
	by the Mathworks and NIST; see  http://math.nist.gov/javanumerics/jama).
**/

using TNT::abs;

template <class Real>
class Eigenvalue
{

   /** Row and column dimension (square matrix).  */
    int n;

   int issymmetric; /* boolean*/

   /** Arrays for internal storage of eigenvalues. */

   TNT::Array1D<Real> d;         /* real part */
   TNT::Array1D<Real> e;         /* img part */

   /** Array for internal storage of eigenvectors. */
    TNT::Array2D<Real> V;

   /** Array for internal storage of nonsymmetric Hessenberg form.
   @serial internal storage of nonsymmetric Hessenberg form.
   */
   TNT::Array2D<Real> H;
   

   /** Working storage for nonsymmetric algorithm.
   @serial working storage for nonsymmetric algorithm.
   */
   TNT::Array1D<Real> ort;


   // Symmetric Householder reduction to tridiagonal form.

   void tred2() {

   //  This is derived from the Algol procedures tred2 by
   //  Bowdler, Martin, Reinsch, and Wilkinson, Handbook for
   //  Auto. Comp., Vol.ii-Linear Algebra, and the corresponding
   //  Fortran subroutine in EISPACK.

      for (int j = 0; j < n; j++) {
         d[j] = V[n-1][j];
      }

      // Householder reduction to tridiagonal form.
   
      for (int i = n-1; i > 0; i--) {
   
         // Scale to avoid under/overflow.
   
         Real scale = 0.0;
         Real h = 0.0;
         for (int k = 0; k < i; k++) {
            scale = scale + abs(d[k]);
         }
         if (scale == 0.0) {
            e[i] = d[i-1];
            for (int j = 0; j < i; j++) {
               d[j] = V[i-1][j];
               V[i][j] = 0.0;
               V[j][i] = 0.0;
            }
         } else {
   
            // Generate Householder vector.
   
            for (int k = 0; k < i; k++) {
               d[k] /= scale;
               h += d[k] * d[k];
            }
            Real f = d[i-1];
            Real g = sqrt(h);
            if (f > 0) {
               g = -g;
            }
            e[i] = scale * g;
            h = h - f * g;
            d[i-1] = f - g;
            for (int j = 0; j < i; j++) {
               e[j] = 0.0;
            }
   
            // Apply similarity transformation to remaining columns.
   
            for (int j = 0; j < i; j++) {
               f = d[j];
               V[j][i] = f;
               g = e[j] + V[j][j] * f;
               for (int k = j+1; k <= i-1; k++) {
                  g += V[k][j] * d[k];
                  e[k] += V[k][j] * f;
               }
               e[j] = g;
            }
            f = 0.0;
            for (int j = 0; j < i; j++) {
               e[j] /= h;
               f += e[j] * d[j];
            }
            Real hh = f / (h + h);
            for (int j = 0; j < i; j++) {
               e[j] -= hh * d[j];
            }
            for (int j = 0; j < i; j++) {
               f = d[j];
               g = e[j];
               for (int k = j; k <= i-1; k++) {
                  V[k][j] -= (f * e[k] + g * d[k]);
               }
               d[j] = V[i-1][j];
               V[i][j] = 0.0;
            }
         }
         d[i] = h;
      }
   
      // Accumulate transformations.
   
      for (int i = 0; i < n-1; i++) {
         V[n-1][i] = V[i][i];
         V[i][i] = 1.0;
         Real h = d[i+1];
         if (h != 0.0) {
            for (int k = 0; k <= i; k++) {
               d[k] = V[k][i+1] / h;
            }
            for (int j = 0; j <= i; j++) {
               Real g = 0.0;
               for (int k = 0; k <= i; k++) {
                  g += V[k][i+1] * V[k][j];
               }
               for (int k = 0; k <= i; k++) {
                  V[k][j] -= g * d[k];
               }
            }
         }
         for (int k = 0; k <= i; k++) {
            V[k][i+1] = 0.0;
         }
      }
      for (int j = 0; j < n; j++) {
         d[j] = V[n-1][j];
         V[n-1][j] = 0.0;
      }
      V[n-1][n-1] = 1.0;
      e[0] = 0.0;
   } 

   // Symmetric tridiagonal QL algorithm.
   
   void tql2 () {

   //  This is derived from the Algol procedures tql2, by
   //  Bowdler, Martin, Reinsch, and Wilkinson, Handbook for
   //  Auto. Comp., Vol.ii-Linear Algebra, and the corresponding
   //  Fortran subroutine in EISPACK.
   
      for (int i = 1; i < n; i++) {
         e[i-1] = e[i];
      }
      e[n-1] = 0.0;
   
      Real f = 0.0;
      Real tst1 = 0.0;
      Real eps = pow(2.0,-52.0);
      for (int l = 0; l < n; l++) {

         // Find small subdiagonal element
   
         tst1 = TNT::max(tst1,abs(d[l]) + abs(e[l]));
         int m = l;

        // Original while-loop from Java code
         while (m < n) {
            if (abs(e[m]) <= eps*tst1) {
               break;
            }
            m++;
         }

   
         // If m == l, d[l] is an eigenvalue,
         // otherwise, iterate.
   
         if (m > l) {
            int iter = 0;
            do {
               iter = iter + 1;  // (Could check iteration count here.)
   
               // Compute implicit shift
   
               Real g = d[l];
               Real p = (d[l+1] - g) / (2.0 * e[l]);
               Real r = hypot(p,1.0);
               if (p < 0) {
                  r = -r;
               }
               d[l] = e[l] / (p + r);
               d[l+1] = e[l] * (p + r);
               Real dl1 = d[l+1];
               Real h = g - d[l];
               for (int i = l+2; i < n; i++) {
                  d[i] -= h;
               }
               f = f + h;
   
               // Implicit QL transformation.
   
               p = d[m];
               Real c = 1.0;
               Real c2 = c;
               Real c3 = c;
               Real el1 = e[l+1];
               Real s = 0.0;
               Real s2 = 0.0;
               for (int i = m-1; i >= l; i--) {
                  c3 = c2;
                  c2 = c;
                  s2 = s;
                  g = c * e[i];
                  h = c * p;
                  r = hypot(p,e[i]);
                  e[i+1] = s * r;
                  s = e[i] / r;
                  c = p / r;
                  p = c * d[i] - s * g;
                  d[i+1] = h + s * (c * g + s * d[i]);
   
                  // Accumulate transformation.
   
                  for (int k = 0; k < n; k++) {
                     h = V[k][i+1];
                     V[k][i+1] = s * V[k][i] + c * h;
                     V[k][i] = c * V[k][i] - s * h;
                  }
               }
               p = -s * s2 * c3 * el1 * e[l] / dl1;
               e[l] = s * p;
               d[l] = c * p;
   
               // Check for convergence.
   
            } while (abs(e[l]) > eps*tst1);
         }
         d[l] = d[l] + f;
         e[l] = 0.0;
      }
     
      // Sort eigenvalues and corresponding vectors.
   
      for (int i = 0; i < n-1; i++) {
         int k = i;
         Real p = d[i];
         for (int j = i+1; j < n; j++) {
            if (d[j] < p) {
               k = j;
               p = d[j];
            }
         }
         if (k != i) {
            d[k] = d[i];
            d[i] = p;
            for (int j = 0; j < n; j++) {
               p = V[j][i];
               V[j][i] = V[j][k];
               V[j][k] = p;
            }
         }
      }
   }

   // Nonsymmetric reduction to Hessenberg form.

   void orthes () {
   
      //  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.
   
      int low = 0;
      int high = n-1;
   
      for (int m = low+1; m <= high-1; m++) {
   
         // Scale column.
   
         Real scale = 0.0;
         for (int i = m; i <= high; i++) {
            scale = scale + abs(H[i][m-1]);
         }
         if (scale != 0.0) {
   
            // Compute Householder transformation.
   
            Real h = 0.0;
            for (int i = high; i >= m; i--) {
               ort[i] = H[i][m-1]/scale;
               h += ort[i] * ort[i];
            }
            Real g = sqrt(h);
            if (ort[m] > 0) {
               g = -g;
            }
            h = h - ort[m] * g;
            ort[m] = ort[m] - g;
   
            // Apply Householder similarity transformation
            // H = (I-u*u'/h)*H*(I-u*u')/h)
   
            for (int j = m; j < n; j++) {
               Real f = 0.0;
               for (int i = high; i >= m; i--) {
                  f += ort[i]*H[i][j];
               }
               f = f/h;
               for (int i = m; i <= high; i++) {
                  H[i][j] -= f*ort[i];
               }
           }
   
           for (int i = 0; i <= high; i++) {
               Real f = 0.0;
               for (int j = high; j >= m; j--) {
                  f += ort[j]*H[i][j];
               }
               f = f/h;
               for (int j = m; j <= high; j++) {
                  H[i][j] -= f*ort[j];
               }
            }
            ort[m] = scale*ort[m];
            H[m][m-1] = scale*g;
         }
      }
   
      // Accumulate transformations (Algol's ortran).

      for (int i = 0; i < n; i++) {
         for (int j = 0; j < n; j++) {
            V[i][j] = (i == j ? 1.0 : 0.0);
         }
      }

      for (int m = high-1; m >= low+1; m--) {
         if (H[m][m-1] != 0.0) {
            for (int i = m+1; i <= high; i++) {
               ort[i] = H[i][m-1];
            }
            for (int j = m; j <= high; j++) {
               Real g = 0.0;
               for (int i = m; i <= high; i++) {
                  g += ort[i] * V[i][j];
               }
               // Double division avoids possible underflow
               g = (g / ort[m]) / H[m][m-1];
               for (int i = m; i <= high; i++) {
                  V[i][j] += g * ort[i];
               }
            }
         }
      }
   }


   // Complex scalar division.

   Real cdivr, cdivi;
   void cdiv(Real xr, Real xi, Real yr, Real yi) {
      Real r,d;
      if (abs(yr) > abs(yi)) {
         r = yi/yr;
         d = yr + r*yi;
         cdivr = (xr + r*xi)/d;
         cdivi = (xi - r*xr)/d;
      } else {
         r = yr/yi;
         d = yi + r*yr;
         cdivr = (r*xr + xi)/d;
         cdivi = (r*xi - xr)/d;
      }
   }


   // Nonsymmetric reduction from Hessenberg to real Schur form.

   void hqr2 () {
   
      //  This is derived from the Algol procedure hqr2,
      //  by Martin and Wilkinson, Handbook for Auto. Comp.,
      //  Vol.ii-Linear Algebra, and the corresponding
      //  Fortran subroutine in EISPACK.
   
      // Initialize
   
      int nn = this->n;
      int n = nn-1;
      int low = 0;
      int high = nn-1;
      Real eps = pow(2.0,-52.0);
      Real exshift = 0.0;
      Real p=0,q=0,r=0,s=0,z=0,t,w,x,y;
   
      // Store roots isolated by balanc and compute matrix norm
   
      Real norm = 0.0;
      for (int i = 0; i < nn; i++) {
         if ((i < low) || (i > high)) {
            d[i] = H[i][i];
            e[i] = 0.0;
         }
         for (int j = TNT::max(i-1,0); j < nn; j++) {
            norm = norm + abs(H[i][j]);
         }
      }
   
      // Outer loop over eigenvalue index
   
      int iter = 0;
      while (n >= low) {
   
         // Look for single small sub-diagonal element
   
         int l = n;
         while (l > low) {
            s = abs(H[l-1][l-1]) + abs(H[l][l]);
            if (s == 0.0) {
               s = norm;
            }
            if (abs(H[l][l-1]) < eps * s) {
               break;
            }
            l--;
         }
       
         // Check for convergence
         // One root found
   
         if (l == n) {
            H[n][n] = H[n][n] + exshift;
            d[n] = H[n][n];
            e[n] = 0.0;
            n--;
            iter = 0;
   
         // Two roots found
   
         } else if (l == n-1) {
            w = H[n][n-1] * H[n-1][n];

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美三级日韩三级| 粉嫩av一区二区三区在线播放 | 奇米影视在线99精品| 欧美日韩aaaaa| 奇米影视在线99精品| 精品噜噜噜噜久久久久久久久试看| 亚洲国产精品综合小说图片区| 欧美日韩aaaaa| 精品在线观看免费| 久久影音资源网| 成人污视频在线观看| 久久久久久久综合日本| 国产精品123区| 亚洲乱码中文字幕| 欧美自拍丝袜亚洲| 美腿丝袜亚洲色图| 国产欧美日韩在线观看| 91免费在线看| 免费观看在线色综合| 久久精品网站免费观看| av在线不卡电影| 一区二区三区.www| 91精品国产综合久久香蕉麻豆| 久久精品国产精品青草| 欧美国产精品中文字幕| 色偷偷88欧美精品久久久| 男男gaygay亚洲| 国产精品全国免费观看高清 | 亚洲第一久久影院| 欧美一区二区视频观看视频 | 中文字幕亚洲不卡| 91精品国产入口| 99精品视频在线播放观看| 五月天欧美精品| 国产精品亲子伦对白| 欧美精品一级二级三级| 丁香一区二区三区| 日韩激情一区二区| 亚洲天堂av一区| 久久综合国产精品| 欧美日本在线看| 91蜜桃免费观看视频| 国产综合久久久久影院| 亚洲午夜视频在线观看| 国产欧美日韩不卡| 91精品国产欧美一区二区成人| 波多野结衣亚洲| 国产色91在线| 99久久99久久精品免费观看| 国产精品超碰97尤物18| 男男gaygay亚洲| 国产成人精品影院| 欧美精品一区二区三区蜜臀 | 亚洲一级二级在线| 美洲天堂一区二卡三卡四卡视频 | 成人福利电影精品一区二区在线观看| 久久国产精品第一页| 亚洲国产你懂的| 在线播放亚洲一区| 中文字幕不卡一区| av一本久道久久综合久久鬼色| 一区二区三区国产豹纹内裤在线| 精品视频1区2区3区| 亚洲超丰满肉感bbw| 不卡视频一二三| 国产欧美日韩三级| 日韩欧美激情在线| 国产一区 二区 三区一级| 国产精品三级av| 综合婷婷亚洲小说| 99久久久国产精品免费蜜臀| 99久久精品免费看国产免费软件| 国产日产精品一区| 欧美日韩一区二区三区不卡| 99re成人精品视频| 99re成人精品视频| 136国产福利精品导航| 国产精品乱人伦| 国产精品久久午夜夜伦鲁鲁| 国产精品色婷婷| 久久精品人人做人人爽人人| 精品久久久三级丝袜| 日韩欧美综合一区| 欧美成人猛片aaaaaaa| 26uuu国产一区二区三区| 26uuu国产日韩综合| 国产精品视频一区二区三区不卡| 国产欧美日韩在线看| 亚洲欧洲精品天堂一级| 一区二区在线观看视频在线观看| 一级女性全黄久久生活片免费| 国产精品欧美一区喷水| 一区二区三区视频在线观看| 亚洲成人综合网站| 日韩电影网1区2区| 久久国产尿小便嘘嘘尿| 国产成人三级在线观看| 99久久er热在这里只有精品66| 日本大香伊一区二区三区| 欧美日韩成人在线一区| 精品国产在天天线2019| 国产精品情趣视频| 一区二区三区美女| 久久99久久99小草精品免视看| 国产91丝袜在线18| 成人av在线播放网址| 欧美色综合天天久久综合精品| 欧美高清性hdvideosex| 久久久久久久综合| 亚洲综合一二区| 经典三级视频一区| 91国产成人在线| 精品日韩一区二区三区免费视频| 国产精品久久一级| 日本sm残虐另类| 成人av电影免费在线播放| 欧美日韩不卡一区二区| 欧美激情在线观看视频免费| 亚洲美女屁股眼交3| 另类小说综合欧美亚洲| 99国产精品久| 欧美本精品男人aⅴ天堂| 亚洲欧美日韩人成在线播放| 麻豆精品视频在线观看| 91网站黄www| 精品粉嫩aⅴ一区二区三区四区| 最近日韩中文字幕| 精品综合免费视频观看| 在线欧美日韩精品| 国产欧美日韩亚州综合| 奇米影视在线99精品| 国产v日产∨综合v精品视频| 欧美三级电影在线观看| 国产精品欧美精品| 久久精品国产亚洲a| 欧美性猛交xxxxxx富婆| 国产精品三级在线观看| 裸体歌舞表演一区二区| 欧美亚洲精品一区| 国产精品国产a| 国产91清纯白嫩初高中在线观看| 欧美一区二区网站| 一二三区精品视频| eeuss鲁片一区二区三区在线看| 国产农村妇女毛片精品久久麻豆| 亚洲国产一区二区三区| 92精品国产成人观看免费| 久久久777精品电影网影网| 久久精工是国产品牌吗| 欧美高清你懂得| 亚洲国产一区二区a毛片| 91丨porny丨蝌蚪视频| 亚洲国产精品黑人久久久| 黑人精品欧美一区二区蜜桃| 91精品福利在线一区二区三区| 亚洲国产婷婷综合在线精品| 99久久99久久精品国产片果冻| 国产欧美日本一区二区三区| 国产毛片精品国产一区二区三区| 日韩欧美高清dvd碟片| 日本va欧美va瓶| 日韩免费在线观看| 麻豆国产91在线播放| 欧美一卡2卡三卡4卡5免费| 日本在线播放一区二区三区| 欧美另类高清zo欧美| 亚洲va欧美va人人爽| 欧美久久一二区| 日本强好片久久久久久aaa| 欧美精品tushy高清| 日韩黄色在线观看| 日韩一区二区免费在线电影| 久久99精品久久久久婷婷| 26uuu欧美| 国产成人午夜精品影院观看视频| 国产婷婷精品av在线| 成人丝袜18视频在线观看| 中文字幕二三区不卡| 色婷婷av一区二区三区gif| 亚洲一级二级三级在线免费观看| 欧美日韩国产影片| 免费观看在线色综合| 久久久久久黄色| www.欧美色图| 亚洲va在线va天堂| 日韩精品一区二区三区视频播放| 国产一区二区不卡老阿姨| 国产精品乱码人人做人人爱 | 日本不卡123| 久久久久久亚洲综合影院红桃| 成人免费视频一区| 亚洲一区二区影院| 日韩一区二区三区视频| 国产精品一级片| 亚洲裸体xxx| 日韩免费电影一区| 成人激情午夜影院| 偷拍一区二区三区| 国产日韩欧美精品一区| 色域天天综合网|