View Single Post
  #25   Report Post  
Posted to microsoft.public.access,microsoft.public.excel,microsoft.public.excel.programming,microsoft.public.word.vba
[email protected] aaron.kempf@gmail.com is offline
external usenet poster
 
Posts: 39
Default PLEASE READ IF YOU PROGRAM: Help Continue Visual Basic

http://www.ma.utexas.edu/mpej/Vol/1/...inear/minverse

i'd translate this from java into vb or TSQL. and then use it in a
database? i'd keep the function in one place and it would be hella easy
to use.

technically how would i do this?

i'd take my handy-dandy MSDE install (free with windows basically) and
make a UDF that did this.
then i could take my precious little function and use it whenever i
wanted; and my friends could share it with me.

you see-- databases are designed for multiple users.
your gay-ass spreadsheet program can't even handle a single power user.


procedure minverse(var m1,m2: matrix);
var
i,j,k: integer;
s1,s2,s3: scalar;
m0: matrix;
begin { minverse }
write('(minverse'); flush(output);
m0:=m1;
for i:=0 to lmax do for j:=0 to lmax do szero(m2[i,j]);
for i:=0 to lmax do m2[i,i]:=sone;

for i:=0 to lmax do begin { simple Gauss-Jordan }
s1:=m0[i,i];
m0[i,i]:=sone;
for j:=i+1 to lmax do begin
squot(m0[i,j],s1,s2);
m0[i,j]:=s2;
end;
for j:=0 to lmax do begin
squot(m2[i,j],s1,s2);
m2[i,j]:=s2;
end;

for k:=0 to lmax do if k<i then begin
s1:=m0[k,i];
szero(m0[k,i]);
for j:=i+1 to lmax do begin
sprod(s1,m0[i,j],s2);
sdiff(m0[k,j],s2,s3);
m0[k,j]:=s3;
end;
for j:=0 to lmax do begin
sprod(s1,m2[i,j],s2);
sdiff(m2[k,j],s2,s3);
m2[k,j]:=s3;
end;
end;
end;
write(')'); flush(output);
end { minverse };