Matrix.pas in mathematicssmallhelp


tool commonly used mathematical calculations...Original Link
    Sponsored links

			
unit Matrix;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  ExtCtrls,stdctrls, buttons,  grids, Menus, comctrls;

type
  TMatrix = array of array of Extended;
  TDataToFloatFun=function (Str:String; var Value:Extended):Boolean of Object;

//------------------------------------
Type
 TMatrixS=Array of TMatrix;
var
 MatrixErrStr:String;

procedure FreeMatrix(var Matrix:TMatrix);

//转置矩阵
function RollMatrix(Matrix:TMatrix; var Value:TMatrix):Boolean;
//求方阵行列式
function AbsMatrix(Matrix:TMatrix; var Value:Extended):Boolean;
//
function IsMatrixOdd(Matrix:TMatrix):Boolean;
//求方阵的逆
function AthWart(Matrix:TMatrix; var Value:TMatrix):Boolean;
//将Matrix1与Matrix2相加(Anti=False)或相减(Anti=True)
function AddMatrix(Matrix1,Matrix2:TMatrix; var Value:TMatrix; Anti:Boolean=False):Boolean;//加法
//将Matrix1(M*K)和Matrix2(K*N)相乘得Value(M*N)
function MulMatrix(Matrix1,Matrix2:TMatrix; var Value:TMatrix):Boolean;  //乘法

//用选主元的高斯消元法求A*X=B 的X方程解
function SysLin(A,B:TMatrix; var X:TMatrix):Boolean;
//用松弛迭代法解方程
function SorGS(A,B:TMatrix; Var X:TMatrix; W,V:Extended; N:Integer):Boolean;

implementation
uses Math,ZXDDialogs;

type
 PMatCom=^TMatCom;
 TMatCom=Array of Record
          Matrix:TMatrix;
          FunIndex:Byte;
          NexFun:Byte;
          Fun:PMatCom;
         end;
procedure FreeMatrix(var Matrix:TMatrix);
//var i:Integer;
begin// for i:=0 to High(Matrix) do SetLength(Matrix[i],0);
 SetLength(Matrix,0,0);
end;
    //转置     行列式值  逆          加          减          乘
const _Roll=1; _Abs=2;  _athwart=3; _Add=128+1; _Sub=128+2; _Mul=128+3;
      ReserveStrCount=12;
      ReserveStr:Array [0..ReserveStrCount-1] of String=('ROLLMAT','ABSMAT','ATHWART',
                       '+','-','*','(',')','[',']','{','}');

function RollMatrix(Matrix:TMatrix; var Value:TMatrix):Boolean;
var
 W,H,i,j:Integer;
			

			...
			...
			... to be continued.

  This is a preview. To get the complete source file, 
  please click here to download the whole source code package.

			
			


Project Files

    Sponsored links
NameSizeDate
 <数学小帮手>0.00 B11-01-05 09:31
 AutoSaveDesk.dcr480.00 B18-09-01 11:19
 AutoSaveDesk.pas14.46 kB18-06-02 21:17
 DataMaker.pas44.69 kB18-06-02 21:25
 HighLightedMemo.dcr488.00 B30-07-01 16:05
 HighlightedMemo.pas8.69 kB18-06-02 11:24
 HSBitMapSD.pas14.07 kB18-06-02 21:25
 Matrix.pas11.63 kB18-06-02 21:26
 PackageZXD.cfg286.00 B18-06-02 11:27
 PackageZXD.dof1.03 kB18-06-02 11:27
 PackageZXD.dpk786.00 B18-06-02 11:26
 PackageZXD.res1.50 kB18-06-02 11:25
 PScMain.cfg386.00 B18-06-02 21:28
 PScMain.dof1.07 kB18-06-02 21:28
 PScMain.dpr202.00 B21-03-02 16:30
 PScMain.res876.00 B18-06-02 21:28
 ScienceDraw.dcr480.00 B30-03-01 10:44
 ScienceDraw.pas48.17 kB18-06-02 11:21
 UnitMain.ddp51.00 B18-06-02 11:27
 UnitMain.dfm189.78 kB18-06-02 11:27
 UnitMain.pas98.32 kB18-06-02 11:27
 ZXDDialogs.pas4.58 kB18-06-02 21:28
...

Related Items

    Sponsored links