[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: permutations of matrix to triangular form?

From: Andy Adler
Subject: Re: permutations of matrix to triangular form?
Date: Sun, 12 Dec 2004 17:46:04 -0500 (EST)

On Wed, 8 Dec 2004, David Bateman wrote:

> >    Currently, doing this in Matlab with sparse code makes it look very
> >    unlike the simple solver cases. For example, in some finite element
> >    code I'm working on 
> > (http://cvs.sf.net/viewcvs.py/eidors3d/eidors3d/algorithms/np_2003/forward_solver.m)
> >    instead of
> >         V= E\I;
> >    one does
> >         %Permute the rows and columns to make the factors sparser
> >         E = E(pp,pp);
> >         In = I(pp,:);
> >         rr(pp)=1:max(size(pp));
> >         U = cholinc(E,tol/10);
> >         q_c =  U' \ In;
> >         Vn = U \ q_c;
> >         %De-permute the result for Cholesky
> >         V = Vn(rr,:);
> I agree this is ugly, but it is safer. Perhaps the way around this is
> to introduce mldivide/mrdivide functions (we'll have to do it anyway for
> matlab style "@" classes), but with an additional argument that can force
> a particular solver to be used. In this manner, we remain compatiable,
> don't disassociate the command for the solver type from the operator
> itself and make the above simplier. Which is simplier
>     E = set(E, 'solver', 'cholesky');
>     V= E\I;

This is basically what I was suggesting.

While I know that this isn't the point of what you're currently
thinking of, it seems to me that the ability to add this kind
of information to matrices is powerful.

For example, one thing I would love to be able to do, is have a matrix
object which would allow arbitrary pieces of cached computations to be
tacked onto it. My current code tends to keep this information in
global variables - not the cleanest solution.

I realize I haven't carefully looked at your new sparse code yet.
I hope to do that this week.

Andy Adler <adler AT site.uOttawa.ca> 1(613)562-5800x6218

reply via email to

[Prev in Thread] Current Thread [Next in Thread]