procedure TForm1.Button1Click(Sender: TObject);
var
m1:TMatrix4_single;
vi,vo:TVector4_single;
i,j:integer;
begin
stringgrid1.Cells[1,0]:='c0';
stringgrid1.Cells[2,0]:='c1';
stringgrid1.Cells[3,0]:='c2';
stringgrid1.Cells[4,0]:='c3';
stringgrid1.Cells[5,0]:='vi';
stringgrid1.Cells[6,0]:='vo';
stringgrid1.Cells[0,1]:='r0';
stringgrid1.Cells[0,2]:='r1';
stringgrid1.Cells[0,3]:='r2';
stringgrid1.Cells[0,4]:='r3';
stringgrid1.Cells[0,6]:='r0';
stringgrid1.Cells[0,7]:='r1';
stringgrid1.Cells[0,8]:='r2';
stringgrid1.Cells[0,9]:='r3';
m1.init_identity;
m1.data[3,0]:=1;
m1.data[3,1]:=1;
vo.init_zero;
vi.data[0]:=2;
vi.data[1]:=3;
vi.data[2]:=4;
vi.data[3]:=1;
vo:=matvec(m1,vi);
for i:=0 to 3 do
begin
for j:=0 to 3 do
begin
stringgrid1.cells[i+1,j+1]:=floattostr(m1.data[i,j]);
end;
stringgrid1.cells[5,i+1]:=floattostr(vi.data[i]);
stringgrid1.cells[6,i+1]:=floattostr(vo.data[i]);
end;
m1.transpose;
vo:=m1*vi;
for i:=0 to 3 do
begin
for j:=0 to 3 do
begin
stringgrid1.cells[i+1,j+6]:=floattostr(m1.data[i,j]);
end;
stringgrid1.cells[5,i+6]:=floattostr(vi.data[i]);
stringgrid1.cells[6,i+6]:=floattostr(vo.data[i]);
end;
end;