diff --git a/books/bookvol10.5.pamphlet b/books/bookvol10.5.pamphlet
index 411ac55..023c286 100644
--- a/books/bookvol10.5.pamphlet
+++ b/books/bookvol10.5.pamphlet
@@ -380,7 +380,7 @@ stored in $DX(1+ (N-1)*|INCX|)$.
)set message auto off
)clear all
---S 1 of 177
+--S 1 of 183
t1:Complex DoubleFloat := complex(1.0,0)
--R
--R
@@ -388,7 +388,7 @@ t1:Complex DoubleFloat := complex(1.0,0)
--R Type: Complex(DoubleFloat)
--E 1
---S 2 of 177
+--S 2 of 183
dcabs1(t1)
--R
--R
@@ -396,7 +396,7 @@ dcabs1(t1)
--R Type: DoubleFloat
--E 2
---S 3 of 177
+--S 3 of 183
t2:Complex DoubleFloat := complex(1.0,1.0)
--R
--R
@@ -404,7 +404,7 @@ t2:Complex DoubleFloat := complex(1.0,1.0)
--R Type: Complex(DoubleFloat)
--E 3
---S 4 of 177
+--S 4 of 183
dcabs1(t2)
--R
--R
@@ -412,7 +412,7 @@ dcabs1(t2)
--R Type: DoubleFloat
--E 4
---S 5 of 177
+--S 5 of 183
t3:Complex DoubleFloat := complex(1.0,-1.0)
--R
--R
@@ -420,7 +420,7 @@ t3:Complex DoubleFloat := complex(1.0,-1.0)
--R Type: Complex(DoubleFloat)
--E 5
---S 6 of 177
+--S 6 of 183
dcabs1(t3)
--R
--R
@@ -428,7 +428,7 @@ dcabs1(t3)
--R Type: DoubleFloat
--E 6
---S 7 of 177
+--S 7 of 183
t4:Complex DoubleFloat := complex(-1.0,-1.0)
--R
--R
@@ -436,7 +436,7 @@ t4:Complex DoubleFloat := complex(-1.0,-1.0)
--R Type: Complex(DoubleFloat)
--E 7
---S 8 of 177
+--S 8 of 183
dcabs1(t4)
--R
--R
@@ -444,7 +444,7 @@ dcabs1(t4)
--R Type: DoubleFloat
--E 8
---S 9 of 177
+--S 9 of 183
t5:Complex DoubleFloat := complex(-2.0,-2.0)
--R
--R
@@ -452,7 +452,7 @@ t5:Complex DoubleFloat := complex(-2.0,-2.0)
--R Type: Complex(DoubleFloat)
--E 9
---S 10 of 177
+--S 10 of 183
dcabs1(t5)
--R
--R
@@ -462,196 +462,196 @@ dcabs1(t5)
)clear all
---S 11 of 177
+--S 11 of 183
a:PRIMARR(DFLOAT):=[ [1.0,2.0,3.0,4,0,5,0,6,0] ]
--R
--R (1) [1.,2.,3.,4.,0.,5.,0.,6.,0.]
--R Type: PrimitiveArray(DoubleFloat)
--E 11
---S 12 of 177
+--S 12 of 183
dasum(3,a,-1) -- 0.0 neg incx
--R
--R (2) 0.
--R Type: DoubleFloat
--E 12
---S 13 of 177
+--S 13 of 183
dasum(3,a,0) -- 0.0 zero incx
--R
--R (3) 0.
--R Type: DoubleFloat
--E 13
---S 14 of 177
+--S 14 of 183
dasum(-1,a,1) -- 0.0 neg elements
--R
--R (4) 0.
--R Type: DoubleFloat
--E 14
---S 15 of 177
+--S 15 of 183
dasum(0,a,1) -- 0.0 no elements
--R
--R (5) 0.
--R Type: DoubleFloat
--E 15
---S 16 of 177
+--S 16 of 183
dasum(1,a,1) -- 1.0 1.0
--R
--R (6) 1.
--R Type: DoubleFloat
--E 16
---S 17 of 177
+--S 17 of 183
dasum(2,a,1) -- 3.0 1.0+2.0
--R
--R (7) 3.
--R Type: DoubleFloat
--E 17
---S 18 of 177
+--S 18 of 183
dasum(3,a,1) -- 6.0 1.0+2.0+3.0
--R
--R (8) 6.
--R Type: DoubleFloat
--E 18
---S 19 of 177
+--S 19 of 183
dasum(4,a,1) -- 10.0 1.0+2.0+3.0+4.0
--R
--R (9) 10.
--R Type: DoubleFloat
--E 19
---S 20 of 177
+--S 20 of 183
dasum(5,a,1) -- 15.0 1.0+2.0+3.0+4.0+5.0
--R
--R (10) 10.
--R Type: DoubleFloat
--E 20
---S 21 of 177
+--S 21 of 183
dasum(6,a,1) -- 21.0 1.0+2.0+3.0+4.0+5.0+6.0
--R
--R (11) 15.
--R Type: DoubleFloat
--E 21
---S 22 of 177
+--S 22 of 183
dasum(7,a,1) -- 21.0 1.0+2.0+3.0+4.0+5.0+6.0
--R
--R (12) 15.
--R Type: DoubleFloat
--E 22
---S 23 of 177
+--S 23 of 183
dasum(1,a,2) -- 1.0 1.0
--R
--R (13) 1.
--R Type: DoubleFloat
--E 23
---S 24 of 177
+--S 24 of 183
dasum(2,a,2) -- 4.0 1.0+3.0
--R
--R (14) 4.
--R Type: DoubleFloat
--E 24
---S 25 of 177
+--S 25 of 183
dasum(3,a,2) -- 9.0 1.0+3.0+5.0
--R
--R (15) 4.
--R Type: DoubleFloat
--E 25
---S 26 of 177
+--S 26 of 183
dasum(4,a,2) -- 9.0 1.0+3.0+5.0
--R
--R (16) 4.
--R Type: DoubleFloat
--E 26
---S 27 of 177
+--S 27 of 183
dasum(1,a,3) -- 1.0 1.0
--R
--R (17) 1.
--R Type: DoubleFloat
--E 27
---S 28 of 177
+--S 28 of 183
dasum(2,a,3) -- 5.0 1.0+4.0
--R
--R (18) 5.
--R Type: DoubleFloat
--E 28
---S 29 of 177
+--S 29 of 183
dasum(3,a,3) -- 5.0 1.0+4.0
--R
--R (19) 5.
--R Type: DoubleFloat
--E 29
---S 30 of 177
+--S 30 of 183
dasum(1,a,4) -- 1.0 1.0
--R
--R (20) 1.
--R Type: DoubleFloat
--E 30
---S 31 of 177
+--S 31 of 183
dasum(2,a,4) -- 6.0 1.0+5.0
--R
--R (21) 1.
--R Type: DoubleFloat
--E 31
---S 32 of 177
+--S 32 of 183
dasum(3,a,4) -- 6.0 1.0+5.0
--R
--R (22) 1.
--R Type: DoubleFloat
--E 32
---S 33 of 177
+--S 33 of 183
dasum(1,a,5) -- 1.0 1.0
--R
--R (23) 1.
--R Type: DoubleFloat
--E 33
---S 34 of 177
+--S 34 of 183
dasum(2,a,5) -- 7.0 1.0+6.0
--R
--R (24) 6.
--R Type: DoubleFloat
--E 34
---S 35 of 177
+--S 35 of 183
dasum(3,a,5) -- 7.0 1.0+6.0
--R
--R (25) 6.
--R Type: DoubleFloat
--E 35
---S 36 of 177
+--S 36 of 183
dasum(1,a,6) -- 1.0 1.0
--R
--R (26) 1.
--R Type: DoubleFloat
--E 36
---S 37 of 177
+--S 37 of 183
dasum(2,a,6) -- 1.0 1.0
--R
--R (27) 1.
--R Type: DoubleFloat
--E 37
---S 38 of 177
+--S 38 of 183
dasum(1,a,7) -- 1.0 1.0
--R
--R (28) 1.
@@ -660,7 +660,7 @@ dasum(1,a,7) -- 1.0 1.0
)clear all
---S 39 of 177
+--S 39 of 183
a:PRIMARR(DFLOAT):=[ [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0] ]
--R
--R
@@ -668,7 +668,7 @@ a:PRIMARR(DFLOAT):=[ [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0] ]
--R Type: PrimitiveArray(DoubleFloat)
--E 39
---S 40 of 177
+--S 40 of 183
b:PRIMARR(DFLOAT):=[ [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0] ]
--R
--R
@@ -676,7 +676,7 @@ b:PRIMARR(DFLOAT):=[ [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0] ]
--R Type: PrimitiveArray(DoubleFloat)
--E 40
---S 41 of 177
+--S 41 of 183
daxpy(3,2.0,a,1,b,1)
--R
--R
@@ -684,7 +684,7 @@ daxpy(3,2.0,a,1,b,1)
--R Type: PrimitiveArray(DoubleFloat)
--E 41
---S 42 of 177
+--S 42 of 183
b:PRIMARR(DFLOAT):=[ [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0] ]
--R
--R
@@ -692,7 +692,7 @@ b:PRIMARR(DFLOAT):=[ [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0] ]
--R Type: PrimitiveArray(DoubleFloat)
--E 42
---S 43 of 177
+--S 43 of 183
daxpy(7,2.0,a,1,b,1)
--R
--R
@@ -700,7 +700,7 @@ daxpy(7,2.0,a,1,b,1)
--R Type: PrimitiveArray(DoubleFloat)
--E 43
---S 44 of 177
+--S 44 of 183
b:PRIMARR(DFLOAT):=[ [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0] ]
--R
--R
@@ -713,7 +713,7 @@ Note that Axiom properly handles array indexes that are out of bounds.
The BLAS daxpy routine cannot check this condition.
\begin{chunk}{BlasLevelOne.input}
---S 45 of 177
+--S 45 of 183
daxpy(8,2.0,a,1,b,1)
--R
--R
@@ -721,7 +721,7 @@ daxpy(8,2.0,a,1,b,1)
--R Type: PrimitiveArray(DoubleFloat)
--E 45
---S 46 of 177
+--S 46 of 183
b:PRIMARR(DFLOAT):=[ [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0] ]
--R
--R
@@ -729,7 +729,7 @@ b:PRIMARR(DFLOAT):=[ [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0] ]
--R Type: PrimitiveArray(DoubleFloat)
--E 46
---S 47 of 177
+--S 47 of 183
daxpy(3,2.0,a,3,b,3)
--R
--R
@@ -737,7 +737,7 @@ daxpy(3,2.0,a,3,b,3)
--R Type: PrimitiveArray(DoubleFloat)
--E 47
---S 48 of 177
+--S 48 of 183
b:PRIMARR(DFLOAT):=[ [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0] ]
--R
--R
@@ -745,7 +745,7 @@ b:PRIMARR(DFLOAT):=[ [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0] ]
--R Type: PrimitiveArray(DoubleFloat)
--E 48
---S 49 of 177
+--S 49 of 183
daxpy(4,2.0,a,2,b,2)
--R
--R
@@ -753,7 +753,7 @@ daxpy(4,2.0,a,2,b,2)
--R Type: PrimitiveArray(DoubleFloat)
--E 49
---S 50 of 177
+--S 50 of 183
b:PRIMARR(DFLOAT):=[ [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0] ]
--R
--R
@@ -761,7 +761,7 @@ b:PRIMARR(DFLOAT):=[ [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0] ]
--R Type: PrimitiveArray(DoubleFloat)
--E 50
---S 51 of 177
+--S 51 of 183
daxpy(5,2.0,a,2,b,2)
--R
--R
@@ -769,7 +769,7 @@ daxpy(5,2.0,a,2,b,2)
--R Type: PrimitiveArray(DoubleFloat)
--E 51
---S 52 of 177
+--S 52 of 183
b:PRIMARR(DFLOAT):=[ [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0] ]
--R
--R
@@ -777,7 +777,7 @@ b:PRIMARR(DFLOAT):=[ [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0] ]
--R Type: PrimitiveArray(DoubleFloat)
--E 52
---S 53 of 177
+--S 53 of 183
daxpy(3,2.0,a,2,b,2)
--R
--R
@@ -785,7 +785,7 @@ daxpy(3,2.0,a,2,b,2)
--R Type: PrimitiveArray(DoubleFloat)
--E 53
---S 54 of 177
+--S 54 of 183
b:PRIMARR(DFLOAT):=[ [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0] ]
--R
--R
@@ -793,7 +793,7 @@ b:PRIMARR(DFLOAT):=[ [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0] ]
--R Type: PrimitiveArray(DoubleFloat)
--E 54
---S 55 of 177
+--S 55 of 183
daxpy(3,-2.0,a,2,b,2)
--R
--R
@@ -801,7 +801,7 @@ daxpy(3,-2.0,a,2,b,2)
--R Type: PrimitiveArray(DoubleFloat)
--E 55
---S 56 of 177
+--S 56 of 183
a:PRIMARR(DFLOAT):=[ [ 1.0, 2.0, 3.0] ]
--R
--R
@@ -809,7 +809,7 @@ a:PRIMARR(DFLOAT):=[ [ 1.0, 2.0, 3.0] ]
--R Type: PrimitiveArray(DoubleFloat)
--E 56
---S 57 of 177
+--S 57 of 183
b:PRIMARR(DFLOAT):=[ [ 1.0, 2.0, 3.0, 4.0, 5.0] ]
--R
--R
@@ -817,7 +817,7 @@ b:PRIMARR(DFLOAT):=[ [ 1.0, 2.0, 3.0, 4.0, 5.0] ]
--R Type: PrimitiveArray(DoubleFloat)
--E 57
---S 58 of 177
+--S 58 of 183
daxpy(3,-2.0,a,1,b,2)
--R
--R
@@ -825,7 +825,7 @@ daxpy(3,-2.0,a,1,b,2)
--R Type: PrimitiveArray(DoubleFloat)
--E 58
---S 59 of 177
+--S 59 of 183
b:PRIMARR(DFLOAT):=[ [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0] ]
--R
--R
@@ -833,7 +833,7 @@ b:PRIMARR(DFLOAT):=[ [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0] ]
--R Type: PrimitiveArray(DoubleFloat)
--E 59
---S 60 of 177
+--S 60 of 183
daxpy(3,0.0,a,1,b,2)
--R
--R
@@ -843,7 +843,7 @@ daxpy(3,0.0,a,1,b,2)
)clear all
---S 61 of 177
+--S 61 of 183
a:PRIMARR(DFLOAT):=[ [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0] ]
--R
--R
@@ -851,7 +851,7 @@ a:PRIMARR(DFLOAT):=[ [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0] ]
--R Type: PrimitiveArray(DoubleFloat)
--E 61
---S 62 of 177
+--S 62 of 183
b:PRIMARR(DFLOAT):=[ [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] ]
--R
--R
@@ -859,7 +859,7 @@ b:PRIMARR(DFLOAT):=[ [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] ]
--R Type: PrimitiveArray(DoubleFloat)
--E 62
---S 63 of 177
+--S 63 of 183
dcopy(3,a,1,b,1)
--R
--R
@@ -867,7 +867,7 @@ dcopy(3,a,1,b,1)
--R Type: PrimitiveArray(DoubleFloat)
--E 63
---S 64 of 177
+--S 64 of 183
b:PRIMARR(DFLOAT):=[ [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] ]
--R
--R
@@ -875,7 +875,7 @@ b:PRIMARR(DFLOAT):=[ [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] ]
--R Type: PrimitiveArray(DoubleFloat)
--E 64
---S 65 of 177
+--S 65 of 183
dcopy(7,a,1,b,1)
--R
--R
@@ -883,7 +883,7 @@ dcopy(7,a,1,b,1)
--R Type: PrimitiveArray(DoubleFloat)
--E 65
---S 66 of 177
+--S 66 of 183
b:PRIMARR(DFLOAT):=[ [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] ]
--R
--R
@@ -891,7 +891,7 @@ b:PRIMARR(DFLOAT):=[ [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] ]
--R Type: PrimitiveArray(DoubleFloat)
--E 66
---S 67 of 177
+--S 67 of 183
dcopy(8,a,1,b,1)
--R
--R
@@ -899,7 +899,7 @@ dcopy(8,a,1,b,1)
--R Type: PrimitiveArray(DoubleFloat)
--E 67
---S 68 of 177
+--S 68 of 183
b:PRIMARR(DFLOAT):=[ [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] ]
--R
--R
@@ -907,7 +907,7 @@ b:PRIMARR(DFLOAT):=[ [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] ]
--R Type: PrimitiveArray(DoubleFloat)
--E 68
---S 69 of 177
+--S 69 of 183
dcopy(3,a,3,b,3)
--R
--R
@@ -915,7 +915,7 @@ dcopy(3,a,3,b,3)
--R Type: PrimitiveArray(DoubleFloat)
--E 69
---S 70 of 177
+--S 70 of 183
b:PRIMARR(DFLOAT):=[ [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] ]
--R
--R
@@ -923,7 +923,7 @@ b:PRIMARR(DFLOAT):=[ [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] ]
--R Type: PrimitiveArray(DoubleFloat)
--E 70
---S 71 of 177
+--S 71 of 183
dcopy(4,a,2,b,2)
--R
--R
@@ -931,7 +931,7 @@ dcopy(4,a,2,b,2)
--R Type: PrimitiveArray(DoubleFloat)
--E 71
---S 72 of 177
+--S 72 of 183
b:PRIMARR(DFLOAT):=[ [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] ]
--R
--R
@@ -939,7 +939,7 @@ b:PRIMARR(DFLOAT):=[ [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] ]
--R Type: PrimitiveArray(DoubleFloat)
--E 72
---S 73 of 177
+--S 73 of 183
dcopy(5,a,2,b,2)
--R
--R
@@ -947,7 +947,7 @@ dcopy(5,a,2,b,2)
--R Type: PrimitiveArray(DoubleFloat)
--E 73
---S 74 of 177
+--S 74 of 183
b:PRIMARR(DFLOAT):=[ [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] ]
--R
--R
@@ -955,7 +955,7 @@ b:PRIMARR(DFLOAT):=[ [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] ]
--R Type: PrimitiveArray(DoubleFloat)
--E 74
---S 75 of 177
+--S 75 of 183
dcopy(3,a,2,b,2)
--R
--R
@@ -963,7 +963,7 @@ dcopy(3,a,2,b,2)
--R Type: PrimitiveArray(DoubleFloat)
--E 75
---S 76 of 177
+--S 76 of 183
a:PRIMARR(DFLOAT):=[ [ 1.0, 2.0, 3.0] ]
--R
--R
@@ -971,7 +971,7 @@ a:PRIMARR(DFLOAT):=[ [ 1.0, 2.0, 3.0] ]
--R Type: PrimitiveArray(DoubleFloat)
--E 76
---S 77 of 177
+--S 77 of 183
b:PRIMARR(DFLOAT):=[ [ 1.0, 2.0, 3.0, 4.0, 5.0] ]
--R
--R
@@ -979,7 +979,7 @@ b:PRIMARR(DFLOAT):=[ [ 1.0, 2.0, 3.0, 4.0, 5.0] ]
--R Type: PrimitiveArray(DoubleFloat)
--E 77
---S 78 of 177
+--S 78 of 183
dcopy(3,a,1,b,1)
--R
--R
@@ -987,7 +987,7 @@ dcopy(3,a,1,b,1)
--R Type: PrimitiveArray(DoubleFloat)
--E 78
---S 79 of 177
+--S 79 of 183
b:PRIMARR(DFLOAT):=[ [ 1.0, 2.0, 3.0, 4.0, 5.0] ]
--R
--R
@@ -995,7 +995,7 @@ b:PRIMARR(DFLOAT):=[ [ 1.0, 2.0, 3.0, 4.0, 5.0] ]
--R Type: PrimitiveArray(DoubleFloat)
--E 79
---S 80 of 177
+--S 80 of 183
dcopy(3,a,1,b,2)
--R
--R
@@ -1003,7 +1003,7 @@ dcopy(3,a,1,b,2)
--R Type: PrimitiveArray(DoubleFloat)
--E 80
---S 81 of 177
+--S 81 of 183
a:PRIMARR(DFLOAT):=[ [ 1.0, 2.0, 3.0, 4.0, 5.0] ]
--R
--R
@@ -1011,7 +1011,7 @@ a:PRIMARR(DFLOAT):=[ [ 1.0, 2.0, 3.0, 4.0, 5.0] ]
--R Type: PrimitiveArray(DoubleFloat)
--E 81
---S 82 of 177
+--S 82 of 183
b:PRIMARR(DFLOAT):=[ [ 1.0, 2.0, 3.0] ]
--R
--R
@@ -1019,7 +1019,7 @@ b:PRIMARR(DFLOAT):=[ [ 1.0, 2.0, 3.0] ]
--R Type: PrimitiveArray(DoubleFloat)
--E 82
---S 83 of 177
+--S 83 of 183
dcopy(5,a,1,b,1)
--R
--R
@@ -1029,63 +1029,63 @@ dcopy(5,a,1,b,1)
)clear all
---S 84 of 177
+--S 84 of 183
a:PRIMARR(DFLOAT):=[ [ 1.0, 2.0, 3.0, 4.0, 5.0] ]
--R
--R (1) [1.,2.,3.,4.,5.]
--R Type: PrimitiveArray(DoubleFloat)
--E 84
---S 85 of 177
+--S 85 of 183
b:PRIMARR(DFLOAT):=[ [ 5.0, 6.0, 7.0, 8.0, 9.0] ]
--R
--R (2) [5.,6.,7.,8.,9.]
--R Type: PrimitiveArray(DoubleFloat)
--E 85
---S 86 of 177
+--S 86 of 183
ddot(0,a,1,b,1)
--R
--R (3) 0.
--R Type: DoubleFloat
--E 86
---S 87 of 177
+--S 87 of 183
ddot(3,a,1,b,1)
--R
--R (4) 38.
--R Type: DoubleFloat
--E 87
---S 88 of 177
+--S 88 of 183
ddot(3,a,1,b,2)
--R
--R (5) 46.
--R Type: DoubleFloat
--E 88
---S 89 of 177
+--S 89 of 183
ddot(3,a,2,b,1)
--R
--R (6) 58.
--R Type: DoubleFloat
--E 89
---S 90 of 177
+--S 90 of 183
ddot(3,a,1,b,-2)
--R
--R (7) 38.
--R Type: DoubleFloat
--E 90
---S 91 of 177
+--S 91 of 183
ddot(3,a,-2,b,1)
--R
--R (8) 50.
--R Type: DoubleFloat
--E 91
---S 92 of 177
+--S 92 of 183
ddot(3,a,-2,b,-2)
--R
--R (9) 71.
@@ -1094,28 +1094,28 @@ ddot(3,a,-2,b,-2)
)clear all
---S 93 of 177
+--S 93 of 183
a:PRIMARR(DFLOAT):=[ [ 3.0, -4.0, 5.0, -7.0, 9.0] ]
--R
--R (1) [3.,- 4.,5.,- 7.,9.]
--R Type: PrimitiveArray(DoubleFloat)
--E 93
---S 94 of 177
+--S 94 of 183
dnrm2(3,a,1)
--R
--R (2) 7.0710678118654755
--R Type: DoubleFloat
--E 94
---S 95 of 177
+--S 95 of 183
dnrm2(5,a,1)
--R
--R (3) 13.416407864998739
--R Type: DoubleFloat
--E 95
---S 96 of 177
+--S 96 of 183
dnrm2(3,a,2)
--R
--R (4) 10.723805294763608
@@ -1123,7 +1123,7 @@ dnrm2(3,a,2)
--E 96
)clear all
---S 97 of 177
+--S 97 of 183
a:MATRIX(DFLOAT):=[[6,5,0],[5,1,4],[0,4,3]]
--R
--R +6. 5. 0.+
@@ -1134,7 +1134,7 @@ a:MATRIX(DFLOAT):=[[6,5,0],[5,1,4],[0,4,3]]
--R Type: Matrix(DoubleFloat)
--E 97
---S 98 of 177
+--S 98 of 183
t1:=drotg(elt(a,1,1),elt(a,1,2),0.0,0.0)
--R
--R (2)
@@ -1143,7 +1143,7 @@ t1:=drotg(elt(a,1,1),elt(a,1,2),0.0,0.0)
--R Type: PrimitiveArray(DoubleFloat)
--E 98
---S 99 of 177
+--S 99 of 183
g1:MATRIX(DFLOAT):=[[elt(t1,2), elt(t1,3),0.0],_
[-elt(t1,3),elt(t1,2),0.0],_
[0.0, 0.0, 1.0]]
@@ -1157,7 +1157,7 @@ g1:MATRIX(DFLOAT):=[[elt(t1,2), elt(t1,3),0.0],_
--R Type: Matrix(DoubleFloat)
--E 99
---S 100 of 177
+--S 100 of 183
t2:=g1*a
--R
--R + 7.810249675906654 4.4812907976513596 2.5607375986579197+
@@ -1168,7 +1168,7 @@ t2:=g1*a
--R Type: Matrix(DoubleFloat)
--E 100
---S 101 of 177
+--S 101 of 183
t3:=drotg(elt(t2,2,2),elt(a,3,2),0.0,0.0)
--R
--R (5)
@@ -1177,7 +1177,7 @@ t3:=drotg(elt(t2,2,2),elt(a,3,2),0.0,0.0)
--R Type: PrimitiveArray(DoubleFloat)
--E 101
---S 102 of 177
+--S 102 of 183
g2:MATRIX(DFLOAT):=[[1.0, 0.0, 0.0],_
[0.0, elt(t3,2),elt(t3,3)],_
[0.0,-elt(t3,3),elt(t3,2)]]
@@ -1191,7 +1191,7 @@ g2:MATRIX(DFLOAT):=[[1.0, 0.0, 0.0],_
--R Type: Matrix(DoubleFloat)
--E 102
---S 103 of 177
+--S 103 of 183
g2*g1*a
--R
--R + 7.810249675906654 4.4812907976513596 2.5607375986579197 +
@@ -1202,7 +1202,7 @@ g2*g1*a
--R Type: Matrix(DoubleFloat)
--E 103
---S 104 of 177
+--S 104 of 183
q:=transpose(g1)*transpose(g2)
--R
--R +0.76822127959737585 0.33265417936007158 0.54697098874441952 +
@@ -1215,21 +1215,21 @@ q:=transpose(g1)*transpose(g2)
)clear all
---S 105 of 177
+--S 105 of 183
dx:PRIMARR(DFLOAT):=[[6,0, 1.0, 4.0, -1.0, -1.0]]
--R
--R (1) [6.,0.,1.,4.,- 1.,- 1.]
--R Type: PrimitiveArray(DoubleFloat)
--E 105
---S 106 of 177
+--S 106 of 183
dy:PRIMARR(DFLOAT):=[[5.0, 1.0, -4.0, 4.0, -4.0]]
--R
--R (2) [5.,1.,- 4.,4.,- 4.]
--R Type: PrimitiveArray(DoubleFloat)
--E 106
---S 107 of 177
+--S 107 of 183
drot(5,dx,1,dy,1,0.707106781,0.707106781) -- rotate by 45 degrees
--R
--R (3)
@@ -1244,7 +1244,7 @@ drot(5,dx,1,dy,1,0.707106781,0.707106781) -- rotate by 45 degrees
--R Type: List(PrimitiveArray(DoubleFloat))
--E 107
---S 108 of 177
+--S 108 of 183
[dx,dy] -- note that the input arguments, dx and dy were modified
--R
--R (4)
@@ -1259,7 +1259,7 @@ drot(5,dx,1,dy,1,0.707106781,0.707106781) -- rotate by 45 degrees
--R Type: List(PrimitiveArray(DoubleFloat))
--E 108
---S 109 of 177
+--S 109 of 183
drot(5,dx,1,dy,1,0.707106781,-0.707106781) -- rotate by -45 degrees
--R
--R (5)
@@ -1274,7 +1274,7 @@ drot(5,dx,1,dy,1,0.707106781,-0.707106781) -- rotate by -45 degrees
--R Type: List(PrimitiveArray(DoubleFloat))
--E 109
---S 110 of 177
+--S 110 of 183
[dx,dy] -- note that the input arguments, dx and dy were modified
--R
--R (6)
@@ -1289,21 +1289,21 @@ drot(5,dx,1,dy,1,0.707106781,-0.707106781) -- rotate by -45 degrees
--R Type: List(PrimitiveArray(DoubleFloat))
--E 110
---S 111 of 177
+--S 111 of 183
dx:PRIMARR(DFLOAT):=[[6,0, 1.0, 4.0, -1.0, -1.0]]
--R
--R (7) [6.,0.,1.,4.,- 1.,- 1.]
--R Type: PrimitiveArray(DoubleFloat)
--E 111
---S 112 of 177
+--S 112 of 183
dy:PRIMARR(DFLOAT):=[[5.0, 1.0, -4.0, 4.0, -4.0]]
--R
--R (8) [5.,1.,- 4.,4.,- 4.]
--R Type: PrimitiveArray(DoubleFloat)
--E 112
---S 113 of 177
+--S 113 of 183
drot(5,dx,1,dy,1,0.707106781,0.707106781) -- rotate by 45 degrees
--R
--R (9)
@@ -1318,7 +1318,7 @@ drot(5,dx,1,dy,1,0.707106781,0.707106781) -- rotate by 45 degrees
--R Type: List(PrimitiveArray(DoubleFloat))
--E 113
---S 114 of 177
+--S 114 of 183
drot(5,dx,1,dy,1,0.707106781,0.707106781) -- rotate to 90 degrees
--R
--R (10)
@@ -1333,7 +1333,7 @@ drot(5,dx,1,dy,1,0.707106781,0.707106781) -- rotate to 90 degrees
--R Type: List(PrimitiveArray(DoubleFloat))
--E 114
---S 115 of 177
+--S 115 of 183
drot(5,dx,1,dy,1,0.707106781,0.707106781) -- rotate to 135 degrees
--R
--R (11)
@@ -1348,7 +1348,7 @@ drot(5,dx,1,dy,1,0.707106781,0.707106781) -- rotate to 135 degrees
--R Type: List(PrimitiveArray(DoubleFloat))
--E 115
---S 116 of 177
+--S 116 of 183
drot(5,dx,1,dy,1,0.707106781,0.707106781) -- rotate to 180 degrees
--R
--R (12)
@@ -1363,7 +1363,7 @@ drot(5,dx,1,dy,1,0.707106781,0.707106781) -- rotate to 180 degrees
--R Type: List(PrimitiveArray(DoubleFloat))
--E 116
---S 117 of 177
+--S 117 of 183
drot(5,dx,1,dy,1,0.707106781,0.707106781) -- rotate to 225 degrees
--R
--R (13)
@@ -1378,7 +1378,7 @@ drot(5,dx,1,dy,1,0.707106781,0.707106781) -- rotate to 225 degrees
--R Type: List(PrimitiveArray(DoubleFloat))
--E 117
---S 118 of 177
+--S 118 of 183
drot(5,dx,1,dy,1,0.707106781,0.707106781) -- rotate to 270 degrees
--R
--R (14)
@@ -1393,7 +1393,7 @@ drot(5,dx,1,dy,1,0.707106781,0.707106781) -- rotate to 270 degrees
--R Type: List(PrimitiveArray(DoubleFloat))
--E 118
---S 119 of 177
+--S 119 of 183
drot(5,dx,1,dy,1,0.707106781,0.707106781) -- rotate to 315 degrees
--R
--R (15)
@@ -1408,7 +1408,7 @@ drot(5,dx,1,dy,1,0.707106781,0.707106781) -- rotate to 315 degrees
--R Type: List(PrimitiveArray(DoubleFloat))
--E 119
---S 120 of 177
+--S 120 of 183
drot(5,dx,1,dy,1,0.707106781,0.707106781) -- rotate to 360 degrees
--R
--R (16)
@@ -1423,7 +1423,7 @@ drot(5,dx,1,dy,1,0.707106781,0.707106781) -- rotate to 360 degrees
--R Type: List(PrimitiveArray(DoubleFloat))
--E 120
---S 121 of 177
+--S 121 of 183
[dx,dy] -- note that the input arguments, dx and dy were modified
--R
--R (17)
@@ -1439,42 +1439,42 @@ drot(5,dx,1,dy,1,0.707106781,0.707106781) -- rotate to 360 degrees
--E 121
)clear all
---S 122 of 177
+--S 122 of 183
dx:PRIMARR(DFLOAT):=[[1.0, 2.0, 3.0, 4.0, 5.0, 6.0]]
--R
--R (1) [1.,2.,3.,4.,5.,6.]
--R Type: PrimitiveArray(DoubleFloat)
--E 122
---S 123 of 177
+--S 123 of 183
dscal(6,2.0,dx,1)
--R
--R (2) [2.,4.,6.,8.,10.,12.]
--R Type: PrimitiveArray(DoubleFloat)
--E 123
---S 124 of 177
+--S 124 of 183
dx
--R
--R (3) [2.,4.,6.,8.,10.,12.]
--R Type: PrimitiveArray(DoubleFloat)
--E 124
---S 125 of 177
+--S 125 of 183
dx:PRIMARR(DFLOAT):=[[1.0, 2.0, 3.0, 4.0, 5.0, 6.0]]
--R
--R (4) [1.,2.,3.,4.,5.,6.]
--R Type: PrimitiveArray(DoubleFloat)
--E 125
---S 126 of 177
+--S 126 of 183
dscal(3,0.5,dx,1)
--R
--R (5) [0.5,1.,1.5,4.,5.,6.]
--R Type: PrimitiveArray(DoubleFloat)
--E 126
---S 127 of 177
+--S 127 of 183
dx
--R
--R (6) [0.5,1.,1.5,4.,5.,6.]
@@ -1483,63 +1483,63 @@ dx
)clear all
---S 128 of 177
+--S 128 of 183
dx:PRIMARR(DFLOAT):=[[1.0, 2.0, 3.0, 4.0, 5.0]]
--R
--R (1) [1.,2.,3.,4.,5.]
--R Type: PrimitiveArray(DoubleFloat)
--E 128
---S 129 of 177
+--S 129 of 183
dy:PRIMARR(DFLOAT):=[[9.0, 8.0, 7.0, 6.0, -5.0]]
--R
--R (2) [9.,8.,7.,6.,- 5.]
--R Type: PrimitiveArray(DoubleFloat)
--E 129
---S 130 of 177
+--S 130 of 183
dswap(5,dx,1,dy,1)
--R
--R (3) [[9.,8.,7.,6.,- 5.],[1.,2.,3.,4.,5.]]
--R Type: List(PrimitiveArray(DoubleFloat))
--E 130
---S 131 of 177
+--S 131 of 183
dx:PRIMARR(DFLOAT):=[[1.0, 2.0, 3.0, 4.0, 5.0]]
--R
--R (4) [1.,2.,3.,4.,5.]
--R Type: PrimitiveArray(DoubleFloat)
--E 131
---S 132 of 177
+--S 132 of 183
dy:PRIMARR(DFLOAT):=[[9.0, 8.0, 7.0, 6.0, -5.0]]
--R
--R (5) [9.,8.,7.,6.,- 5.]
--R Type: PrimitiveArray(DoubleFloat)
--E 132
---S 133 of 177
+--S 133 of 183
dswap(3,dx,2,dy,2)
--R
--R (6) [[9.,2.,7.,4.,- 5.],[1.,8.,3.,6.,5.]]
--R Type: List(PrimitiveArray(DoubleFloat))
--E 133
---S 134 of 177
+--S 134 of 183
dx:PRIMARR(DFLOAT):=[[1.0, 2.0, 3.0, 4.0, 5.0]]
--R
--R (7) [1.,2.,3.,4.,5.]
--R Type: PrimitiveArray(DoubleFloat)
--E 134
---S 135 of 177
+--S 135 of 183
dy:PRIMARR(DFLOAT):=[[9.0, 8.0, 7.0, 6.0, -5.0]]
--R
--R (8) [9.,8.,7.,6.,- 5.]
--R Type: PrimitiveArray(DoubleFloat)
--E 135
---S 136 of 177
+--S 136 of 183
dswap(5,dx,1,dy,-1)
--R
--R (9) [[9.,8.,7.,6.,- 5.],[1.,2.,3.,4.,5.]]
@@ -1548,28 +1548,28 @@ dswap(5,dx,1,dy,-1)
)clear all
---S 137 of 177
+--S 137 of 183
d:PRIMARR(COMPLEX(DFLOAT)):=[[1.0+2.0*%i,-3.0+4.0*%i,5.0-6.0*%i]]
--R
--R (1) [1. + 2. %i,- 3. + 4. %i,5. - 6. %i]
--R Type: PrimitiveArray(Complex(DoubleFloat))
--E 137
---S 138 of 177
+--S 138 of 183
dzasum(3,d,1) -- 21.0
--R
--R (2) 21.
--R Type: DoubleFloat
--E 138
---S 139 of 177
+--S 139 of 183
dzasum(3,d,2) -- 14.0
--R
--R (3) 14.
--R Type: DoubleFloat
--E 139
---S 140 of 177
+--S 140 of 183
dzasum(-3,d,1) -- 0.0
--R
--R (4) 0.
@@ -1578,7 +1578,7 @@ dzasum(-3,d,1) -- 0.0
)clear all
---S 141 of 177
+--S 141 of 183
a:PRIMARR(COMPLEX(DFLOAT)):=_
[[3.+4.*%i, -4.+5.*%i, 5.+6.*%i, 7.-8.*%i, -9.-2.*%i]]
--R
@@ -1586,49 +1586,49 @@ a:PRIMARR(COMPLEX(DFLOAT)):=_
--R Type: PrimitiveArray(Complex(DoubleFloat))
--E 141
---S 142 of 177
+--S 142 of 183
dznrm2(5,a,1) -- should be 18.028
--R
--R (2) 18.027756377319946
--R Type: DoubleFloat
--E 142
---S 143 of 177
+--S 143 of 183
dznrm2(3,a,2) -- should be 13.077
--R
--R (3) 13.076696830622021
--R Type: DoubleFloat
--E 143
---S 144 of 177
+--S 144 of 183
dznrm2(3,a,1) -- should be 11.269
--R
--R (4) 11.269427669584644
--R Type: DoubleFloat
--E 144
---S 145 of 177
+--S 145 of 183
dznrm2(3,a,-1) -- should be 0.0
--R
--R (5) 0.
--R Type: DoubleFloat
--E 145
---S 146 of 177
+--S 146 of 183
dznrm2(-3,a,-1) -- should be 0.0
--R
--R (6) 0.
--R Type: DoubleFloat
--E 146
---S 147 of 177
+--S 147 of 183
dznrm2(1,a,1) -- should be 5.0
--R
--R (7) 5.
--R Type: DoubleFloat
--E 147
---S 148 of 177
+--S 148 of 183
dznrm2(1,a,2) -- should be 5.0
--R
--R (8) 5.
@@ -1637,47 +1637,47 @@ dznrm2(1,a,2) -- should be 5.0
)clear all
---S 149 of 177
+--S 149 of 183
a:PRIMARR(COMPLEX(FLOAT))
--R Type: Void
--E 149
---S 150 of 177
+--S 150 of 183
a:=[[3.+4.*%i,-4.+5.*%i,5.+6.*%i,7.-8.*%i,-9.-2.*%i]]
--R
--R (2) [3.0 + 4.0 %i,- 4.0 + 5.0 %i,5.0 + 6.0 %i,7.0 - 8.0 %i,- 9.0 - 2.0 %i]
--R Type: PrimitiveArray(Complex(Float))
--E 150
---S 151 of 177
+--S 151 of 183
icamax(5,a,1) -- should be 3
--R
--R (3) 3
--R Type: PositiveInteger
--E 151
---S 152 of 177
+--S 152 of 183
icamax(0,a,1) -- should be -1
--R
--R (4) - 1
--R Type: Integer
--E 152
---S 153 of 177
+--S 153 of 183
icamax(5,a,-1) -- should be -1
--R
--R (5) - 1
--R Type: Integer
--E 153
---S 154 of 177
+--S 154 of 183
icamax(3,a,1) -- should be 2
--R
--R (6) 2
--R Type: PositiveInteger
--E 155
---S 155 of 177
+--S 155 of 183
icamax(3,a,2) -- should be 1
--R
--R (7) 1
@@ -1686,77 +1686,77 @@ icamax(3,a,2) -- should be 1
)clear all
---S 156 of 177
+--S 156 of 183
a:PRIMARR(DFLOAT):=[[3.0, 4.0, -3.0, 5.0, -1.0]]
--R
--R (1) [3.,4.,- 3.,5.,- 1.]
--R Type: PrimitiveArray(DoubleFloat)
--E 156
---S 157 of 177
+--S 157 of 183
idamax(5,a,1) -- should be 3
--R
--R (2) 3
--R Type: PositiveInteger
--E 157
---S 158 of 177
+--S 158 of 183
idamax(3,a,1) -- should be 1
--R
--R (3) 1
--R Type: PositiveInteger
--E 158
---S 159 of 177
+--S 159 of 183
idamax(0,a,1) -- should be -1
--R
--R (4) - 1
--R Type: Integer
--E 159
---S 160 of 177
+--S 160 of 183
idamax(-5,a,1) -- should be -1
--R
--R (5) - 1
--R Type: Integer
--E 160
---S 161 of 177
+--S 161 of 183
idamax(5,a,-1) -- should be -1
--R
--R (6) - 1
--R Type: Integer
--E 161
---S 162 of 177
+--S 162 of 183
idamax(5,a,2) -- should be 0
--R
--R (7) 0
--R Type: NonNegativeInteger
--E 162
---S 163 of 177
+--S 163 of 183
idamax(1,a,0) -- should be -1
--R
--R (8) - 1
--R Type: Integer
--E 163
---S 164 of 177
+--S 164 of 183
idamax(1,a,-1) -- should be -1
--R
--R (9) - 1
--R Type: Integer
--E 164
---S 165 of 177
+--S 165 of 183
a:PRIMARR(DFLOAT):=[[3.0, 4.0, -3.0, -5.0, -1.0]]
--R
--R (10) [3.,4.,- 3.,- 5.,- 1.]
--R Type: PrimitiveArray(DoubleFloat)
--E 165
---S 166 of 177
+--S 166 of 183
idamax(5,a,1) -- should be 3
--R
--R (11) 3
@@ -1765,7 +1765,7 @@ idamax(5,a,1) -- should be 3
)clear all
---S 167 of 177
+--S 167 of 183
a:PRIMARR(FLOAT):=[[3.0, 4.0, -3.0, 5.0, -1.0]]
--R
--R
@@ -1773,63 +1773,63 @@ a:PRIMARR(FLOAT):=[[3.0, 4.0, -3.0, 5.0, -1.0]]
--R Type: PrimitiveArray(Float)
--E 167
---S 168 of 177
+--S 168 of 183
isamax(5,a,1) -- should be 3
--R
--R (2) 3
--R Type: PositiveInteger
--E 168
---S 169 of 177
+--S 169 of 183
isamax(3,a,1) -- should be 1
--R
--R (3) 1
--R Type: PositiveInteger
--E 169
---S 170 of 177
+--S 170 of 183
isamax(0,a,1) -- should be -1
--R
--R (4) - 1
--R Type: Integer
--E 170
---S 171 of 177
+--S 171 of 183
isamax(-5,a,1) -- should be -1
--R
--R (5) - 1
--R Type: Integer
--E 171
---S 172 of 177
+--S 172 of 183
isamax(5,a,-1) -- should be -1
--R
--R (6) - 1
--R Type: Integer
--E 172
---S 173 of 177
+--S 173 of 183
isamax(5,a,2) -- should be 0
--R
--R (7) 0
--R Type: NonNegativeInteger
--E 173
---S 174 of 177
+--S 174 of 183
isamax(1,a,0) -- should be -1
--R
--R (8) - 1
--R Type: Integer
--E 174
---S 175 of 177
+--S 175 of 183
isamax(1,a,-1) -- should be -1
--R
--R (9) - 1
--R Type: Integer
--E 175
---S 176 of 177
+--S 176 of 183
a:PRIMARR(FLOAT):=[[3.0, 4.0, -3.0, -5.0, -1.0]]
--R
--R
@@ -1837,13 +1837,57 @@ a:PRIMARR(FLOAT):=[[3.0, 4.0, -3.0, -5.0, -1.0]]
--R Type: PrimitiveArray(Float)
--E 176
---S 177 of 177
+--S 177 of 183
isamax(5,a,1) -- should be 3
--R
--R (11) 3
--R Type: PositiveInteger
--E 177
+)clear all
+
+--S 178 of 183
+a:PRIMARR(COMPLEX(DFLOAT)):=[[3.+4.*%i,-4.+5.*%i,5.+6.*%i,7.-8.*%i,-9.-2.*%i]]
+--R
+--R (1) [3. + 4. %i,- 4. + 5. %i,5. + 6. %i,7. - 8. %i,- 9. - 2. %i]
+--R Type: PrimitiveArray(Complex(DoubleFloat))
+--E 178
+
+--S 179 of 183
+izamax(5,a,1) -- should be 3
+--R
+--R (2) 3
+--R Type: PositiveInteger
+--E 179
+
+--S 180 of 183
+izamax(0,a,1) -- should be -1
+--R
+--R (3) - 1
+--R Type: Integer
+--E 180
+
+--S 181 of 183
+izamax(5,a,-1) -- should be -1
+--R
+--R (4) - 1
+--R Type: Integer
+--E 181
+
+--S 182 of 183
+izamax(3,a,1) -- should be 2
+--R
+--R (5) 2
+--R Type: PositiveInteger
+--E 182
+
+--S 183 of 183
+izamax(3,a,2) -- should be 1
+--R
+--R (6) 1
+--R Type: PositiveInteger
+--E 183
+
)spool
)lisp (bye)
\end{chunk}
@@ -2104,6 +2148,19 @@ BlasLevelOne() : Exports == Implementation where
++X a:PRIMARR(FLOAT):=[[3.0, 4.0, -3.0, -5.0, -1.0]]
++X isamax(5,a,1) -- should be 3
+ izamax: (SI, PCDF, SI) -> INT
+ ++ izamax computes the largest absolute value of the elements
+ ++ of the array and returns the index of the first instance
+ ++ of the maximum.
+ ++
+ ++X a:PRIMARR(COMPLEX(DFLOAT))
+ ++X a:=[[3.+4.*%i,-4.+5.*%i,5.+6.*%i,7.-8.*%i,-9.-2.*%i]]
+ ++X izamax(5,a,1) -- should be 3
+ ++X izamax(0,a,1) -- should be -1
+ ++X izamax(5,a,-1) -- should be -1
+ ++X izamax(3,a,1) -- should be 2
+ ++X izamax(3,a,2) -- should be 1
+
Implementation == add
dcabs1(z:CDF):DF ==
@@ -2136,6 +2193,8 @@ BlasLevelOne() : Exports == Implementation where
IDAMAX(n,dz,incx)$Lisp
isamax(n:INT,dz:SX,incx:INT):INT ==
ISAMAXSPAD(n,dz,incx)$Lisp
+ izamax(n:SI,dz:PCDF,incx:SI):INT ==
+ IZAMAXSPAD(n,dz,incx)$Lisp
\end{chunk}
\begin{chunk}{BLAS1.dotabb}
@@ -7580,6 +7639,13 @@ write all of the BLAS code using Spad internal representation or we
could follow the BLAS code standard. I've decided to follow the BLAS
code standard so we need to create thunks to do the data translation.
+NOTE: The Axiom internal representation of
+PRIMARR(COMPLEX(FLOAT)) is an array where each array element AE is
+\begin{verbatim}
+ AE = (cons (cons (therealpart 0)) (cons (theimagpart 0)))
+\end{verbatim}
+so we need (caar AE) and (cadr AE) to get the real and imag parts.
+
\begin{chunk}{BLAS 1 dznrm2}
(defun dznrm2Spad (n zx incx)
; Tim Daly May 8, 2012
@@ -8600,6 +8666,49 @@ NOTES
\end{chunk}
+\begin{chunk}{isamax.f}
+ integer function isamax(n,sx,incx)
+c
+c finds the index of element having max. absolute value.
+c jack dongarra, linpack, 3/11/78.
+c modified 3/93 to return if incx .le. 0.
+c modified 12/3/93, array(1) declarations changed to array(*)
+c
+ real sx(*),smax
+ integer i,incx,ix,n
+c
+ isamax = 0
+ if( n.lt.1 .or. incx.le.0 ) return
+ isamax = 1
+ if(n.eq.1)return
+ if(incx.eq.1)go to 20
+c
+c code for increment not equal to 1
+c
+ ix = 1
+ smax = abs(sx(1))
+ ix = ix + incx
+ do 10 i = 2,n
+ if(abs(sx(ix)).le.smax) go to 5
+ isamax = i
+ smax = abs(sx(ix))
+ 5 ix = ix + incx
+ 10 continue
+ return
+c
+c code for increment equal to 1
+c
+ 20 smax = abs(sx(1))
+ do 30 i = 2,n
+ if(abs(sx(i)).le.smax) go to 30
+ isamax = i
+ smax = abs(sx(i))
+ 30 continue
+ return
+ end
+
+\end{chunk}
+
\begin{chunk}{isamaxEX example}
program isamaxEX
* Tim Daly May 19, 2012
@@ -8671,49 +8780,6 @@ should be 4
n= 4
\end{verbatim}
-\begin{chunk}{isamax.f}
- integer function isamax(n,sx,incx)
-c
-c finds the index of element having max. absolute value.
-c jack dongarra, linpack, 3/11/78.
-c modified 3/93 to return if incx .le. 0.
-c modified 12/3/93, array(1) declarations changed to array(*)
-c
- real sx(*),smax
- integer i,incx,ix,n
-c
- isamax = 0
- if( n.lt.1 .or. incx.le.0 ) return
- isamax = 1
- if(n.eq.1)return
- if(incx.eq.1)go to 20
-c
-c code for increment not equal to 1
-c
- ix = 1
- smax = abs(sx(1))
- ix = ix + incx
- do 10 i = 2,n
- if(abs(sx(ix)).le.smax) go to 5
- isamax = i
- smax = abs(sx(ix))
- 5 ix = ix + incx
- 10 continue
- return
-c
-c code for increment equal to 1
-c
- 20 smax = abs(sx(1))
- do 30 i = 2,n
- if(abs(sx(i)).le.smax) go to 30
- isamax = i
- smax = abs(sx(i))
- 30 continue
- return
- end
-
-\end{chunk}
-
Spad represents complex numbers as a pair where the car is the real
part and the cons is the imaginary part. BLAS wants a complex number
in fortran format. So we have a design choice to make. Either we could
@@ -8721,27 +8787,6 @@ write all of the BLAS code using Spad internal representation or we
could follow the BLAS code standard. I've decided to follow the BLAS
code standard so we need to create thunks to do the data translation.
-NOTE: The Axiom internal representation of
-PRIMARR(COMPLEX(FLOAT)) is an array where each array element AE is
-\begin{verbatim}
- AE = (cons (cons (therealpart 0)) (cons (theimagpart 0)))
-\end{verbatim}
-so we need (caar AE) and (cadr AE) to get the real and imag parts.
-
-NOTE: Array indexing in Axiom is 0-based but Fortran is 1-based so
-the results are displaced by 1.
-
-\begin{chunk}{BLAS 1 isamax}
-(defun isamaxSpad (n zx incx)
-; Tim Daly May 13, 2012
- (let (result vec)
- (dotimes (i (length zx))
- (format t "~s~%" (svref zx i))
- (push (coerce (caar (svref zx i)) 'single-float) result))
- (setq vec (make-array (length result) :initial-contents (nreverse result)
- :element-type 'single-float))
- (isamax n vec incx)))
-
\begin{chunk}{BLAS 1 isamax}
(defun isamaxSpad (n zx incx)
; Tim Daly May 19, 2012
@@ -8812,6 +8857,48 @@ the results are displaced by 1.
)set message auto off
)clear all
+--S 1 of 6
+a:PRIMARR(COMPLEX(DFLOAT)):=[[3.+4.*%i,-4.+5.*%i,5.+6.*%i,7.-8.*%i,-9.-2.*%i]]
+--R
+--R (1) [3. + 4. %i,- 4. + 5. %i,5. + 6. %i,7. - 8. %i,- 9. - 2. %i]
+--R Type: PrimitiveArray(Complex(DoubleFloat))
+--E 1
+
+--S 2 of 6
+izamax(5,a,1) -- should be 3
+--R
+--R (2) 3
+--R Type: PositiveInteger
+--E 2
+
+--S 3 of 6
+izamax(0,a,1) -- should be -1
+--R
+--R (3) - 1
+--R Type: Integer
+--E 3
+
+--S 4 of 6
+izamax(5,a,-1) -- should be -1
+--R
+--R (4) - 1
+--R Type: Integer
+--E 4
+
+--S 5 of 6
+izamax(3,a,1) -- should be 2
+--R
+--R (5) 2
+--R Type: PositiveInteger
+--E 5
+
+--S 6 of 6
+izamax(3,a,2) -- should be 1
+--R
+--R (6) 1
+--R Type: PositiveInteger
+--E 6
+
)spool
)lisp (bye)
\end{chunk}
@@ -8820,6 +8907,30 @@ the results are displaced by 1.
izamax examples
====================================================================
+a:PRIMARR(COMPLEX(DFLOAT)):=[[3.+4.*%i,-4.+5.*%i,5.+6.*%i,7.-8.*%i,-9.-2.*%i]]
+
+ [3. + 4. %i,- 4. + 5. %i,5. + 6. %i,7. - 8. %i,- 9. - 2. %i]
+
+izamax(5,a,1)
+
+ 3
+
+izamax(0,a,1)
+
+ - 1
+
+izamax(5,a,-1)
+
+ - 1
+
+izamax(3,a,1)
+
+ 2
+
+izamax(3,a,2)
+
+ 1
+
====================================================================
Man Page Details
====================================================================
@@ -8922,52 +9033,159 @@ c
\end{chunk}
+\begin{chunk}{izamaxEX example}
+ program izamaxEX
+* Tim Daly May 20, 2012
+* unit tests for BLAS izamax
+ double complex a(5)
+ integer n
+ a = (/ (1.0D0,2.0D0), (-3.0D0,4.0D0), (5.0D0,-6.0D0),
+ C (0.0D0,8.0D0), (0.0D0,-8.0D0) /)
+ write(6,100)dble(a(1)),dimag(a(1))
+ 100 format("a(1)=C(",f6.3," ",f6.3,")")
+ write(6,101)dble(a(2)),dimag(a(2))
+ 101 format("a(2)=C(",f6.3," ",f6.3,")")
+ write(6,102)dble(a(3)),dimag(a(3))
+ 102 format("a(3)=C(",f6.3," ",f6.3,")")
+ write(6,103)dble(a(4)),dimag(a(4))
+ 103 format("a(4)=C(",f6.3," ",f6.3,")")
+ write(6,104)dble(a(5)),dimag(a(5))
+ 104 format("a(5)=C(",f6.3," ",f6.3,")")
+ n=izamax(5,a,1)
+ write(6,200)n
+ 200 format("should be 3",/,"n=",i3)
+ n=izamax(3,a,1)
+ write(6,201)n
+ 201 format("should be 3",/,"n=",i3)
+ n=izamax(0,a,1)
+ write(6,202)n
+ 202 format("should be 0",/,"n=",i3)
+ n=izamax(-5,a,1)
+ write(6,203)n
+ 203 format("should be 0",/,"n=",i3)
+ n=izamax(5,a,-1)
+ write(6,204)n
+ 204 format("should be 0",/,"n=",i3)
+ n=izamax(5,a,2)
+ write(6,205)n
+ 205 format("should be 2",/,"n=",i3)
+ n=izamax(1,a,0)
+ write(6,206)n
+ 206 format("should be 0",/,"n=",i3)
+ n=izamax(1,a,-1)
+ write(6,207)n
+ 207 format("should be 0",/,"n=",i3)
+ n=izamax(1,a,5)
+ write(6,208)n
+ 208 format("should be 1",/,"n=",i3)
+ stop
+ end
+\end{chunk}
+
+\begin{verbatim}
+gcc -o izamaxEX izamaxEX.f -lgfortran izamax.o dcabs1.o && ./izamaxEX
+a(1)=C( 1.000 2.000)
+a(2)=C(-3.000 4.000)
+a(3)=C( 5.000 -6.000)
+a(4)=C( 0.000 8.000)
+a(5)=C( 0.000 -8.000)
+should be 3
+n= 3
+should be 3
+n= 3
+should be 0
+n= 0
+should be 0
+n= 0
+should be 0
+n= 0
+should be 2
+n= 2
+should be 0
+n= 0
+should be 0
+n= 0
+should be 1
+n= 1
+\end{verbatim}
+
+Spad represents complex numbers as a pair where the car is the real
+part and the cons is the imaginary part. BLAS wants a complex number
+in fortran format. So we have a design choice to make. Either we could
+write all of the BLAS code using Spad internal representation or we
+could follow the BLAS code standard. I've decided to follow the BLAS
+code standard so we need to create thunks to do the data translation.
+
+NOTE: The Axiom internal representation of
+PRIMARR(COMPLEX(DFLOAT)) is an array where each array element AE is
+\begin{verbatim}
+ AE = (cons (therealpart 0)) (cons (theimagpart 0))
+\end{verbatim}
+so we need (car AE) and (cdr AE) to get the real and imag parts.
+
+NOTE: Array indexing in Axiom is 0-based but Fortran is 1-based so
+the results are displaced by 1.
+
\begin{chunk}{BLAS 1 izamax}
+(defun izamaxSpad (n zx incx)
+; Tim Daly May 20, 2012
+ (let (result vec)
+ (dotimes (i (length zx))
+ (push (complex (car (svref zx i)) (cdr (svref zx i))) result))
+ (setq vec (make-array (length result) :initial-contents (nreverse result)))
+ (izamax n vec incx)))
+
(defun izamax (n zx incx)
- (declare (type (simple-array (complex double-float) (*)) zx)
- (type fixnum incx n))
- (f2cl-lib:with-multi-array-data
- ((zx (complex double-float) zx-%data% zx-%offset%))
- (prog ((i 0) (ix 0) (smax 0.0) (izamax 0))
- (declare (type (double-float) smax)
- (type fixnum izamax ix i))
- (setf izamax 0)
- (if (or (< n 1) (<= incx 0)) (go end_label))
- (setf izamax 1)
- (if (= n 1) (go end_label))
- (if (= incx 1) (go label20))
- (setf ix 1)
- (setf smax (dcabs1 (f2cl-lib:fref zx-%data% (1) ((1 *)) zx-%offset%)))
- (setf ix (f2cl-lib:int-add ix incx))
- (f2cl-lib:fdo (i 2 (f2cl-lib:int-add i 1))
- ((> i n) nil)
- (tagbody
- (if
- (<= (dcabs1 (f2cl-lib:fref zx-%data% (ix) ((1 *)) zx-%offset%))
- smax)
- (go label5))
- (setf izamax i)
- (setf smax
- (dcabs1 (f2cl-lib:fref zx-%data% (ix) ((1 *)) zx-%offset%)))
- label5
- (setf ix (f2cl-lib:int-add ix incx))))
- (go end_label)
- label20
- (setf smax (dcabs1 (f2cl-lib:fref zx-%data% (1) ((1 *)) zx-%offset%)))
- (f2cl-lib:fdo (i 2 (f2cl-lib:int-add i 1))
- ((> i n) nil)
- (tagbody
- (if
- (<= (dcabs1 (f2cl-lib:fref zx-%data% (i) ((1 *)) zx-%offset%)) smax)
- (go label30))
- (setf izamax i)
- (setf smax
- (dcabs1 (f2cl-lib:fref zx-%data% (i) ((1 *)) zx-%offset%)))
- label30))
- end_label
- (return (values izamax nil nil nil)))))
+; Tim Daly May 20, 2012
+ (declare (type (simple-array (complex double-float) (*)) zx)
+ (type fixnum incx n))
+ (let ((ix 0) (zmax 0.0d0) (izamax -1) (limit (length zx)))
+ (declare (type (double-float) zmax) (type fixnum izamax ix limit))
+ (when (and (>= n 1) (> incx 0))
+ (setf izamax 0)
+ (setf zmax (the double-float
+ (dcabs1 (the (complex double-float) (svref zx 0)))))
+ (setf ix (+ ix incx))
+ (do ((i 1 (+ i 1)))
+ ((or (>= ix limit) (>= i n)))
+ (when (> (the double-float
+ (dcabs1 (the (complex double-float) (svref zx ix))))
+ zmax)
+ (setf izamax i)
+ (setf zmax (the double-float
+ (dcabs1 (the (complex double-float) (svref zx ix))))))
+ (setf ix (the fixnum (+ ix incx)))))
+ izamax))
+
+\end{chunk}
+
+\begin{chunk}{BLAS 1 izamax lisp test}
+(load "dcabs1.lisp")
+(load "izamax.lisp")
+(setq a (vector #C(1.0d0 2.0d0) #C(-3.0d0 4.0d0) #C(5.0d0 -6.0d0)
+ #C(0.0d0 8.0d0) #C(0.0d0 -8.0d0)))
+; #(#C(1.0 2.0) #C(-3.0 4.0) #C(5.0 -6.0) #C(0.0 8.0) #C(0.0 -8.0))
+(izamax 5 a 1)
+; 2
+(izamax 3 a 1)
+; 2
+(izamax 0 a 1)
+; -1
+(izamax -5 a 1)
+; -1
+(izamax 5 a -1)
+; -1
+(izamax 5 a 2)
+; 1
+(izamax 1 a 0)
+; -1
+(izamax 1 a -1)
+; -1
+(izamax 1 a 5)
+; 0
\end{chunk}
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{zaxpy BLAS}
%\pagehead{zaxpy}{zaxpy}
@@ -140093,12 +140311,12 @@ Warning: Types of argument 1 in call to ZLARFB do not match.
\getchunk{BLAS 1 icamax}
\getchunk{BLAS 1 idamax}
\getchunk{BLAS 1 isamax}
+\getchunk{BLAS 1 izamax}
\end{chunk}
\begin{chunk}{untested}
\getchunk{BLAS lsame}
\getchunk{BLAS xerbla}
-\getchunk{BLAS 1 izamax}
\getchunk{BLAS 1 zaxpy}
\getchunk{BLAS 1 zcopy}
\getchunk{BLAS 1 zdotc}
diff --git a/changelog b/changelog
index 339aa98..2cee059 100644
--- a/changelog
+++ b/changelog
@@ -1,3 +1,5 @@
+20120520 tpd src/axiom-website/patches.html 20120520.01.tpd.patch
+20120520 tpd books/bookvol10.5 BLAS1 izamax
20120519 tpd src/axiom-website/patches.html 20120519.01.tpd.patch
20120519 tpd books/bookvol10.5 BLAS1 isamax
20120517 tpd src/axiom-website/patches.html 20120517.01.tpd.patch
diff --git a/src/axiom-website/patches.html b/src/axiom-website/patches.html
index cb740c0..12dbc7b 100644
--- a/src/axiom-website/patches.html
+++ b/src/axiom-website/patches.html
@@ -3922,5 +3922,7 @@ books/bookvol10.5 BLAS1 idamax
src/input/simplify.input added from sci.math.symbolic
20120519.01.tpd.patch
books/bookvol10.5 BLAS1 isamax
+20120520.01.tpd.patch
+books/bookvol10.5 BLAS1 izamax