diff --git a/books/bookvol10.5.pamphlet b/books/bookvol10.5.pamphlet index 8e0576c..7b635b5 100644 --- a/books/bookvol10.5.pamphlet +++ b/books/bookvol10.5.pamphlet @@ -311,7 +311,140 @@ For complex symmetric matrices, TRANSx=H is not allowed. \chapter{Algebra Cover Code} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \section{package BLAS1 BlasLevelOne} -%\pagehead{BlasLevelOne}{BLAS1} +<>= +)set break resume +)sys rm -f BlasLevelOne.output +)spool BlasLevelOne.output +)set message test on +)set message auto off +)clear all + +--S 1 of 10 +t1:Complex DoubleFloat := complex(1.0,0) +--R +--R +--R (1) 1. +--R Type: Complex DoubleFloat +--E 1 + +--S 2 of 10 +dcabs1(t1) +--R +--R +--R (2) 1. +--R Type: DoubleFloat +--E 2 + +--S 3 of 10 +t2:Complex DoubleFloat := complex(1.0,1.0) +--R +--R +--R (3) 1. + %i +--R Type: Complex DoubleFloat +--E 3 + +--S 4 of 10 +dcabs1(t2) +--R +--R +--R (4) 2. +--R Type: DoubleFloat +--E 4 + +--S 5 of 10 +t3:Complex DoubleFloat := complex(1.0,-1.0) +--R +--R +--R (5) 1. - %i +--R Type: Complex DoubleFloat +--E 5 + +--S 6 of 10 +dcabs1(t3) +--R +--R +--R (6) 2. +--R Type: DoubleFloat +--E 6 + +--S 7 of 10 +t4:Complex DoubleFloat := complex(-1.0,-1.0) +--R +--R +--R (7) - 1. - %i +--R Type: Complex DoubleFloat +--E 7 + +--S 8 of 10 +dcabs1(t4) +--R +--R +--R (8) 2. +--R Type: DoubleFloat +--E 8 + +--S 9 of 10 +t5:Complex DoubleFloat := complex(-2.0,-2.0) +--R +--R +--R (9) - 2. - 2. %i +--R Type: Complex DoubleFloat +--E 9 + +--S 10 of 10 +dcabs1(t5) +--R +--R +--R (10) 4. +--R Type: DoubleFloat +--E 10 + +)spool +)lisp (bye) +@ +<>= +==================================================================== +BlasLevelOne examples +==================================================================== + +The dcabs1 routine computes the sum of the absolute value of the +real and imaginary parts of a complex number. + +t1:Complex DoubleFloat := complex(1.0,0) + 1. + +dcabs1(t1) + 1. + +t2:Complex DoubleFloat := complex(1.0,1.0) + 1. + %i + +dcabs1(t2) + 2. + +t3:Complex DoubleFloat := complex(1.0,-1.0) + 1. - %i + +dcabs1(t3) + 2. + +t4:Complex DoubleFloat := complex(-1.0,-1.0) + - 1. - %i + +dcabs1(t4) + 2. + +t5:Complex DoubleFloat := complex(-2.0,-2.0) + - 2. - 2. %i + +dcabs1(t5) + 4. + +See Also: +o )show BlasLevelOne + +@ +\pagehead{BlasLevelOne}{BLAS1} %\pagepic{ps/v104blaslevelone.ps}{BLAS1}{1.00} {\bf Exports:}\\ @@ -335,8 +468,11 @@ BlasLevelOne() : Exports == Implementation where Exports == with - dcabs1: CDF -> DF + dcabs1: CDF -> DF ++ dcabs1(z) computes (+ (abs (realpart z)) (abs (imagpart z))) + ++ + ++X t1:Complex DoubleFloat := complex(1.0,0) + ++X dcabs(t1) Implementation == add @@ -374,7 +510,8 @@ Axiom represents the type Complex(DoubleFloat) as a pair whose car is the real part and whose cdr is the imaginary part. <>= (defun dcabs1 (z) - "Complex(DoubleFloat) z is a pair where (realpart . imaginarypart)" + "Complex(DoubleFloat) z is a pair where (realpart . imaginarypart). + The result is a DoubleFloat (+ (abs (realpart z)) (abs (imagpart z)))" (the double-float (+ (the double-float (abs (the double-float (car z)))) diff --git a/changelog b/changelog index cb9fa24..f85f885 100644 --- a/changelog +++ b/changelog @@ -1,3 +1,6 @@ +20100403 tpd src/axiom-website/patches.html 20100403.01.tpd.patch +20100403 tpd src/algebra/Makefile BLAS1 regression and help +20100403 tpd books/bookvol10.5 BLAS1 regress, help, and function documentation 20100402 tpd src/axiom-website/patches.html 20100402.01.tpd.patch 20100402 tpd src/interp/Makefile add Volume 10.5 Axiom Numerics 20100402 tpd src/algebra/Makefile add Volume 10.5 Axiom Numerics diff --git a/src/algebra/Makefile.pamphlet b/src/algebra/Makefile.pamphlet index ceaf8ab..3f2928e 100644 --- a/src/algebra/Makefile.pamphlet +++ b/src/algebra/Makefile.pamphlet @@ -16460,6 +16460,7 @@ SPADHELP=\ ${HELP}/Bezier.help \ ${HELP}/BinaryExpansion.help \ ${HELP}/BinarySearchTree.help \ + ${HELP}/BlasLevelOne.help \ ${HELP}/CardinalNumber.help \ ${HELP}/CartesianTensor.help \ ${HELP}/Character.help \ @@ -16610,6 +16611,7 @@ REGRESS= \ Bezier.regress \ BinaryExpansion.regress \ BinarySearchTree.regress \ + BlasLevelOne.regress \ CardinalNumber.regress \ CartesianTensor.regress \ Character.regress \ @@ -16847,6 +16849,16 @@ ${HELP}/BinarySearchTree.help: ${BOOKS}/bookvol10.3.pamphlet >${INPUT}/BinarySearchTree.input @echo "BinarySearchTree (BSTREE)" >>${HELPFILE} +${HELP}/BlasLevelOne.help: ${BOOKS}/bookvol10.5.pamphlet + @echo 7080 create BlasLevelOne.help from \ + ${BOOKS}/bookvol10.5.pamphlet + @${TANGLE} -R"BlasLevelOne.help" ${BOOKS}/bookvol10.5.pamphlet \ + >${HELP}/BlasLevelOne.help + @cp ${HELP}/BlasLevelOne.help ${HELP}/BLAS1.help + @${TANGLE} -R"BlasLevelOne.input" ${BOOKS}/bookvol10.5.pamphlet \ + >${INPUT}/BlasLevelOne.input + @echo "BlasLevelOne (BLAS1)" >>${HELPFILE} + ${HELP}/CardinalNumber.help: ${BOOKS}/bookvol10.3.pamphlet @echo 7080 create CardinalNumber.help from \ ${BOOKS}/bookvol10.3.pamphlet diff --git a/src/axiom-website/patches.html b/src/axiom-website/patches.html index 3698062..c0aa01b 100644 --- a/src/axiom-website/patches.html +++ b/src/axiom-website/patches.html @@ -2607,5 +2607,7 @@ readme add Nelson Beebe and Steve Toleque to credits
books/bookvol4 document steps for adding algebra
20100402.01.tpd.patch books/bookvol10.5 add Volume 10.5 Axiom Numerics
+20100403.01.tpd.patch +books/bookvol10.5 BLAS1 regress, help, and function documentation