File: dmumps.sci

package info (click to toggle)
mumps 5.8.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 22,632 kB
  • sloc: fortran: 455,990; ansic: 14,541; makefile: 684; xml: 527; f90: 181; sh: 130
file content (90 lines) | stat: -rw-r--r-- 2,665 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
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
function id=dmumps(id,mat)

//************************************************************************************************************** 
// [id] = dmumps(id,mat)
// id is a structure (see details in initmumps.m and MUMPS documentation)
// mat is an optional parameter if the job id.job = -1 or -2
// mat is a square sparse matrix
// informations are return in id fields
// 
// *************************************************************************************************************


if (typeof(id) ~= "StructMumps") then
  disp("Error. Please call initmumps first.");
  return;
end
arithtype=1;

if id.JOB == -2 then   
     if id.INST==-9999 then
         disp('Error. Uninitialized instance. MUMPS should be called with JOB=-1 first.');
         return;
     end
     if id.TYPE ~= arithtype then
	disp('Error. You are trying to call z/d version on a d/z instance');
        return;
     end
     // call the C routine dmumpsc
 
     dmumpsc(id.SYM,id.JOB,id.ICNTL,id.CNTL,id.PERM_IN,id.COLSCA,id.ROWSCA,id.RHS,id.VAR_SCHUR,id.INST,id.REDRHS);
     id = [];
     return;
end


if id.JOB == -1 then
	if id.INST~=-9999 then
		disp('Error. Already initialized instance.');
	return;
	end
	// call the C routine dmumpsc
	[inform,rinform,sol,inst,schu,redrhs,pivnul_list,sym_perm,uns_perm,icntl,cntl] = dmumpsc(id.SYM,id.JOB,id.ICNTL,id.CNTL,id.PERM_IN,id.COLSCA,id.ROWSCA,id.RHS,id.VAR_SCHUR,id.INST,id.REDRHS);
        id.INFOG = inform;
	id.RINFOG = rinform;
	id.SOL = sol;
	id.INST = inst;
	id.SCHUR = schu;
	id.REDRHS = redrhs;
	id.PIVNUL_LIST = pivnul_list;
	id.SYM_PERM = sym_perm;
	id.UNS_PERM = uns_perm;
        id.TYPE=arithtype;
        id.ICNTL=icntl;
	id.CNTL=cntl;
 	clear inform rinform sol inst schu redrhs pivnul_list sym_perm uns_perm icntl cntl
	return;
	
end

if id.INST ==-9999 then
	disp('Uninitialized instance');
	return;
end 
// call the C routine dmumpsc

if id.TYPE ~= arithtype then
	disp('You are trying to call z/d version on a d/z instance');
end

[inform,rinform,sol,inst,schu,redrhs,pivnul_list,sym_perm,uns_perm,icntl,cntl] = dmumpsc(id.SYM,id.JOB,id.ICNTL,id.CNTL,id.PERM_IN,id.COLSCA,id.ROWSCA,id.RHS,id.VAR_SCHUR,id.INST,id.REDRHS, mat);
id.INFOG = inform;
id.RINFOG = rinform;
id.SOL = sol;
id.INST = inst;
if (id.JOB == 2|id.JOB==4|id.JOB==6) then
	if id.SYM == 0 then
                id.SCHUR=schu';
        else 
        	id.SCHUR=triu(schu)+tril(schu',-1);
        end
end 
id.REDRHS = redrhs;
id.PIVNUL_LIST = pivnul_list;
id.SYM_PERM(sym_perm) = [1:size(mat,1)];
id.UNS_PERM = uns_perm;
id.ICNTL=icntl;
id.CNTL=cntl;
clear inform rinform sol inst schu redrhs pivnul_list sym_perm uns_perm icntl cntl

endfunction