用于开发税务票据管理的软件

源代码在线查看: unit2.pas

软件大小: 36519 K
上传用户: jill
关键词: 软件
下载地址: 免注册下载 普通下载 VIP

相关代码

				unit Unit2;
				
				interface
				uses
				  Windows, Messages, SysUtils, Classes, Graphics, Controls,unit1, Forms, Dialogs;
				procedure CHOBSB(A:MATRX2; N:integer; D:array of real;var B:array of real);
				procedure CHODCM(A:matrx2; N:integer;var D:array of real; T:array of real);
				implementation
				procedure CHOBSB(A:MATRX2; N:integer; D:array of real;var B:array of real);
				var
				    I,J:integer;  SUM:real;
				begin
				    For I:=1 To N do
				    begin
				        Sum:=B[I];
				        For J:=1 To I - 1 do
				            Sum:=Sum - A[I, J] * B[J];
				        B[I]:=Sum;
				    end;
				    For I:=N DownTo 1 do
				    begin
				        If D[I] = 0 Then
				        begin
				            ShowMessage('Singular Matrix');
				            Exit;
				        end
				        Else
				            Sum:=B[I] / D[I];
				        For J:=I + 1 To N do
				            Sum:=Sum - A[J, I] * B[J];
				        B[I]:=Sum;
				    end;
				end;
				
				procedure CHODCM(A:matrx2; N:integer;var D:array of real; T:array of real);
				var
				    I,J,K:integer;  SUM:real;
				begin
				    For I:=1 To N do
				    begin
				        Sum:=A[I, I];
				        For J:=1 To I - 1 do
				        begin
				            T[J]:=A[J, I];
				            For K:=1 To J - 1 do
				                T[J]:=T[J] - T[K] * A[J, K];
				            If D[J] = 0 Then
				            begin
				                If T[J]  0 Then
				                    ShowMessage('No Cholesky decomposition')
				                Else
				                    A[I, J]:=1;
				            end
				            Else
				                A[I, J]:=T[J] / D[J];
				            Sum:=Sum - T[J] * A[I, J];
				        end;
				        D[I]:=Sum;
				    end;
				end;
				end.
				 			

相关资源