aboutsummaryrefslogtreecommitdiff
path: root/src/algebra/f04.spad.pamphlet
blob: 8220f04085996b89f8bda793d9c37ac7d76ab5af (plain)
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
\documentclass{article}
\usepackage{open-axiom}
\begin{document}
\title{\$SPAD/src/algebra f04.spad}
\author{Godfrey Nolan, Mike Dewar}
\maketitle
\begin{abstract}
\end{abstract}
\eject
\tableofcontents
\eject
\section{package NAGF04 NagLinearEquationSolvingPackage}
<<package NAGF04 NagLinearEquationSolvingPackage>>=
)abbrev package NAGF04 NagLinearEquationSolvingPackage
++ Author: Godfrey Nolan and Mike Dewar
++ Date Created: Jan 1994
++ Date Last Updated: Thu May 12 17:45:31 1994
++Description:
++This package uses the NAG Library to solve the matrix equation \axiom{AX=B}, where \axiom{B}
++may be a single vector or a matrix of multiple right-hand sides.
++The matrix \axiom{A} may be real, complex, symmetric, Hermitian positive-
++definite, or sparse. It may also be rectangular, in which case a
++least-squares solution is obtained.
++See \downlink{Manual Page}{manpageXXf04}.
NagLinearEquationSolvingPackage(): Exports == Implementation where
  S ==> Symbol
  FOP ==> FortranOutputStackPackage

  Exports ==> with
    f04adf : (Integer,Matrix Complex DoubleFloat,Integer,Integer,_
	Integer,Integer,Matrix Complex DoubleFloat,Integer) -> Result 
     ++ f04adf(ia,b,ib,n,m,ic,a,ifail)
     ++ calculates the approximate solution of a set of complex 
     ++ linear equations with multiple right-hand sides, using an LU 
     ++ factorization with partial pivoting.
     ++ See \downlink{Manual Page}{manpageXXf04adf}.
    f04arf : (Integer,Matrix DoubleFloat,Integer,Matrix DoubleFloat,_
	Integer) -> Result 
     ++ f04arf(ia,b,n,a,ifail)
     ++ calculates the approximate solution of a set of real 
     ++ linear equations with a single right-hand side, using an LU 
     ++ factorization with partial pivoting.
     ++ See \downlink{Manual Page}{manpageXXf04arf}.
    f04asf : (Integer,Matrix DoubleFloat,Integer,Matrix DoubleFloat,_
	Integer) -> Result 
     ++ f04asf(ia,b,n,a,ifail)
     ++ calculates the accurate solution of a set of real 
     ++ symmetric positive-definite linear equations with a single right-
     ++ hand side,  Ax=b, using a Cholesky factorization and iterative 
     ++ refinement.
     ++ See \downlink{Manual Page}{manpageXXf04asf}.
    f04atf : (Matrix DoubleFloat,Integer,Matrix DoubleFloat,Integer,_
	Integer,Integer) -> Result 
     ++ f04atf(a,ia,b,n,iaa,ifail)
     ++ calculates the accurate solution of a set of real linear 
     ++ equations with a single right-hand side, using an LU 
     ++ factorization with partial pivoting, and iterative refinement.
     ++ See \downlink{Manual Page}{manpageXXf04atf}.
    f04axf : (Integer,Matrix DoubleFloat,Integer,Matrix Integer,_
	Matrix Integer,Integer,Matrix Integer,Matrix DoubleFloat) -> Result 
     ++ f04axf(n,a,licn,icn,ikeep,mtype,idisp,rhs)
     ++ calculates the approximate solution of a set of real 
     ++ sparse linear equations with a single right-hand side, Ax=b or  
     ++  T                                                    
     ++ A x=b, where A has been factorized by F01BRF or F01BSF.
     ++ See \downlink{Manual Page}{manpageXXf04axf}.
    f04faf : (Integer,Integer,Matrix DoubleFloat,Matrix DoubleFloat,_
	Matrix DoubleFloat,Integer) -> Result 
     ++ f04faf(job,n,d,e,b,ifail)
     ++ calculates the approximate solution of a set of real 
     ++ symmetric positive-definite tridiagonal linear equations.
     ++ See \downlink{Manual Page}{manpageXXf04faf}.
    f04jgf : (Integer,Integer,Integer,DoubleFloat,_
	Integer,Matrix DoubleFloat,Matrix DoubleFloat,Integer) -> Result 
     ++ f04jgf(m,n,nra,tol,lwork,a,b,ifail)
     ++ finds the solution of a linear least-squares problem, Ax=b
     ++ , where A is a real m by n (m>=n) matrix and b is an m element 
     ++ vector. If the matrix of observations is not of full rank, then 
     ++ the minimal least-squares solution is returned.
     ++ See \downlink{Manual Page}{manpageXXf04jgf}.
    f04maf : (Integer,Integer,Matrix DoubleFloat,Integer,_
	Matrix Integer,Integer,Matrix Integer,Matrix DoubleFloat,Matrix Integer,Matrix Integer,Matrix DoubleFloat,Matrix DoubleFloat,Matrix Integer,Integer) -> Result 
     ++ f04maf(n,nz,avals,licn,irn,lirn,icn,wkeep,ikeep,inform,b,acc,noits,ifail)
     ++ e a sparse symmetric positive-definite system of linear 
     ++ equations, Ax=b, using a pre-conditioned conjugate gradient 
     ++ method, where A has been factorized by F01MAF.
     ++ See \downlink{Manual Page}{manpageXXf04maf}.
    f04mbf : (Integer,Matrix DoubleFloat,Boolean,DoubleFloat,_
	Integer,Integer,Integer,Integer,DoubleFloat,Integer,Union(fn:FileName,fp:Asp28(APROD)),Union(fn:FileName,fp:Asp34(MSOLVE))) -> Result 
     ++ f04mbf(n,b,precon,shift,itnlim,msglvl,lrwork,liwork,rtol,ifail,aprod,msolve)
     ++ solves a system of real sparse symmetric linear equations 
     ++ using a Lanczos algorithm.
     ++ See \downlink{Manual Page}{manpageXXf04mbf}.
    f04mcf : (Integer,Matrix DoubleFloat,Integer,Matrix DoubleFloat,_
	Matrix Integer,Integer,Matrix DoubleFloat,Integer,Integer,Integer,Integer) -> Result 
     ++ f04mcf(n,al,lal,d,nrow,ir,b,nrb,iselct,nrx,ifail)
     ++ computes the approximate solution of a system of real 
     ++ linear equations with multiple right-hand sides,  AX=B,  where A 
     ++ is a symmetric positive-definite variable-bandwidth matrix, which
     ++ has previously been factorized by F01MCF. Related systems may 
     ++ also be solved.
     ++ See \downlink{Manual Page}{manpageXXf04mcf}.
    f04qaf : (Integer,Integer,DoubleFloat,DoubleFloat,_
	DoubleFloat,DoubleFloat,Integer,Integer,Integer,Integer,Matrix DoubleFloat,Integer,Union(fn:FileName,fp:Asp30(APROD))) -> Result 
     ++ f04qaf(m,n,damp,atol,btol,conlim,itnlim,msglvl,lrwork,liwork,b,ifail,aprod)
     ++ solves sparse unsymmetric equations, sparse linear least-
     ++ squares problems and sparse damped linear least-squares problems,
     ++ using a Lanczos algorithm.
     ++ See \downlink{Manual Page}{manpageXXf04qaf}.
  Implementation ==> add

    import Lisp
    import DoubleFloat
    import Any
    import Record
    import Integer
    import Matrix DoubleFloat
    import Boolean
    import NAGLinkSupportPackage
    import FortranPackage
    import AnyFunctions1(Integer)
    import AnyFunctions1(DoubleFloat)
    import AnyFunctions1(Boolean)
    import AnyFunctions1(Matrix Complex DoubleFloat)
    import AnyFunctions1(Matrix DoubleFloat)
    import AnyFunctions1(Matrix Integer)


    f04adf(iaArg:Integer,bArg:Matrix Complex DoubleFloat,ibArg:Integer,_
	nArg:Integer,mArg:Integer,icArg:Integer,_
	aArg:Matrix Complex DoubleFloat,ifailArg:Integer): Result == 
	[(invokeNagman(NIL$Lisp,_
	"f04adf",_
	["ia"::S,"ib"::S,"n"::S,"m"::S,"ic"::S_
	,"ifail"::S,"b"::S,"c"::S,"a"::S,"wkspce"::S]$Lisp,_
	["c"::S,"wkspce"::S]$Lisp,_
	[["double"::S,["wkspce"::S,"n"::S]$Lisp]$Lisp_
	,["integer"::S,"ia"::S,"ib"::S,"n"::S,"m"::S_
	,"ic"::S,"ifail"::S]$Lisp_
	,["double complex"::S,["b"::S,"ib"::S,"m"::S]$Lisp,["c"::S,"ic"::S,"m"::S]$Lisp,["a"::S,"ia"::S,"n"::S]$Lisp]$Lisp_
	]$Lisp,_
	["c"::S,"a"::S,"ifail"::S]$Lisp,_
	[([iaArg::Any,ibArg::Any,nArg::Any,mArg::Any,icArg::Any,ifailArg::Any,bArg::Any,aArg::Any ])_
	@List Any]$Lisp)$Lisp)_
	pretend List (Record(key:Symbol,entry:Any))]$Result

    f04arf(iaArg:Integer,bArg:Matrix DoubleFloat,nArg:Integer,_
	aArg:Matrix DoubleFloat,ifailArg:Integer): Result == 
	[(invokeNagman(NIL$Lisp,_
	"f04arf",_
	["ia"::S,"n"::S,"ifail"::S,"b"::S,"c"::S,"a"::S,"wkspce"::S]$Lisp,_
	["c"::S,"wkspce"::S]$Lisp,_
	[["double"::S,["b"::S,"n"::S]$Lisp,["c"::S,"n"::S]$Lisp_
	,["a"::S,"ia"::S,"n"::S]$Lisp,["wkspce"::S,"n"::S]$Lisp]$Lisp_
	,["integer"::S,"ia"::S,"n"::S,"ifail"::S]$Lisp_
	]$Lisp,_
	["c"::S,"a"::S,"ifail"::S]$Lisp,_
	[([iaArg::Any,nArg::Any,ifailArg::Any,bArg::Any,aArg::Any ])_
	@List Any]$Lisp)$Lisp)_
	pretend List (Record(key:Symbol,entry:Any))]$Result

    f04asf(iaArg:Integer,bArg:Matrix DoubleFloat,nArg:Integer,_
	aArg:Matrix DoubleFloat,ifailArg:Integer): Result == 
	[(invokeNagman(NIL$Lisp,_
	"f04asf",_
	["ia"::S,"n"::S,"ifail"::S,"b"::S,"c"::S,"a"::S,"wk1"::S,"wk2"::S_
	]$Lisp,_
	["c"::S,"wk1"::S,"wk2"::S]$Lisp,_
	[["double"::S,["b"::S,"n"::S]$Lisp,["c"::S,"n"::S]$Lisp_
	,["a"::S,"ia"::S,"n"::S]$Lisp,["wk1"::S,"n"::S]$Lisp,["wk2"::S,"n"::S]$Lisp]$Lisp_
	,["integer"::S,"ia"::S,"n"::S,"ifail"::S]$Lisp_
	]$Lisp,_
	["c"::S,"a"::S,"ifail"::S]$Lisp,_
	[([iaArg::Any,nArg::Any,ifailArg::Any,bArg::Any,aArg::Any ])_
	@List Any]$Lisp)$Lisp)_
	pretend List (Record(key:Symbol,entry:Any))]$Result

    f04atf(aArg:Matrix DoubleFloat,iaArg:Integer,bArg:Matrix DoubleFloat,_
	nArg:Integer,iaaArg:Integer,ifailArg:Integer): Result == 
	[(invokeNagman(NIL$Lisp,_
	"f04atf",_
	["ia"::S,"n"::S,"iaa"::S,"ifail"::S,"a"::S,"b"::S,"c"::S,"aa"::S,"wks1"::S_
	,"wks2"::S]$Lisp,_
	["c"::S,"aa"::S,"wks1"::S,"wks2"::S]$Lisp,_
	[["double"::S,["a"::S,"ia"::S,"n"::S]$Lisp_
	,["b"::S,"n"::S]$Lisp,["c"::S,"n"::S]$Lisp,["aa"::S,"iaa"::S,"n"::S]$Lisp,["wks1"::S,"n"::S]$Lisp,["wks2"::S,"n"::S]$Lisp_
	]$Lisp_
	,["integer"::S,"ia"::S,"n"::S,"iaa"::S,"ifail"::S_
	]$Lisp_
	]$Lisp,_
	["c"::S,"aa"::S,"ifail"::S]$Lisp,_
	[([iaArg::Any,nArg::Any,iaaArg::Any,ifailArg::Any,aArg::Any,bArg::Any ])_
	@List Any]$Lisp)$Lisp)_
	pretend List (Record(key:Symbol,entry:Any))]$Result

    f04axf(nArg:Integer,aArg:Matrix DoubleFloat,licnArg:Integer,_
	icnArg:Matrix Integer,ikeepArg:Matrix Integer,mtypeArg:Integer,_
	idispArg:Matrix Integer,rhsArg:Matrix DoubleFloat): Result == 
	[(invokeNagman(NIL$Lisp,_
	"f04axf",_
	["n"::S,"licn"::S,"mtype"::S,"resid"::S,"a"::S,"icn"::S,"ikeep"::S,"idisp"::S,"rhs"::S_
	,"w"::S]$Lisp,_
	["resid"::S,"w"::S]$Lisp,_
	[["double"::S,["a"::S,"licn"::S]$Lisp,"resid"::S_
	,["rhs"::S,"n"::S]$Lisp,["w"::S,"n"::S]$Lisp]$Lisp_
	,["integer"::S,"n"::S,"licn"::S,["icn"::S,"licn"::S]$Lisp_
	,["ikeep"::S,["*"::S,"n"::S,5$Lisp]$Lisp]$Lisp,"mtype"::S,["idisp"::S,2$Lisp]$Lisp]$Lisp_
	]$Lisp,_
	["resid"::S,"rhs"::S]$Lisp,_
	[([nArg::Any,licnArg::Any,mtypeArg::Any,aArg::Any,icnArg::Any,ikeepArg::Any,idispArg::Any,rhsArg::Any ])_
	@List Any]$Lisp)$Lisp)_
	pretend List (Record(key:Symbol,entry:Any))]$Result

    f04faf(jobArg:Integer,nArg:Integer,dArg:Matrix DoubleFloat,_
	eArg:Matrix DoubleFloat,bArg:Matrix DoubleFloat,ifailArg:Integer): Result == 
	[(invokeNagman(NIL$Lisp,_
	"f04faf",_
	["job"::S,"n"::S,"ifail"::S,"d"::S,"e"::S,"b"::S]$Lisp,_
	[]$Lisp,_
	[["double"::S,["d"::S,"n"::S]$Lisp,["e"::S,"n"::S]$Lisp_
	,["b"::S,"n"::S]$Lisp]$Lisp_
	,["integer"::S,"job"::S,"n"::S,"ifail"::S]$Lisp_
	]$Lisp,_
	["d"::S,"e"::S,"b"::S,"ifail"::S]$Lisp,_
	[([jobArg::Any,nArg::Any,ifailArg::Any,dArg::Any,eArg::Any,bArg::Any ])_
	@List Any]$Lisp)$Lisp)_
	pretend List (Record(key:Symbol,entry:Any))]$Result

    f04jgf(mArg:Integer,nArg:Integer,nraArg:Integer,_
	tolArg:DoubleFloat,lworkArg:Integer,aArg:Matrix DoubleFloat,_
	bArg:Matrix DoubleFloat,ifailArg:Integer): Result == 
	[(invokeNagman(NIL$Lisp,_
	"f04jgf",_
	["m"::S,"n"::S,"nra"::S,"tol"::S,"lwork"::S_
	,"svd"::S,"sigma"::S,"irank"::S,"ifail"::S,"work"::S,"a"::S,"b"::S]$Lisp,_
	["svd"::S,"sigma"::S,"irank"::S,"work"::S]$Lisp,_
	[["double"::S,"tol"::S,"sigma"::S,["work"::S,"lwork"::S]$Lisp_
	,["a"::S,"nra"::S,"n"::S]$Lisp,["b"::S,"m"::S]$Lisp]$Lisp_
	,["integer"::S,"m"::S,"n"::S,"nra"::S,"lwork"::S_
	,"irank"::S,"ifail"::S]$Lisp_
	,["logical"::S,"svd"::S]$Lisp_
	]$Lisp,_
	["svd"::S,"sigma"::S,"irank"::S,"work"::S,"a"::S,"b"::S,"ifail"::S]$Lisp,_
	[([mArg::Any,nArg::Any,nraArg::Any,tolArg::Any,lworkArg::Any,ifailArg::Any,aArg::Any,bArg::Any ])_
	@List Any]$Lisp)$Lisp)_
	pretend List (Record(key:Symbol,entry:Any))]$Result

    f04maf(nArg:Integer,nzArg:Integer,avalsArg:Matrix DoubleFloat,_
	licnArg:Integer,irnArg:Matrix Integer,lirnArg:Integer,_
	icnArg:Matrix Integer,wkeepArg:Matrix DoubleFloat,ikeepArg:Matrix Integer,_
	informArg:Matrix Integer,bArg:Matrix DoubleFloat,accArg:Matrix DoubleFloat,_
	noitsArg:Matrix Integer,ifailArg:Integer): Result == 
	[(invokeNagman(NIL$Lisp,_
	"f04maf",_
	["n"::S,"nz"::S,"licn"::S,"lirn"::S,"ifail"::S_
	,"avals"::S,"irn"::S,"icn"::S,"wkeep"::S,"ikeep"::S_
	,"inform"::S,"work"::S,"b"::S,"acc"::S,"noits"::S_
	]$Lisp,_
	["work"::S]$Lisp,_
	[["double"::S,["avals"::S,"licn"::S]$Lisp,["wkeep"::S,["*"::S,3$Lisp,"n"::S]$Lisp]$Lisp_
	,["work"::S,["*"::S,3$Lisp,"n"::S]$Lisp]$Lisp,["b"::S,"n"::S]$Lisp,["acc"::S,2$Lisp]$Lisp_
	]$Lisp_
	,["integer"::S,"n"::S,"nz"::S,"licn"::S,["irn"::S,"lirn"::S]$Lisp_
	,"lirn"::S,["icn"::S,"licn"::S]$Lisp,["ikeep"::S,["*"::S,2$Lisp,"n"::S]$Lisp]$Lisp,["inform"::S,4$Lisp]$Lisp_
	,["noits"::S,2$Lisp]$Lisp,"ifail"::S]$Lisp_
	]$Lisp,_
	["work"::S,"b"::S,"acc"::S,"noits"::S,"ifail"::S]$Lisp,_
	[([nArg::Any,nzArg::Any,licnArg::Any,lirnArg::Any,ifailArg::Any,avalsArg::Any,irnArg::Any,icnArg::Any,wkeepArg::Any,ikeepArg::Any,informArg::Any,bArg::Any,accArg::Any,noitsArg::Any ])_
	@List Any]$Lisp)$Lisp)_
	pretend List (Record(key:Symbol,entry:Any))]$Result

    f04mbf(nArg:Integer,bArg:Matrix DoubleFloat,preconArg:Boolean,_
	shiftArg:DoubleFloat,itnlimArg:Integer,msglvlArg:Integer,_
	lrworkArg:Integer,liworkArg:Integer,rtolArg:DoubleFloat,_
	ifailArg:Integer,aprodArg:Union(fn:FileName,fp:Asp28(APROD)),msolveArg:Union(fn:FileName,fp:Asp34(MSOLVE))): Result == 
-- if both asps are AXIOM generated we do not need lrwork liwork
--   and will set to 1.
-- else believe the user but check that they are >0.
        if (aprodArg case fp) and (msolveArg case fp)
		then
			lrworkArg:=1
			liworkArg:=1
		else 
			lrworkArg:=max(1,lrworkArg)
			liworkArg:=max(1,liworkArg)
	pushFortranOutputStack(aprodFilename := aspFilename "aprod")$FOP
	if aprodArg case fn
		  then outputAsFortran(aprodArg.fn)
		  else outputAsFortran(aprodArg.fp)
	popFortranOutputStack()$FOP
	pushFortranOutputStack(msolveFilename := aspFilename "msolve")$FOP
	if msolveArg case fn
		  then outputAsFortran(msolveArg.fn)
		  else outputAsFortran(msolveArg.fp)
	popFortranOutputStack()$FOP
	[(invokeNagman([aprodFilename,msolveFilename]$Lisp,_
	"f04mbf",_
	["n"::S,"precon"::S,"shift"::S,"itnlim"::S,"msglvl"::S_
	,"lrwork"::S,"liwork"::S,"itn"::S,"anorm"::S,"acond"::S_
	,"rnorm"::S,"xnorm"::S,"inform"::S,"rtol"::S,"ifail"::S_
	,"aprod"::S,"msolve"::S,"b"::S,"x"::S,"work"::S,"rwork"::S,"iwork"::S_
	]$Lisp,_
	["x"::S,"itn"::S,"anorm"::S,"acond"::S,"rnorm"::S,"xnorm"::S,"inform"::S,"work"::S,"rwork"::S,"iwork"::S,"aprod"::S,"msolve"::S]$Lisp,_
	[["double"::S,["b"::S,"n"::S]$Lisp,"shift"::S_
	,["x"::S,"n"::S]$Lisp,"anorm"::S,"acond"::S,"rnorm"::S,"xnorm"::S,"rtol"::S,["work"::S,"n"::S,5$Lisp]$Lisp,["rwork"::S,"lrwork"::S]$Lisp_
	,"aprod"::S,"msolve"::S]$Lisp_
	,["integer"::S,"n"::S,"itnlim"::S,"msglvl"::S_
	,"lrwork"::S,"liwork"::S,"itn"::S,"inform"::S,"ifail"::S,["iwork"::S,"liwork"::S]$Lisp]$Lisp_
	,["logical"::S,"precon"::S]$Lisp_
	]$Lisp,_
	["x"::S,"itn"::S,"anorm"::S,"acond"::S,"rnorm"::S,"xnorm"::S,"inform"::S,"rtol"::S,"ifail"::S]$Lisp,_
	[([nArg::Any,preconArg::Any,shiftArg::Any,itnlimArg::Any,msglvlArg::Any,lrworkArg::Any,liworkArg::Any,rtolArg::Any,ifailArg::Any,bArg::Any ])_
	@List Any]$Lisp)$Lisp)_
	pretend List (Record(key:Symbol,entry:Any))]$Result

    f04mcf(nArg:Integer,alArg:Matrix DoubleFloat,lalArg:Integer,_
	dArg:Matrix DoubleFloat,nrowArg:Matrix Integer,irArg:Integer,_
	bArg:Matrix DoubleFloat,nrbArg:Integer,iselctArg:Integer,_
	nrxArg:Integer,ifailArg:Integer): Result == 
	[(invokeNagman(NIL$Lisp,_
	"f04mcf",_
	["n"::S,"lal"::S,"ir"::S,"nrb"::S,"iselct"::S_
	,"nrx"::S,"ifail"::S,"al"::S,"d"::S,"nrow"::S,"b"::S,"x"::S_
	]$Lisp,_
	["x"::S]$Lisp,_
	[["double"::S,["al"::S,"lal"::S]$Lisp,["d"::S,"n"::S]$Lisp_
	,["b"::S,"nrb"::S,"ir"::S]$Lisp,["x"::S,"nrx"::S,"ir"::S]$Lisp]$Lisp_
	,["integer"::S,"n"::S,"lal"::S,["nrow"::S,"n"::S]$Lisp_
	,"ir"::S,"nrb"::S,"iselct"::S,"nrx"::S,"ifail"::S]$Lisp_
	]$Lisp,_
	["x"::S,"ifail"::S]$Lisp,_
	[([nArg::Any,lalArg::Any,irArg::Any,nrbArg::Any,iselctArg::Any,nrxArg::Any,ifailArg::Any,alArg::Any,dArg::Any,nrowArg::Any,bArg::Any ])_
	@List Any]$Lisp)$Lisp)_
	pretend List (Record(key:Symbol,entry:Any))]$Result

    f04qaf(mArg:Integer,nArg:Integer,dampArg:DoubleFloat,_
	atolArg:DoubleFloat,btolArg:DoubleFloat,conlimArg:DoubleFloat,_
	itnlimArg:Integer,msglvlArg:Integer,lrworkArg:Integer,_
	liworkArg:Integer,bArg:Matrix DoubleFloat,ifailArg:Integer,_
	aprodArg:Union(fn:FileName,fp:Asp30(APROD))): Result == 
	pushFortranOutputStack(aprodFilename := aspFilename "aprod")$FOP
	if aprodArg case fn
		  then outputAsFortran(aprodArg.fn)
		  else outputAsFortran(aprodArg.fp)
	popFortranOutputStack()$FOP
	[(invokeNagman([aprodFilename]$Lisp,_
	"f04qaf",_
	["m"::S,"n"::S,"damp"::S,"atol"::S,"btol"::S_
	,"conlim"::S,"itnlim"::S,"msglvl"::S,"lrwork"::S,"liwork"::S_
	,"itn"::S,"anorm"::S,"acond"::S,"rnorm"::S,"arnorm"::S_
	,"xnorm"::S,"inform"::S,"ifail"::S,"aprod"::S,"x"::S,"se"::S,"b"::S,"work"::S,"rwork"::S_
	,"iwork"::S]$Lisp,_
	["x"::S,"se"::S,"itn"::S,"anorm"::S,"acond"::S,"rnorm"::S,"arnorm"::S,"xnorm"::S,"inform"::S,"work"::S,"rwork"::S,"iwork"::S,"aprod"::S]$Lisp,_
	[["double"::S,"damp"::S,"atol"::S,"btol"::S_
	,"conlim"::S,["x"::S,"n"::S]$Lisp,["se"::S,"n"::S]$Lisp,"anorm"::S,"acond"::S,"rnorm"::S,"arnorm"::S,"xnorm"::S,["b"::S,"m"::S]$Lisp_
	,["work"::S,"n"::S,2$Lisp]$Lisp,["rwork"::S,"lrwork"::S]$Lisp,"aprod"::S]$Lisp_
	,["integer"::S,"m"::S,"n"::S,"itnlim"::S,"msglvl"::S_
	,"lrwork"::S,"liwork"::S,"itn"::S,"inform"::S,"ifail"::S,["iwork"::S,"liwork"::S]$Lisp]$Lisp_
	]$Lisp,_
	["x"::S,"se"::S,"itn"::S,"anorm"::S,"acond"::S,"rnorm"::S,"arnorm"::S,"xnorm"::S,"inform"::S,"b"::S,"ifail"::S]$Lisp,_
	[([mArg::Any,nArg::Any,dampArg::Any,atolArg::Any,btolArg::Any,conlimArg::Any,itnlimArg::Any,msglvlArg::Any,lrworkArg::Any,liworkArg::Any,ifailArg::Any,bArg::Any ])_
	@List Any]$Lisp)$Lisp)_
	pretend List (Record(key:Symbol,entry:Any))]$Result

@
\section{License}
<<license>>=
--Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd.
--All rights reserved.
--
--Redistribution and use in source and binary forms, with or without
--modification, are permitted provided that the following conditions are
--met:
--
--    - Redistributions of source code must retain the above copyright
--      notice, this list of conditions and the following disclaimer.
--
--    - Redistributions in binary form must reproduce the above copyright
--      notice, this list of conditions and the following disclaimer in
--      the documentation and/or other materials provided with the
--      distribution.
--
--    - Neither the name of The Numerical ALgorithms Group Ltd. nor the
--      names of its contributors may be used to endorse or promote products
--      derived from this software without specific prior written permission.
--
--THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
--IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
--TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
--PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
--OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
--EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
--PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
--PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
--LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
--NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
--SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@
<<*>>=
<<license>>

<<package NAGF04 NagLinearEquationSolvingPackage>>
@
\eject
\begin{thebibliography}{99}
\bibitem{1} nothing
\end{thebibliography}
\end{document}