File: multiplerhs_example.m

package info (click to toggle)
mumps 5.7.3-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 23,160 kB
  • sloc: fortran: 471,200; ansic: 14,631; makefile: 680; xml: 527; f90: 181; sh: 130
file content (23 lines) | stat: -rw-r--r-- 554 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
%Example of using MUMPS in matlab with multiple right hand side

% initialization of a matlab MUMPS structure
id = initmumps;
id = dmumps(id);
load lhr01;
mat = Problem.A;
% JOB = 6 means analysis+facto+solve
id.JOB = 6;
% we set the rigth hand side
id.RHS = ones(size(mat,1),2);
id.RHS(:,2) = 2*id.RHS(:,2);
%call to mumps
id = dmumps(id,mat);
if(norm(mat*id.SOL - id.RHS,'inf') > sqrt(eps))
	disp('WARNING : precision may not be OK');
else
	disp('SOLUTION OK');
end
norm(mat*id.SOL - id.RHS,'inf')
% destroy mumps instance
id.JOB = -2;
id = dmumps(id)