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
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
|
\documentclass{article}
\usepackage{axiom}
\begin{document}
\title{\$SPAD/src/interp nag-f07.boot}
\author{The Axiom Team}
\maketitle
\begin{abstract}
\end{abstract}
\eject
\tableofcontents
\eject
\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 "BOOT"
f07adf() ==
htInitPage('"F07ADF - {\it LU} factorization of real {\it m} by {\it n} matrix",nil)
htMakePage '(
(domainConditions
(isDomain PI (PositiveInteger)))
(text . "\windowlink{Manual Page}{manpageXXf07adf} for this routine ")
(text . "\newline ")
(text . "\lispwindowlink{Browser operation page}{(|oPageFrom| '|f07adf| '|NagLapack|)} for this routine")
(text . "\newline \horizontalline ")
(text . "\newline ")
(text . "F07ADF computes the {\it LU} factorization of a real {\it m}")
(text . " by {\it n} matrix ")
(text . "\blankline ")
(text . "\menuitemstyle{}\tab{2}")
(text . "Number of rows {\it m}:")
(text . "\newline\tab{2} ")
(bcStrings (5 4 m PI))
(text . "\blankline ")
(text . "\menuitemstyle{}\tab{2}")
(text . "Number of columns {\it n}:")
(text . "\newline\tab{2} ")
(bcStrings (5 4 n PI))
)
-- (text . "\blankline ")
-- (text . "\menuitemstyle{}\tab{2}")
-- (text . "First dimension of array A, {\it lda}:")
-- (text . "\newline\tab{2} ")
-- (bcStrings (5 4 lda PI))
htMakeDoneButton('"Continue", 'f07adfSolve)
htShowPage()
f07adfSolve htPage ==
m :=
$bcParseOnly => PARSE_-INTEGER htpLabelInputString(htPage, 'm)
objValUnwrap htpLabelSpadValue(htPage, 'm)
n :=
$bcParseOnly => PARSE_-INTEGER htpLabelInputString(htPage, 'n)
objValUnwrap htpLabelSpadValue(htPage, 'n)
lda := m
(n = '4 and m = '4) => f07adfDefaultSolve(htPage,lda)
aList :=
"append"/[fa(i,n) for i in 1..m] where fa(i,n) ==
labelList :=
"append"/[fb(i,j) for j in 1..n] where fb(i,j) ==
anam := INTERN STRCONC ('"a",STRINGIMAGE i,STRINGIMAGE j)
[['bcStrings,[6, 0, anam, 'F]]]
prefix := ('"\newline ")
labelList := [['text,:prefix],:labelList]
equationPart := [
'(domainConditions
(isDomain EM $EmptyMode)
(isDomain S (String))
(isDomain F (Float))
(isDomain I (Integer))),
:aList]
page := htInitPage('"F07ADF - {\it LU} factorization of real {\it m} by {\it n} matrix",nil)
htSay '"\menuitemstyle{}\tab{2} "
htSay '"Enter the array {\it A}:"
htSay '"\newline "
htMakePage equationPart
htMakeDoneButton('"Continue",'f07adfGen)
htpSetProperty(page,'n,n)
htpSetProperty(page,'m,m)
-- htpSetProperty(page,'lda,lda)
htpSetProperty(page,'inputArea, htpInputAreaAlist htPage)
htShowPage()
f07adfDefaultSolve (htPage,lda) ==
n := '4
m := '4
page := htInitPage('"F07ADF - {\it LU} factorization of real {\it m} by {\it n} matrix",nil)
htMakePage '(
(domainConditions
(isDomain EM $EmptyMode)
(isDomain F (Float))
(isDomain I (Integer)))
(text . "\newline ")
(text . "\menuitemstyle{}\tab{2}")
(text . "Enter the array {\it A}:")
(text . "\newline ")
(bcStrings (5 "1.8" a11 F))
(bcStrings (5 "2.88" a12 F))
(bcStrings (5 "2.05" a13 F))
(bcStrings (5 "-0.89" a14 F))
(text . "\newline ")
(bcStrings (5 "5.25" a21 F))
(bcStrings (5 "-2.95" a22 F))
(bcStrings (5 "-0.95" a23 F))
(bcStrings (5 "-3.8" a24 F))
(text . "\newline ")
(bcStrings (5 "1.58" a31 F))
(bcStrings (5 "-2.69" a32 F))
(bcStrings (5 "-2.9" a33 F))
(bcStrings (5 "-1.04" a34 F))
(text . "\newline ")
(bcStrings (5 "-1.11" a41 F))
(bcStrings (5 "-0.66" a42 F))
(bcStrings (5 "-0.59" a43 F))
(bcStrings (5 "0.8" a44 F)))
htpSetProperty(page,'n,n)
htpSetProperty(page,'m,m)
-- htpSetProperty(page,'lda,lda)
htMakeDoneButton('"Continue",'f07adfGen)
htpSetProperty(page,'inputArea, htpInputAreaAlist htPage)
htShowPage()
f07adfGen htPage ==
n := htpProperty(htPage, 'n)
m := htpProperty(htPage, 'm)
lda := m
alist := htpInputAreaAlist htPage
y := alist
for i in 1..n repeat
for j in 1..m repeat
a := STRCONC((first y).1," ")
rowList := [a,:rowList]
y := rest y
aList := [rowList,:aList]
rowList := []
astring := bcwords2liststring [bcwords2liststring x for x in aList]
prefix := STRCONC("f07adf(",STRINGIMAGE m,", ",STRINGIMAGE n,", ")
prefix := STRCONC(prefix,STRINGIMAGE lda,", ",astring,")")
linkGen prefix
f07aef() ==
htInitPage('"F07AEF - Solution of a real system of linear equations with multiple right-hand sides after factorization by F07ADF",nil)
htMakePage '(
(domainConditions
(isDomain PI (PositiveInteger)))
(text . "\windowlink{Manual Page}{manpageXXf07aef} for this routine ")
(text . "\newline ")
(text . "\lispwindowlink{Browser operation page}{(|oPageFrom| '|f07aef| '|NagLapack|)} for this routine")
(text . "\newline \horizontalline ")
(text . "F07AEF solves a real system of linear equations with multiple right-hand sides, {\it AX=B} or ")
(text . "\htbitmap{aTx=b} , where {\it a} has been factorized by F07ADF ")
(text . "\blankline ")
(text . "\menuitemstyle{}\tab{2}")
(text . "Form of the equations:")
(text . "\blankline ")
(radioButtons trans
("" " N, the equations are {\it AX=B}" norm)
("" " T, the equations are \htbitmap{aTx=b}" transp))
(text . "\blankline ")
(text . "\menuitemstyle{}\tab{2}")
(text . "The order {\it n} of {\it A}: ")
(text . "\newline ")
(bcStrings (5 4 n PI))
-- (text . "\blankline ")
-- (text . "\menuitemstyle{}\tab{2}")
-- (text . "The order {\it m} of {\it A} used by F07AEF: ")
-- (text . "\newline ")
-- (bcStrings (5 4 m PI))
(text . "\blankline ")
(text . "\menuitemstyle{}\tab{2}")
(text . "The number of right-hand sides, {\it nrhs}: ")
(text . "\newline ")
(bcStrings (5 2 nrhs PI))
-- (text . "\blankline ")
-- (text . "\menuitemstyle{}\tab{2}")
-- (text . "First dimension of {\it A}, {\it lda}: ")
-- (text . "\newline ")
-- (bcStrings (5 4 lda PI))
-- (text . "\blankline ")
-- (text . "\menuitemstyle{}\tab{2}")
-- (text . "First dimension of {\it B}, {\it ldb}: ")
-- (text . "\newline ")
-- (bcStrings (5 4 ldb PI))
)
htMakeDoneButton('"Continue", 'f07aefSolve)
htShowPage()
f07aefSolve htPage ==
n :=
$bcParseOnly => PARSE_-INTEGER htpLabelInputString(htPage, 'n)
objValUnwrap htpLabelSpadValue(htPage, 'n)
-- m :=
-- $bcParseOnly => PARSE_-INTEGER htpLabelInputString(htPage, 'm)
-- objValUnwrap htpLabelSpadValue(htPage, 'm)
nrhs :=
$bcParseOnly => PARSE_-INTEGER htpLabelInputString(htPage, 'nrhs)
objValUnwrap htpLabelSpadValue(htPage, 'nrhs)
lda := n
-- $bcParseOnly => PARSE_-INTEGER htpLabelInputString(htPage, 'lda)
-- objValUnwrap htpLabelSpadValue(htPage, 'lda)
ldb := n
-- $bcParseOnly => PARSE_-INTEGER htpLabelInputString(htPage, 'ldb)
-- objValUnwrap htpLabelSpadValue(htPage, 'ldb)
equa := htpButtonValue(htPage, 'trans)
trans :=
equa = 'norm => '"N"
'"T"
(n = '4 and nrhs = '2 ) => f07aefDefaultSolve (htPage,trans)
aList :=
"append"/[fa(i,n) for i in 1..lda] where fa(i,n) ==
labelList :=
"append"/[faa(i,j) for j in 1..n] where faa(i,j) ==
anam := INTERN STRCONC ('"a",STRINGIMAGE i,STRINGIMAGE j)
[['bcStrings, [6, 0, anam, 'F]]]
prefix := ('"\newline ")
labelList := [['text,:prefix],:labelList]
ipList :=
[fp(i) for i in 1..n] where fp(i) ==
ipnam := INTERN STRCONC ('"ip",STRINGIMAGE i)
['bcStrings,[5, 0, ipnam, 'I]]
middle := ('"\blankline \menuitemstyle{}\tab{2} Enter the pivot ")
middle := STRCONC(middle,'"indices {\it IPIV} from F07ADF: ")
middle := STRCONC(middle,'"\newline ")
ipList := [['text,:middle],:ipList]
bList :=
"append"/[fb(i,nrhs) for i in 1..n] where fb(i,nrhs) ==
labelList :=
"append"/[fbb(i,j) for j in 1..nrhs] where fbb(i,j) ==
bnam := INTERN STRCONC ('"b",STRINGIMAGE i,STRINGIMAGE j)
[['bcStrings, [6, 0, bnam, 'F]]]
prefix := ('"\newline ")
labelList := [['text,:prefix],:labelList]
prefix := ("\blankline \menuitemstyle{}\tab{2} Enter the matrix {\it B}: ")
bList := [['text,:prefix],:bList]
equationPart := [
'(domainConditions
(isDomain EM $EmptyMode)
(isDomain S (String))
(isDomain F (Float))
(isDomain I (Integer)))
,:aList,:ipList,:bList]
page := htInitPage('"F07AEF - Solution of a real system of linear equations with multiple right-hand sides after factorization by F07ADF",nil)
htSay '"\menuitemstyle{}\tab{2} "
htSay '"Enter the matrix {\it A}:"
htSay '"\newline "
htMakePage equationPart
htMakeDoneButton('"Continue",'f07aefGen)
htpSetProperty(page,'n,n)
-- htpSetProperty(page,'m,m)
htpSetProperty(page,'nrhs,nrhs)
-- htpSetProperty(page,'lda,lda)
-- htpSetProperty(page,'ldb,ldb)
htpSetProperty(page,'trans,trans)
htpSetProperty(page,'inputArea, htpInputAreaAlist htPage)
htShowPage()
f07aefDefaultSolve (htPage,trans) ==
n := '4
nrhs := '2
lda := '4
ldb := '4
length := '4
page := htInitPage('"F07AEF - Solution of a real system of linear equations with multiple right-hand sides after factorization by F07ADF",nil)
htMakePage '(
(domainConditions
(isDomain EM $EmptyMode)
(isDomain F (Float))
(isDomain I (Integer)))
(text . "\newline ")
(text . "\menuitemstyle{}\tab{2}")
(text . "Enter the matrix {\it A}:")
(text . "\newline ")
(bcStrings (5 "5.25" a11 F))
(bcStrings (5 "-2.95" a12 F))
(bcStrings (5 "-0.95" a13 F))
(bcStrings (5 "-3.8" a14 F))
(text . "\newline ")
(bcStrings (5 "0.34" a21 F))
(bcStrings (5 "3.89" a22 F))
(bcStrings (5 "2.38" a23 F))
(bcStrings (5 "0.41" a24 F))
(text . "\newline ")
(bcStrings (5 "0.3" a31 F))
(bcStrings (5 "-0.46" a32 F))
(bcStrings (5 "-1.51" a33 F))
(bcStrings (5 "0.29" a34 F))
(text . "\newline ")
(bcStrings (5 "-0.21" a41 F))
(bcStrings (5 "-0.33" a42 F))
(bcStrings (5 "0.00" a43 F))
(bcStrings (5 "0.13" a44 F))
(text . "\newline ")
(text . "\blankline ")
(text . "\menuitemstyle{}\tab{2}")
(text . "Enter the pivot indices {\it IPIV} from F07ADF: ")
(text . "\newline ")
(bcStrings (5 2 ip1 PI))
(bcStrings (5 2 ip2 PI))
(bcStrings (5 3 ip3 PI))
(bcStrings (5 4 ip4 PI))
(text . "\newline ")
(text . "\blankline ")
(text . "\menuitemstyle{}\tab{2}")
(text . "Enter the matrix {\it B}:")
(text . "\newline ")
(bcStrings (5 "9.52" b11 F))
(bcStrings (5 "18.47" b12 F))
(text . "\newline ")
(bcStrings (5 "24.35" b21 F))
(bcStrings (5 "2.25" b22 F))
(text . "\newline ")
(bcStrings (5 "0.77" b31 F))
(bcStrings (5 "-13.28" b32 F))
(text . "\newline ")
(bcStrings (5 "-6.22" b41 F))
(bcStrings (5 "-6.21" b42 F)))
htpSetProperty(page,'trans,trans)
htpSetProperty(page,'n,n)
htpSetProperty(page,'nrhs,nrhs)
-- htpSetProperty(page,'lda,lda)
-- htpSetProperty(page,'ldb,ldb)
htpSetProperty(page,'length,length)
htpSetProperty(page,'inputArea, htpInputAreaAlist htPage)
htMakeDoneButton('"Continue",'f07aefGen)
htShowPage()
f07aefGen htPage ==
n := htpProperty(htPage, 'n)
nrhs := htpProperty(htPage, 'nrhs)
-- lda := htpProperty(htPage, 'lda)
-- ldb := htpProperty(htPage, 'ldb)
lda := n
ldb := n
length := htpProperty(htPage, 'length)
trans := htpProperty(htPage,'trans)
aplist := htpInputAreaAlist htPage
y := aplist
for i in 1..n repeat
for j in 1..nrhs repeat
b := STRCONC((first y).1," ")
rowList := [b,:rowList]
y := rest y
bList := [rowList,:bList]
rowList := []
bstring := bcwords2liststring [bcwords2liststring x for x in bList]
for i in 1..length repeat
ip := STRCONC((first y).1," ")
ipList := [ip,:ipList]
y := rest y
ipstring := bcwords2liststring ipList
for i in 1..lda repeat
for j in 1..n repeat
a := STRCONC((first y).1," ")
rowList := [a,:rowList]
y := rest y
aList := [rowList,:aList]
rowList := []
astring := bcwords2liststring [bcwords2liststring x for x in aList]
prefix := STRCONC("f07aef(_"", trans,"_", ",STRINGIMAGE n,", ")
prefix := STRCONC(prefix,STRINGIMAGE nrhs,", ",astring,"::Matrix DoubleFloat, ")
prefix := STRCONC(prefix,STRINGIMAGE lda,", [",ipstring,"]::Matrix INT, ")
prefix := STRCONC(prefix,STRINGIMAGE ldb,", ",bstring,"::Matrix DoubleFloat)")
linkGen prefix
f07fdf() ==
htInitPage('"F07FDF - Cholesky factorization of a real symmmetric positive-definite matrix {\it A}",nil)
htMakePage '(
(domainConditions
(isDomain PI (PositiveInteger)))
(text . "\windowlink{Manual Page}{manpageXXf07fdf} for this routine ")
(text . "\newline ")
(text . "\lispwindowlink{Browser operation page}{(|oPageFrom| '|f07fdf| '|NagLapack|)} for this routine")
(text . "\newline \horizontalline ")
(text . "\newline ")
(text . "F07FDF computes the Cholesky factorization of a real symmetric positive-definite ")
(text . "matrix {\it A} ")
(text . "\blankline ")
(text . "\menuitemstyle{}\tab{2}")
(text . "Method of factorization of {\it A}, {\it UPLO}:")
(text . "\blankline ")
(radioButtons uplo
("" " L, {\it A} factorized as lower triangular" lower)
("" " U, {\it A} factorized as upper triangular" upper))
(text . "\blankline ")
(text . "\menuitemstyle{}\tab{2}")
(text . "The order {\it n} of {\it A}: ")
(text . "\newline ")
(bcStrings (5 4 n PI))
-- (text . "\blankline ")
-- (text . "\menuitemstyle{}\tab{2}")
-- (text . "First dimension of {\it A}, {\it lda}:")
-- (text . "\newline ")
-- (bcStrings (5 4 lda PI)))
)
htMakeDoneButton('"Continue", 'f07fdfSolve)
htShowPage()
f07fdfSolve htPage ==
n :=
$bcParseOnly => PARSE_-INTEGER htpLabelInputString(htPage, 'n)
objValUnwrap htpLabelSpadValue(htPage, 'n)
lda := n
-- $bcParseOnly => PARSE_-INTEGER htpLabelInputString(htPage, 'lda)
-- objValUnwrap htpLabelSpadValue(htPage, 'lda)
upl := htpButtonValue(htPage, 'uplo)
uplo:=
upl = 'lower => '"L"
'"U"
(n = '4 ) => f07fdfDefaultSolve(htPage,uplo)
aList :=
"append"/[fa(i,n) for i in 1..lda] where fa(i,n) ==
labelList :=
"append"/[fb(i,j) for j in 1..n] where fb(i,j) ==
anam := INTERN STRCONC ('"a",STRINGIMAGE i,STRINGIMAGE j)
[['bcStrings, [6, 0, anam, 'F]]]
prefix := ('"\newline ")
labelList := [['text,:prefix],:labelList]
equationPart := [
'(domainConditions
(isDomain EM $EmptyMode)
(isDomain S (String))
(isDomain F (Float))
(isDomain I (Integer))),
:aList]
page := htInitPage('"F07FDF - Cholesky factorization of a real symmmetric positive-definite matrix {\it A}",nil)
htSay '"\menuitemstyle{}\tab{2} "
htSay '"Enter the matrix {\it A}:"
htSay '"\newline "
htMakePage equationPart
htMakeDoneButton('"Continue",'f07fdfGen)
htpSetProperty(page,'uplo,uplo)
htpSetProperty(page,'n,n)
-- htpSetProperty(page,'lda,lda)
htpSetProperty(page,'inputArea, htpInputAreaAlist htPage)
htShowPage()
f07fdfDefaultSolve (htPage,uplo) ==
n := '4
lda := '4
page := htInitPage('"F07FDF - Cholesky factorization of a real symmmetric positive-definite matrix {\it A}",nil)
htMakePage '(
(domainConditions
(isDomain EM $EmptyMode)
(isDomain F (Float))
(isDomain I (Integer)))
(text . "\newline ")
(text . "\menuitemstyle{}\tab{2}")
(text . "Enter the matrix {\it A}:")
(text . "\newline ")
(bcStrings (5 "4.16" a11 F))
(bcStrings (5 "0.0" a12 F))
(bcStrings (5 "0.0" a13 F))
(bcStrings (5 "0.0" a14 F))
(text . "\newline ")
(bcStrings (5 "-3.12" a21 F))
(bcStrings (5 "5.03" a22 F))
(bcStrings (5 "0.0" a23 F))
(bcStrings (5 "0.0" a24 F))
(text . "\newline ")
(bcStrings (5 "0.56" a31 F))
(bcStrings (5 "-0.83" a32 F))
(bcStrings (5 "0.76" a33 F))
(bcStrings (5 "0.0" a34 F))
(text . "\newline ")
(bcStrings (5 "-0.1" a41 F))
(bcStrings (5 "1.18" a42 F))
(bcStrings (5 "0.34" a43 F))
(bcStrings (5 "1.18" a44 F)))
htpSetProperty(page,'uplo,uplo)
htpSetProperty(page,'n,n)
-- htpSetProperty(page,'lda,lda)
htMakeDoneButton('"Continue",'f07fdfGen)
htpSetProperty(page,'inputArea, htpInputAreaAlist htPage)
htShowPage()
f07fdfGen htPage ==
n := htpProperty(htPage, 'n)
-- lda := htpProperty(htPage, 'lda)
lda := n
uplo := htpProperty(htPage,'uplo)
alist := htpInputAreaAlist htPage
y := alist
for i in 1..n repeat
for j in 1..n repeat
a := STRCONC((first y).1," ")
rowList := [a,:rowList]
y := rest y
aList := [rowList,:aList]
rowList := []
astring := bcwords2liststring [bcwords2liststring x for x in aList]
prefix := STRCONC("f07fdf(_"", uplo,"_", ",STRINGIMAGE n,", ")
prefix := STRCONC(prefix,STRINGIMAGE lda,", ",astring,")")
linkGen prefix
f07fef() ==
htInitPage('"F07FEF - Solution of a real symmetric positive-definite system of linear equations with multiple right-hand sides after factorization by F07FDF",nil)
htMakePage '(
(domainConditions
(isDomain PI (PositiveInteger)))
(text . "\windowlink{Manual Page}{manpageXXf07fef} for this routine ")
(text . "\newline ")
(text . "\lispwindowlink{Browser operation page}{(|oPageFrom| '|f07fef| '|NagLapack|)} for this routine")
(text . "\newline \horizontalline ")
(text . "\newline ")
(text . "F07FEF solves a real symmetric positive-definite system of linear ")
(text . "equations with multiple right-hand sides, {\it AX=B}, where ")
(text . "{\it A} has been factorized by F07FDF ")
(text . "\blankline ")
(text . "\menuitemstyle{}\tab{2}")
(text . "Method of factorization of {\it A}, {\it UPLO}:")
(text . "\blankline ")
(radioButtons uplo
("" " L, {\it A} factorized as lower triangular" lower)
("" " U, {\it A} factorized as upper triangular" upper))
(text . "\blankline ")
(text . "\menuitemstyle{}\tab{2}")
(text . "The order {\it n} of {\it A}: ")
(text . "\newline ")
(bcStrings (5 4 n PI))
(text . "\blankline ")
(text . "\menuitemstyle{}\tab{2}")
(text . "The number of right-hand sides, {\it nrhs}: ")
(text . "\newline ")
(bcStrings (5 2 nrhs PI))
-- (text . "\blankline ")
-- (text . "\menuitemstyle{}\tab{2}")
-- (text . "First dimension of {\it A}, {\it lda}: ")
-- (text . "\newline ")
-- (bcStrings (5 4 lda PI))
-- (text . "\blankline ")
-- (text . "\menuitemstyle{}\tab{2}")
-- (text . "First dimension of {\it B}, {\it ldb}: ")
-- (text . "\newline ")
-- (bcStrings (5 4 ldb PI)))
)
htMakeDoneButton('"Continue", 'f07fefSolve)
htShowPage()
f07fefSolve htPage ==
n :=
$bcParseOnly => PARSE_-INTEGER htpLabelInputString(htPage, 'n)
objValUnwrap htpLabelSpadValue(htPage, 'n)
nrhs :=
$bcParseOnly => PARSE_-INTEGER htpLabelInputString(htPage, 'nrhs)
objValUnwrap htpLabelSpadValue(htPage, 'nrhs)
lda := n
-- $bcParseOnly => PARSE_-INTEGER htpLabelInputString(htPage, 'lda)
-- objValUnwrap htpLabelSpadValue(htPage, 'lda)
ldb := n
-- $bcParseOnly => PARSE_-INTEGER htpLabelInputString(htPage, 'ldb)
-- objValUnwrap htpLabelSpadValue(htPage, 'ldb)
upl := htpButtonValue(htPage, 'uplo)
uplo:=
upl = 'lower => '"L"
'"U"
(n = '4 and nrhs = '2) => f07fefDefaultSolve(htPage,uplo)
aList :=
"append"/[fa(i,n) for i in 1..lda] where fa(i,n) ==
labelList :=
"append"/[faa(i,j) for j in 1..n] where faa(i,j) ==
anam := INTERN STRCONC ('"a",STRINGIMAGE i,STRINGIMAGE j)
[['bcStrings, [8, 0, anam, 'F]]]
prefix := ('"\newline ")
labelList := [['text,:prefix],:labelList]
bList :=
"append"/[fb(i,nrhs) for i in 1..n] where fb(i,nrhs) ==
labelList :=
"append"/[fbb(i,j) for j in 1..nrhs] where fbb(i,j) ==
bnam := INTERN STRCONC ('"b",STRINGIMAGE i,STRINGIMAGE j)
[['bcStrings, [8, 0, bnam, 'F]]]
prefix := ('"\newline ")
labelList := [['text,:prefix],:labelList]
prefix := ("\blankline \menuitemstyle{}\tab{2} Enter the matrix {\it B}: ")
bList := [['text,:prefix],:bList]
equationPart := [
'(domainConditions
(isDomain EM $EmptyMode)
(isDomain S (String))
(isDomain F (Float))
(isDomain I (Integer)))
,:aList,:bList]
page := htInitPage('"F07FEF - Solution of a real symmetric positive-definite system of linear equations with multiple right-hand sides after factorization by F07FDF",nil)
htSay '"\menuitemstyle{}\tab{2} "
htSay '"Enter the matrix {\it A}:"
htSay '"\newline "
htMakePage equationPart
htMakeDoneButton('"Continue",'f07fefGen)
htpSetProperty(page,'uplo,uplo)
htpSetProperty(page,'n,n)
htpSetProperty(page,'nrhs,nrhs)
-- htpSetProperty(page,'lda,lda)
-- htpSetProperty(page,'ldb,ldb)
htpSetProperty(page,'inputArea, htpInputAreaAlist htPage)
htShowPage()
f07fefDefaultSolve (htPage,uplo) ==
n := '4
nrhs := '2
lda := '4
ldb := '4
page := htInitPage('"F07FEF - Solution of a real symmetric positive-definite system of linear equations with multiple right-hand sides after factorization by F07FDF",nil)
htMakePage '(
(domainConditions
(isDomain EM $EmptyMode)
(isDomain F (Float))
(isDomain I (Integer)))
(text . "\newline ")
(text . "\menuitemstyle{}\tab{2}")
(text . "Enter the matrix {\it A}:")
(text . "\newline ")
(bcStrings (8 "2.04" a11 F))
(bcStrings (8 "0.0" a12 F))
(bcStrings (8 "0.0" a13 F))
(bcStrings (8 "0.0" a14 F))
(text . "\newline ")
(bcStrings (8 "-1.53" a21 F))
(bcStrings (8 "1.64" a22 F))
(bcStrings (8 "0.0" a23 F))
(bcStrings (8 "0.0" a24 F))
(text . "\newline ")
(bcStrings (8 "0.28" a31 F))
(bcStrings (8 "-0.25" a32 F))
(bcStrings (8 "0.79" a33 F))
(bcStrings (8 "0.0" a34 F))
(text . "\newline ")
(bcStrings (8 "-0.05" a41 F))
(bcStrings (8 "0.67" a42 F))
(bcStrings (8 "0.66" a43 F))
(bcStrings (8 "0.54" a44 F))
(text . "\newline ")
(text . "\blankline ")
(text . "\menuitemstyle{}\tab{2}")
(text . "Enter the matrix {\it B}:")
(text . "\newline ")
(bcStrings (8 "8.7" b11 F))
(bcStrings (8 "8.3" b12 F))
(text . "\newline ")
(bcStrings (8 "-13.35" b21 F))
(bcStrings (8 "2.13" b22 F))
(text . "\newline ")
(bcStrings (8 "1.89" b31 F))
(bcStrings (8 "1.61" b32 F))
(text . "\newline ")
(bcStrings (8 "-4.14" b41 F))
(bcStrings (8 "5" b42 F)))
htpSetProperty(page,'uplo,uplo)
htpSetProperty(page,'n,n)
htpSetProperty(page,'nrhs,nrhs)
-- htpSetProperty(page,'lda,lda)
-- htpSetProperty(page,'ldb,ldb)
htpSetProperty(page,'inputArea, htpInputAreaAlist htPage)
htMakeDoneButton('"Continue",'f07fefGen)
htShowPage()
f07fefGen htPage ==
n := htpProperty(htPage, 'n)
nrhs := htpProperty(htPage, 'nrhs)
-- lda := htpProperty(htPage, 'lda)
-- ldb := htpProperty(htPage, 'ldb)
lda := n
ldb := n
uplo := htpProperty(htPage,'uplo)
aplist := htpInputAreaAlist htPage
y := aplist
for i in 1..n repeat
for j in 1..nrhs repeat
b := STRCONC((first y).1," ")
rowList := [b,:rowList]
y := rest y
bList := [rowList,:bList]
rowList := []
bstring := bcwords2liststring [bcwords2liststring x for x in bList]
for i in 1..lda repeat
for j in 1..n repeat
a := STRCONC((first y).1," ")
rowList := [a,:rowList]
y := rest y
aList := [rowList,:aList]
rowList := []
astring := bcwords2liststring [bcwords2liststring x for x in aList]
prefix := STRCONC("f07fef(_"", uplo,"_", ",STRINGIMAGE n,", ")
prefix := STRCONC(prefix,STRINGIMAGE nrhs,", ",astring,"::Matrix DoubleFloat, ")
prefix := STRCONC(prefix,STRINGIMAGE lda,", ")
prefix := STRCONC(prefix,STRINGIMAGE ldb,", ",bstring,"::Matrix DoubleFloat)")
linkGen prefix
@
\eject
\begin{thebibliography}{99}
\bibitem{1} nothing
\end{thebibliography}
\end{document}
|