static condensation



Dear all,
I am not very familiar with maxima and I am willing to write a function to
perform a static condensation wherever I call it from maxima. I don't know
very well how to write it. I have just written a similar function. How
should I convert it to make maxima understand what I want? (Also if I write
this function, where will I save it and how will I call it?)
Best Regards
Ahmet Alper Parker

function(x,mat)
r=dim mat

for i=1 to r
for j=1 to r

t[i,j]:mat[i,j]-mat[i,x]*mat[x,j]/mat[x,x]

end for
end for

t:submatrix(t,x);
t:submatrix(x,t);

return t

(Note: x is the row or column number of the martix mat to be condensed. t
will be the matrix condensed from matrix mat in its xth row and/or column.)