~ubuntu-branches/ubuntu/hoary/scilab/hoary

« back to all changes in this revision

Viewing changes to macros/algebre/chsolve.sci

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2002-03-21 16:57:43 UTC
  • Revision ID: james.westby@ubuntu.com-20020321165743-e9mv12c1tb1plztg
Tags: upstream-2.6
ImportĀ upstreamĀ versionĀ 2.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
function sol=chsolve(spcho,rhs)
 
2
// Cholesky solver for A*sol=rhs (A is symmetric >0)
 
3
// 1rst step: spcho=chfact(A)
 
4
// 2nd step: sol=chsolve(spcho,rhs)
 
5
// Example: N=20; A=sprand(N,N,0.1);
 
6
// A=A*A'+speye(A);
 
7
// sol=(1:N)'; rhs=A*sol;
 
8
// spcho=chfact(A); sol=chsolve(spcho,rhs)
 
9
perm=spcho('perm');
 
10
sol=blkslv(spcho,rhs(perm));
 
11
sol(perm)=sol
 
12