0% found this document useful (0 votes)
344 views2 pages

Determinan Matriks

This Pascal/Delphi source code defines a function to calculate the determinant of an n x n matrix. The function takes a two dimensional array representing the matrix and its order as parameters. It initializes the determinant to 1 and iterates through the matrix, searching for the pivot element in each row. It performs row operations to convert the matrix to an upper triangular form and multiplies the diagonal elements to calculate the final determinant value.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
344 views2 pages

Determinan Matriks

This Pascal/Delphi source code defines a function to calculate the determinant of an n x n matrix. The function takes a two dimensional array representing the matrix and its order as parameters. It initializes the determinant to 1 and iterates through the matrix, searching for the pivot element in each row. It performs row operations to convert the matrix to an upper triangular form and multiplies the diagonal elements to calculate the final determinant value.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

INVERS MATRIKS BERORDO n x n Source Code (Pascal / Delphi) function TfmMain.cariDeterminan( matriks : array [1..100,1..

100] of real; ordo : integer; ):real; var i,j,k,r : integer; pivot,m,det,tampung : real; singular:boolean; Begin det:=1; k:=1; singular:=false; while (k<=ordo) and (not singular) do begin {menentukan elemen pivot} pivot:=matriks[k,k]; r:=k; for i:=k+1 to ordo do if Abs(matriks[i,k]) > Abs(pivot) then begin pivot:=matriks[i,k]; r:=i; end; if pivot=0 then Begin singular:=true; det:=0; End else Begin if r>k then begin det:=-det; for i:=1 to ordo do begin tampung:=matriks[k,i]; matriks[k,i]:=matriks[r,i]; matriks[r,i]:=tampung; end; end; for i:=k+1 to ordo do

begin m:=matriks[i,k] / matriks[k,k]; for j:=1 to ordo do Begin matriks[i,j]:=matriks[i,j]-m*matriks[k,j]; End; end; end; k:=k+1; End; for i:=1 to ordo do det:=det*matriks[i,i]; cariDeterminan := det; end; Dirangkum kembali oleh : Mahendra Data

Referensi : Source ini dibuat oleh dosen Jurusan Matematika Universitas Brawijaya, Bapak Syaiful Anam.

You might also like