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

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

?? matrices.pas

?? Delphi 的數學控件
?? 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;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩国产欧美在线观看| 欧美成人精品二区三区99精品| 粉嫩aⅴ一区二区三区四区| 在线视频你懂得一区| 亚洲欧美一区二区久久| 国产传媒久久文化传媒| 欧美人伦禁忌dvd放荡欲情| 成人免费视频caoporn| 在线综合亚洲欧美在线视频| 韩国视频一区二区| 在线看一区二区| 国产精品18久久久久久久网站| 亚洲精品高清在线| 国产片一区二区| 精品日韩一区二区三区 | 国产精品一区在线观看你懂的| 一区二区在线观看视频| 久久综合九色综合欧美98| 欧美电影免费观看高清完整版| 国产精品资源在线观看| 亚洲欧美视频在线观看视频| 欧美一级专区免费大片| 国产精品一区专区| 青青草97国产精品免费观看| 亚洲国产精品久久艾草纯爱| 国产精品每日更新在线播放网址| 欧美变态tickle挠乳网站| 欧美日韩中文字幕一区二区| 99re6这里只有精品视频在线观看| 国产在线观看一区二区| 国产主播一区二区| 免播放器亚洲一区| 激情五月激情综合网| 精品制服美女丁香| 国产一区二区在线免费观看| 久久99精品国产91久久来源| 久久精品国产亚洲一区二区三区| 香港成人在线视频| 美女www一区二区| 久久福利视频一区二区| 国产高清亚洲一区| 成人午夜视频网站| 欧美伊人久久大香线蕉综合69| 欧美视频自拍偷拍| 日韩欧美激情在线| 日本一区二区三区四区| 亚洲欧美激情视频在线观看一区二区三区 | 免费一级片91| 韩国一区二区在线观看| 99麻豆久久久国产精品免费优播| 在线一区二区观看| 精品88久久久久88久久久| 国产女人18毛片水真多成人如厕| 综合精品久久久| 天天色综合成人网| 一区二区三区国产| 亚洲乱码中文字幕| 亚洲码国产岛国毛片在线| 日韩精品一区二区在线| 欧美精品久久一区| 欧美精品久久久久久久多人混战 | 欧美aaa在线| 日韩专区在线视频| 狠狠色丁香婷婷综合久久片| 国产精品99久久久久久有的能看| 国产激情一区二区三区| www.成人网.com| 欧美性xxxxx极品少妇| 91精品国产一区二区三区| 日韩欧美中文字幕公布| 亚洲精品一区在线观看| 欧美激情一二三区| 一区二区三区av电影| 日本不卡一区二区| 国产乱淫av一区二区三区| 99久久婷婷国产综合精品电影| 在线观看免费视频综合| 精品久久久久久久人人人人传媒| 国产欧美视频一区二区| 亚洲最新视频在线观看| 捆绑调教一区二区三区| 成人av资源下载| 欧美美女激情18p| 久久精品一区二区三区av| 亚洲精品视频免费看| 日本怡春院一区二区| 成人性生交大合| 欧美一区二区免费视频| 欧美国产日韩在线观看| 日精品一区二区三区| 成人美女在线观看| 91精品国产色综合久久不卡蜜臀| 国产欧美一区二区三区鸳鸯浴| 亚洲丶国产丶欧美一区二区三区| 激情综合五月天| 色94色欧美sute亚洲线路一久| 精品久久久久久久一区二区蜜臀| 亚洲精品成人少妇| 高清av一区二区| 日韩无一区二区| 亚洲激情五月婷婷| 国产又黄又大久久| 欧美日韩亚洲综合在线| 中文字幕av免费专区久久| 奇米影视一区二区三区| 在线观看免费视频综合| 国产精品视频一二三区| 免费欧美日韩国产三级电影| 91小宝寻花一区二区三区| 久久午夜色播影院免费高清| 午夜伦欧美伦电影理论片| 91在线你懂得| 日本一区二区三级电影在线观看| 日本 国产 欧美色综合| 欧美性欧美巨大黑白大战| 国产精品久久久久久久久免费相片 | 久久国产精品色婷婷| 欧美日韩dvd在线观看| 伊人婷婷欧美激情| 成人黄色大片在线观看| 亚洲国产精品二十页| 国产综合色在线| 日韩欧美在线综合网| 亚洲国产精品久久人人爱蜜臀| 91性感美女视频| 亚洲色欲色欲www| av日韩在线网站| 17c精品麻豆一区二区免费| 国产91精品欧美| 久久久av毛片精品| 国内久久婷婷综合| 久久综合狠狠综合久久综合88 | 色天天综合色天天久久| 欧美国产精品专区| 成人app软件下载大全免费| 国产精品美女久久福利网站| 懂色av噜噜一区二区三区av| www一区二区| 国产精品99久久久久久宅男| 久久久久久99久久久精品网站| 黑人巨大精品欧美黑白配亚洲| 精品sm在线观看| 国产呦萝稀缺另类资源| 久久久国产精品不卡| 国产ts人妖一区二区| 欧美高清在线精品一区| caoporn国产一区二区| 国产精品午夜在线观看| 国产99一区视频免费 | 午夜欧美一区二区三区在线播放| 欧美三级在线看| 国产欧美综合在线| 欧美日本不卡视频| 日韩精品一区二区三区中文不卡 | 中文字幕在线一区| 7799精品视频| 色综合一个色综合| 麻豆一区二区三区| 午夜私人影院久久久久| 亚洲色图制服诱惑| 中文子幕无线码一区tr| 亚洲精品第1页| 国产成人午夜99999| 欧美一区二区三区公司| 国产在线播精品第三| 国产精品视频第一区| 色婷婷亚洲综合| 蜜桃av噜噜一区| 国产午夜久久久久| 91国产成人在线| 日韩国产欧美在线视频| 国产亚洲综合色| 在线观看欧美精品| 精品一区二区三区在线观看| 国产精品欧美经典| 欧美三级电影精品| 丁香天五香天堂综合| 亚洲午夜久久久| 精品久久99ma| 色综合久久六月婷婷中文字幕| 日本伊人色综合网| 中文子幕无线码一区tr| 欧美日韩一本到| 国产成人综合网站| 亚洲国产成人精品视频| 欧美成人bangbros| 91久久精品一区二区| 国产一区二区三区美女| 一区二区三区毛片| 国产人成一区二区三区影院| 欧美三级三级三级| 不卡av电影在线播放| 美女看a上一区| 亚洲自拍与偷拍| 中文无字幕一区二区三区 | 国产在线麻豆精品观看| 亚洲另类一区二区| 久久久国产精华| 欧美一区二区啪啪| 在线免费观看视频一区|