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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? matrices.pas

?? Delphi 的數(shù)學(xué)控件
?? PAS
?? 第 1 頁 / 共 5 頁
字號:
{ **********************************************************************
  *                          Unit MATRICES.PAS                         *
  *                            Version 2.4d                            *
  *                   (c) J. Debord, September 2003                    *
  **********************************************************************
  This unit implements vector and matrix operations with dynamic arrays.
  There are 10 types available:

    TVector,     TMatrix      for floating point arrays
    TIntVector,  TIntMatrix   for integer arrays
    TCompVector, TCompMatrix  for complex arrays
    TBoolVector, TBoolMatrix  for boolean arrays
    TStrVector,  TStrMatrix   for string arrays

  To use these arrays in your programs, you must:

  (1) Declare variables of the appropriate type, e.g.

         var
           V : TVector;
           A : TMatrix;

  (2) Allocate each array BEFORE using it:

         DimVector(V, N);         creates vector V[0..N]
         DimMatrix(A, N, M);      creates matrix A[0..N, 0..M]
                                  where N, M are two integer variables

         If the allocation succeeds, all array elements are initialized
         to zero (for numeric arrays), False (for boolean arrays), or
         the null string (for string arrays). Otherwise, the array is
         initialized to NIL.

         The Dim... procedure may be used again to redimension the array.

  (3) Use arrays as in standard Pascal, noting that:

      (a) You cannot use the assignment operator (:=) to copy the
          contents of an array into another array. Writing B := A
          simply makes B point to the same memory block than A. You
          must use one of the provided Copy... procedures (see their
          documentation in the interface part of the unit).

      (b) All arrays begin at index 0, so that the 0-indexed element
          is always present, even if you don't use it.

      (c) A matrix is declared as an array of vectors, so that A[I]
          denotes the I-th vector of matrix A and may be used as any
          vector.

  (4) To deallocate an array, assign the value NIL

         V := nil;

  For more information, read the comments of each routine in the
  interface part of the unit, and check the demo programs.
  **********************************************************************
  References :
  1) 'Mathematiques et Statistiques' by H. Haut (PSI ed.) : GaussJordan
     and related functions
  2) EISPACK (http://www.netlib.org/eispack) : SV_Decomp
  3) 'Matrix Computations' by Golub & Van Loan : QR_Decomp & QR_Solve
     (Pascal implementation contributed by Mark Vaughan)
  ********************************************************************** }

unit matrices;

interface

uses
  fmath;

{ **********************************************************************
  This section defines some error codes.
  ********************************************************************** }

const
  MAT_OK       =   0;  { No error }
  MAT_SINGUL   = - 1;  { Singular matrix }
  MAT_NON_CONV = - 2;  { Non convergence of iterative procedure }
  MAT_NOT_PD   = - 3;  { Matrix not positive definite }

{ **********************************************************************
  This section defines the vector and matrix types.
  ********************************************************************** }

type
  TVector     = array of Float;
  TIntVector  = array of Integer;
  TCompVector = array of Complex;
  TBoolVector = array of Boolean;
  TStrVector  = array of String;

  TMatrix     = array of TVector;
  TIntMatrix  = array of TIntVector;
  TCompMatrix = array of TCompVector;
  TBoolMatrix = array of TBoolVector;
  TStrMatrix  = array of TStrVector;

{ **********************************************************************
  This section defines a function of several variables
  ********************************************************************** }

type
  TFuncNVar = function(X : TVector) : Float;

{ **********************************************************************
  Memory allocation routines
  ********************************************************************** }

procedure DimVector(var V : TVector; Ubound : Integer); overload;
{ ----------------------------------------------------------------------
  Creates floating point vector V[0..Ubound]
  ---------------------------------------------------------------------- }

procedure DimVector(var V : TIntVector; Ubound : Integer); overload;
{ ----------------------------------------------------------------------
  Creates integer vector V[0..Ubound]
  ---------------------------------------------------------------------- }

procedure DimVector(var V : TCompVector; Ubound : Integer); overload;
{ ----------------------------------------------------------------------
  Creates complex vector V[0..Ubound]
  ---------------------------------------------------------------------- }

procedure DimVector(var V : TBoolVector; Ubound : Integer); overload;
{ ----------------------------------------------------------------------
  Creates boolean vector V[0..Ubound]
  ---------------------------------------------------------------------- }

procedure DimVector(var V : TStrVector; Ubound : Integer); overload;
{ ----------------------------------------------------------------------
  Creates string vector V[0..Ubound]
  ---------------------------------------------------------------------- }

procedure DimMatrix(var A : TMatrix; Ubound1, Ubound2 : Integer); overload;
{ ----------------------------------------------------------------------
  Creates floating point matrix A[0..Ubound1, 0..Ubound2]
  ---------------------------------------------------------------------- }

procedure DimMatrix(var A : TIntMatrix; Ubound1, Ubound2 : Integer); overload;
{ ----------------------------------------------------------------------
  Creates integer matrix A[0..Ubound1, 0..Ubound2]
  ---------------------------------------------------------------------- }

procedure DimMatrix(var A : TCompMatrix; Ubound1, Ubound2 : Integer); overload;
{ ----------------------------------------------------------------------
  Creates complex matrix A[0..Ubound1, 0..Ubound2]
  ---------------------------------------------------------------------- }

procedure DimMatrix(var A : TBoolMatrix; Ubound1, Ubound2 : Integer); overload;
{ ----------------------------------------------------------------------
  Creates boolean matrix A[0..Ubound1, 0..Ubound2]
  ---------------------------------------------------------------------- }

procedure DimMatrix(var A : TStrMatrix; Ubound1, Ubound2 : Integer); overload;
{ ----------------------------------------------------------------------
  Creates string matrix A[0..Ubound1, 0..Ubound2]
  ---------------------------------------------------------------------- }

{ **********************************************************************
  Routines for copying vectors and matrices
  ----------------------------------------------------------------------
  Lbound, Ubound   : indices of first and last vector elements
  Lbound1, Lbound2 : indices of first matrix element in each dimension
  Ubound1, Ubound2 : indices of last matrix element in each dimension
  ********************************************************************** }

procedure SwapRows(I, K : Integer; A : TMatrix; Lbound, Ubound : Integer);
{ ----------------------------------------------------------------------
  Exchanges rows I and K of matrix A
  ---------------------------------------------------------------------- }

procedure SwapCols(J, K : Integer; A : TMatrix; Lbound, Ubound : Integer);
{ ----------------------------------------------------------------------
  Exchanges columns J and K of matrix A
  ---------------------------------------------------------------------- }

procedure CopyVector(Dest, Source : TVector; Lbound, Ubound : Integer);
{ ----------------------------------------------------------------------
  Copies vector Source into vector Dest
  ---------------------------------------------------------------------- }

procedure CopyMatrix(Dest, Source : TMatrix;
                     Lbound1, Lbound2, Ubound1, Ubound2 : Integer);
{ ----------------------------------------------------------------------
  Copies matrix Source into matrix Dest
  ---------------------------------------------------------------------- }

procedure CopyRowFromVector(Dest : TMatrix; Source : TVector;
                            Lbound, Ubound, Row : Integer);
{ ----------------------------------------------------------------------
  Copies vector Source into line Row of matrix Dest
  ---------------------------------------------------------------------- }

procedure CopyColFromVector(Dest : TMatrix; Source : TVector;
                            Lbound, Ubound, Col : Integer);
{ ----------------------------------------------------------------------
  Copies vector Source into column Col of matrix Dest
  ---------------------------------------------------------------------- }

procedure CopyVectorFromRow(Dest : TVector; Source : TMatrix;
                            Lbound, Ubound, Row : Integer);
{ ----------------------------------------------------------------------
  Copies line Row of matrix Source into vector Dest
  ---------------------------------------------------------------------- }

procedure CopyVectorFromCol(Dest : TVector; Source : TMatrix;
                            Lbound, Ubound, Col : Integer);
{ ----------------------------------------------------------------------
  Copies column Col of matrix Source into vector Dest
  ---------------------------------------------------------------------- }

{ **********************************************************************
  Vector and matrix functions
  ********************************************************************** }

function Min(X : TVector; Lbound, Ubound : Integer) : Float; overload;
{ ----------------------------------------------------------------------
  Returns the lowest value of vector X
  ---------------------------------------------------------------------- }

function Min(X : TIntVector; Lbound, Ubound : Integer) : Integer; overload;
{ ----------------------------------------------------------------------
  Returns the lowest value of integer vector X
  ---------------------------------------------------------------------- }

function Max(X : TVector; Lbound, Ubound : Integer) : Float; overload;
{ ----------------------------------------------------------------------
  Returns the highest value of vector X
  ---------------------------------------------------------------------- }

function Max(X : TIntVector; Lbound, Ubound : Integer) : Integer; overload;
{ ----------------------------------------------------------------------
  Returns the highest value of integer vector X
  ---------------------------------------------------------------------- }

procedure Transpose(A : TMatrix; Lbound1, Lbound2, Ubound1, Ubound2 : Integer;
                    A_t : TMatrix); overload;
{ ----------------------------------------------------------------------
  Transposes a real matrix
  ----------------------------------------------------------------------
  Input parameters : A       = original matrix
                     Lbound1,
                     Lbound2 = indices of 1st matrix elem. in each dim.
                     Ubound1,
                     Ubound2 = indices of last matrix elem. in each dim.
  ----------------------------------------------------------------------
  Output parameter : A_t     = transposed matrix
  ---------------------------------------------------------------------- }

procedure Transpose(A : TIntMatrix;
                    Lbound1, Lbound2, Ubound1, Ubound2 : Integer;
                    A_t : TIntMatrix); overload;
{ ----------------------------------------------------------------------
  Transposes an integer matrix
  ---------------------------------------------------------------------- }

function GaussJordan(A              : TMatrix;
                     B              : TVector;
                     Lbound, Ubound : Integer;
                     A_inv          : TMatrix;
                     X              : TVector;
                     var Det        : Float) : Integer; overload;
{ ----------------------------------------------------------------------
  Solves the system A * X = B (where B and X are vectors)
  by the Gauss-Jordan method
  ----------------------------------------------------------------------
  Input parameters  : A      = system matrix
                      B      = constant vector
                      Lbound = index of first matrix element
                      Ubound = index of last matrix element
  ----------------------------------------------------------------------
  Output parameters : A_inv  = inverse matrix
                      X      = solution vector
                      Det    = determinant of A
  ----------------------------------------------------------------------
  Possible results  : MAT_OK
                      MAT_SINGUL
  ---------------------------------------------------------------------- }

function GaussJordan(A, B                     : TMatrix;
                     Lbound, Ubound1, Ubound2 : Integer;
                     A_inv, X                 : TMatrix;
                     var Det                  : Float) : Integer; overload;
{ ----------------------------------------------------------------------
  Solves the system A * X = B (where B and X are matrices)
  by the Gauss-Jordan method
  ----------------------------------------------------------------------
  Input parameters  : A       = system matrix
                      B       = constant matrix
                      Lbound  = index of first matrix element in A and B
                      Ubound1 = index of last matrix element in A
                      Ubound2 = index of last matrix element in B
  ----------------------------------------------------------------------
  Output parameters : A_inv  = inverse matrix
                      X      = solution matrix
                      Det    = determinant of A
  ----------------------------------------------------------------------
  Possible results  : MAT_OK
                      MAT_SINGUL
  ---------------------------------------------------------------------- }

function InvMat(A              : TMatrix;
                Lbound, Ubound : Integer;
                A_inv          : TMatrix) : Integer;
{ ----------------------------------------------------------------------
  Computes the inverse of a square matrix by the Gauss-Jordan method
  ----------------------------------------------------------------------
  Parameters : as in Gauss-Jordan
  ----------------------------------------------------------------------
  Possible results : MAT_OK
                     MAT_SINGUL
  ---------------------------------------------------------------------- }

function InvDet(A              : TMatrix;
                Lbound, Ubound : Integer;
                A_inv          : TMatrix;
                var Det        : Float) : Integer;
{ ----------------------------------------------------------------------
  Computes the inverse and the determinant of a square matrix
  by the Gauss-Jordan method
  ----------------------------------------------------------------------
  Parameters : as in Gauss-Jordan
  ----------------------------------------------------------------------
  Possible results : MAT_OK
                     MAT_SINGUL
  ---------------------------------------------------------------------- }

function Det(A              : TMatrix;
             Lbound, Ubound : Integer) : Float;
{ ----------------------------------------------------------------------
  Computes the determinant of a square matrix by the Gauss-Jordan method
  ----------------------------------------------------------------------
  Parameters : as in Gauss-Jordan
  ----------------------------------------------------------------------
  Notes : (1) This procedure destroys the original matrix A
          (2) If the matrix is quasi-singular, the value 0 is returned
  ---------------------------------------------------------------------- }

function Cholesky(A : TMatrix; Lbound, Ubound : Integer;
                  L : TMatrix) : Integer;
{ ----------------------------------------------------------------------
  Cholesky decomposition. Factors the symmetric positive definite matrix
  A as a product L * L', where L is a lower triangular matrix. This
  procedure may be used as a test of positive definiteness.
  ----------------------------------------------------------------------
  Input parameters : A      = matrix
                     Lbound = index of first matrix element
                     Ubound = index of last matrix element
  ----------------------------------------------------------------------
  Output parameter : L      = Cholesky factor of matrix A
  ----------------------------------------------------------------------
  Possible results : MAT_OK
                     MAT_NOT_PD
  ---------------------------------------------------------------------- }

 function LU_Decomp(A : TMatrix; Lbound, Ubound : Integer) : Integer; overload;
{ ----------------------------------------------------------------------
  LU decomposition. Factors the square matrix A as a product L * U,
  where L is a lower triangular matrix (with unit diagonal terms) and U
  is an upper triangular matrix. This routine is used in conjunction
  with LU_Solve to solve a system of equations.
  ----------------------------------------------------------------------
  Input parameters : A      = matrix
                     Lbound = index of first matrix element
                     Ubound = index of last matrix element
  ----------------------------------------------------------------------
  Output parameter : A      = contains the elements of L and U
  ----------------------------------------------------------------------
  Possible results : MAT_OK
                     MAT_SINGUL
  ----------------------------------------------------------------------
  NB : This procedure destroys the original matrix A
  ---------------------------------------------------------------------- }

procedure LU_Solve(A : TMatrix; B : TVector; Lbound, Ubound : Integer;
                   X : TVector); overload;
{ ----------------------------------------------------------------------
  Solves a system of equations whose matrix has been transformed by
  LU_Decomp
  ----------------------------------------------------------------------
  Input parameters : A      = result from LU_Decomp
                     B      = constant vector
                     Lbound,
                     Ubound = as in LU_Decomp
  ----------------------------------------------------------------------
  Output parameter : X      = solution vector
  ---------------------------------------------------------------------- }

function LU_Decomp(A : TCompMatrix; Lbound, Ubound : Integer) : Integer; overload;
{ ----------------------------------------------------------------------
  LU decomposition for complex matrices
  ---------------------------------------------------------------------- }

procedure LU_Solve(A : TCompMatrix; B : TCompVector;

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
99国产精品国产精品毛片| 色视频欧美一区二区三区| 亚洲午夜电影在线观看| 国产亚洲精久久久久久| 欧美日韩一区二区欧美激情| 国产一区二区三区在线观看免费 | 欧美一区二区三区小说| 91久久国产最好的精华液| 国产福利91精品一区二区三区| 成人免费一区二区三区视频 | 色综合久久久久久久| 国产91精品在线观看| 精品一区二区三区免费播放| 久久99久久99精品免视看婷婷| 肉肉av福利一精品导航| 亚洲3atv精品一区二区三区| 亚洲高清免费观看| 青青草97国产精品免费观看无弹窗版| 午夜精品福利视频网站| 日韩电影在线观看网站| 精品一区二区三区在线播放视频| 精品在线播放免费| 懂色av一区二区三区蜜臀| 成人午夜av影视| 在线观看精品一区| 欧美日本精品一区二区三区| 欧美mv和日韩mv国产网站| 国产欧美日韩麻豆91| 一区二区三区中文在线观看| 裸体在线国模精品偷拍| 丁香婷婷综合网| 在线观看91精品国产入口| 日韩一区二区三| 亚洲欧洲日韩综合一区二区| 日本欧美一区二区三区乱码 | 久久久久久综合| 亚洲欧美成人一区二区三区| 久久99精品网久久| 日本韩国欧美三级| 久久婷婷国产综合精品青草| 一区二区三区色| 高清视频一区二区| 欧美日本在线视频| 亚洲欧美乱综合| av网站一区二区三区| 日韩一区二区三区视频在线 | 麻豆精品久久久| 色综合欧美在线视频区| 国产亚洲欧美一区在线观看| 婷婷成人激情在线网| 色综合久久久久久久久久久| 久久久久久久综合| 乱一区二区av| 欧美三区免费完整视频在线观看| 国产精品免费人成网站| 精品亚洲国产成人av制服丝袜| 欧美日韩精品一区二区三区四区| 国产精品久久777777| 成人手机电影网| 亚洲欧洲国产专区| 91首页免费视频| 亚洲欧美日韩国产综合| 91在线视频播放| 五月婷婷色综合| 91丨porny丨国产入口| 亚洲人吸女人奶水| 一本一道波多野结衣一区二区| 国产精品久久久久久户外露出| 国产成人午夜99999| 亚洲国产成人一区二区三区| 成人国产精品视频| 最近中文字幕一区二区三区| 色综合久久66| 日韩精品一区第一页| 精品久久人人做人人爽| 国产综合色视频| 日韩美女视频一区| 欧美做爰猛烈大尺度电影无法无天| 亚洲午夜精品一区二区三区他趣| 91麻豆精品国产91久久久久久久久 | 麻豆国产一区二区| 国产精品日韩精品欧美在线| jlzzjlzz国产精品久久| 亚洲精品免费一二三区| 欧美日韩成人综合在线一区二区| 同产精品九九九| 国产性天天综合网| 欧美色欧美亚洲另类二区| 蓝色福利精品导航| 综合欧美亚洲日本| 26uuu国产电影一区二区| 色8久久精品久久久久久蜜| 久久成人久久鬼色| 亚洲一区二区三区四区五区中文| 久久网站最新地址| 欧美日韩国产片| 日韩欧美久久久| 色狠狠综合天天综合综合| 久久精品噜噜噜成人av农村| 一区二区在线观看免费视频播放| 精品国产99国产精品| 欧美日韩亚洲另类| 色先锋aa成人| 成人sese在线| 国产精品综合视频| 精品亚洲欧美一区| 日韩国产高清在线| 亚洲一区二区成人在线观看| 亚洲欧美综合网| 国产精品久久夜| 中文字幕在线免费不卡| 欧美激情在线观看视频免费| 久久亚区不卡日本| 精品久久久久久久人人人人传媒| 欧美肥胖老妇做爰| 欧美丰满高潮xxxx喷水动漫| 4438x亚洲最大成人网| 3751色影院一区二区三区| 欧美日本国产视频| 日韩一级黄色大片| 日韩精品一区二区三区视频在线观看 | 亚洲永久精品国产| 亚洲午夜电影网| 亚洲国产另类av| 亚洲综合在线电影| 婷婷综合另类小说色区| 日本最新不卡在线| 国产福利视频一区二区三区| 处破女av一区二区| 欧美中文字幕亚洲一区二区va在线 | 亚洲一区二区三区爽爽爽爽爽| 亚洲一区免费观看| 免费久久99精品国产| 免费久久精品视频| 国产激情一区二区三区四区 | 成人免费视频视频| 欧美综合色免费| 91精品国产手机| 亚洲一区中文日韩| 久久国产成人午夜av影院| 成人深夜视频在线观看| 在线播放日韩导航| www国产亚洲精品久久麻豆| 欧美国产精品v| 日韩电影在线观看电影| 成人精品视频一区二区三区尤物| 在线观看亚洲a| 国产精品久久久久精k8| 激情综合一区二区三区| 欧美日韩一区二区三区在线| 国产精品素人视频| 久久电影网站中文字幕| 欧美日韩一区高清| 日韩毛片一二三区| 国产不卡高清在线观看视频| 7777精品伊人久久久大香线蕉完整版| 久久精品一区八戒影视| 日本亚洲三级在线| 欧美午夜精品免费| 日韩理论片在线| 高潮精品一区videoshd| 精品国产免费一区二区三区香蕉 | 91精品综合久久久久久| 亚洲妇熟xx妇色黄| 色欧美日韩亚洲| 亚洲精品视频在线看| 91在线观看地址| 中文字幕精品—区二区四季| 久久福利视频一区二区| 日韩欧美国产一二三区| 蜜桃精品视频在线| 久久久久88色偷偷免费| 丁香啪啪综合成人亚洲小说| 国产精品欧美极品| 色婷婷综合五月| 亚洲风情在线资源站| 制服丝袜成人动漫| 久久国产精品免费| 国产精品视频yy9299一区| 99国产欧美另类久久久精品| 最新国产成人在线观看| 欧美日韩大陆一区二区| 久草这里只有精品视频| 国产精品国产精品国产专区不蜜| 色噜噜狠狠色综合欧洲selulu| 亚洲chinese男男1069| 久久亚洲欧美国产精品乐播| 欧美午夜电影网| 免费在线看成人av| 中文字幕亚洲电影| 欧美色精品天天在线观看视频| 精品综合免费视频观看| 1000精品久久久久久久久| 欧美系列日韩一区| 精品一区二区免费看| 亚洲午夜影视影院在线观看| 久久你懂得1024| 欧美精品一卡二卡| 韩国av一区二区三区| 亚洲国产婷婷综合在线精品|