[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Axiom-developer] Re: Axiom + High Energy Physics
From: |
Camm Maguire |
Subject: |
Re: [Axiom-developer] Re: Axiom + High Energy Physics |
Date: |
15 Nov 2005 20:24:31 -0500 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 |
Greetings!
> The Makefile.pamphlet in the directory will be used to construct
> the proper files to hook into Axiom.
>
> I don't yet have this fully implemented for all of BLAS but it's coming.
>
> I believe Camm is the BLAS maintainer but i'm not certain.
>
For Debian, yes. blas, lapack and atlas. I'd love to do an official
gcl binding to these libs someday. One poster on this list has
already achieved the rudiments at least. The key to remember, if you
want my opinion, is to interface to generic blas and lapack,
preferably using the fortran interface (as clapack is a bit unusual),
and then rely on Debian's (or similar) ld.so trick to automatically
pull in optimized atlas compatible libraries at runtime depending on
the capabilities of the running cpu. Quite a large tree of software
in Debian is transparently linking against atlas in this way at
present. For x86, for example, one can choose from atlas3-base,
atlas3-sse, atlas3-sse2, and atlas3-3dnow -- just install the package
and get the performance benefit on appropriate harddware without
recompiling!. I'd love gmp3 to do the same someday.
Take care,
> t
>
> =========================================================================
>
> \documentclass{article}
> \usepackage{axiom}
> \begin{document}
> \title{subroutine drotg(da,db,c,s)}
> \author{Jack Dongarra}
> \maketitle
> \begin{abstract}
> \end{abstract}
> \eject
> \tableofcontents
> \eject
> \section{Purpose}
> This generates a real Givens plane rotation with parameters $c$ and $s$
> such that given a real $a$ and $b$:
> $$
> \left(
> \begin{array}{cc}
> c & s\\
> -s & c
> \end{array}
> \right)
> \left(
> \begin{array}{c}
> da\\
> db
> \end{array}
> \right)
> =
> \left(
> \begin{array}{c}
> f\\
> 0
> \end{array}
> \right)
> $$
> \noindent
> The routine computes $c$, $s$, and $f$ as follows:
> $$
> f = \sigma{}\sqrt{da^2 + db^2}
> $$
> $$
> c=\left\{
> \begin{array}{ccc}
> da/f & {\rm if\ }& f \ne 0\\
> 1 & {\rm if\ }& f = 0
> \end{array}
> \right.
> s=\left\{
> \begin{array}{ccc}
> db/f & {\rm if\ }& f \ne 0\\
> 0 & {\rm if\ }& f = 0
> \end{array}
> \right.
> $$
> $$
> {\rm where\ \ \ \ }
> \sigma=\left\{
> \begin{array}{ccc}
> {\rm sign\ }da & {\rm if\ }& \vert{}da\vert{} > \vert{}db\vert{}\\
> {\rm sign\ }db & {\rm if\ }& \vert{}da\vert{} \le \vert{}db\vert{}\\
> \end{array}
> \right.
> $$
> The routine also computes the value of $z$ defined as
> $$
> z=\left\{
> \begin{array}{ccl}
> s & {\rm if\ }& \vert{}s\vert{} < c {\rm\ or\ }c = 0\\
> 1/c & {\rm if\ }& 0 < \vert{}c\vert{} \le s
> \end{array}
> \right.
> $$
> This enables $c$ and $s$ to be reconstructed from the single value $z$ as
> $$
> c=\left\{
> \begin{array}{ccc}
> \sqrt{1-z^2} & {\rm if\ }& \vert{}z\vert{} \le 1\\
> 1/z & {\rm if\ }& \vert{}z\vert{} > 1
> \end{array}
> \right.
> s=\left\{
> \begin{array}{ccc}
> z & {\rm if\ }& \vert{}z\vert{} \le 1\\
> \sqrt{1-c^2} & {\rm if\ }& \vert{}z\vert{} > 1
> \end{array}
> \right.
> $$
> To apply the plane rotation to a pair of real vectors call DROT.
> \section{Specification}
> \begin{verbatim}
> subroutine drotg(double precision da,
> double precision db,
> double precision c,
> double precision s)
> \end{verbatim}
> \section{Parameters}
> \begin{list}{}
> \item {\bf da} (Double Precision)
> \begin{list}{}
> \item {\sl Entry}: first element of the vector which determines the rotation
> \item {\sl Exit}: the value {f}
> \end{list}
> \item {\bf db} (Double Precision)
> \begin{list}{}
> \item {\sl Entry}: second element of the vector which determines the rotation
> \item {\sl Exit}: the value {z}
> \end{list}
> \item {\bf c} (Double Precision)
> \begin{list}{}
> \item {\sl Entry}: no value
> \item {\sl Exit}: cosine of the rotation
> \end{list}
> \item {\bf s} (Double Precision)
> \begin{list}{}
> \item {\sl Entry}: no value
> \item {\sl Exit}: sine of the rotation
> \end{list}
> \end{list}
> \section{Error Indicators and Warnings}
> None.
> \section{Examples}
> \subsection{Example 1: $f = 0$}
> \begin{verbatim}
> call drotg( 0.0, 0,0, c, s)
> ==>
> da = 0.0
> db = 0.0
> c = 1.0
> s = 0.0
> \end{verbatim}
> \subsection{Example 2: $c = 0$}
> \begin{verbatim}
> call drotg( 0.0, 2.0, c, s)
> ==>
> da = 2.0
> db = 1.0
> c = 0.0
> s = 1.0
> \end{verbatim}
> \subsection{Example 3: $\vert{}b\vert{} > \vert{}a\vert{}$}
> \begin{verbatim}
> call drotg( 6.0, -8.0, c, s)
> ==>
> da = -10.0
> db = -1.666...
> c = -0.5
> s = 0.8
> \end{verbatim}
> \subsection{Example 4: $\vert{}a\vert{} > \vert{}b\vert{}$}
> \begin{verbatim}
> call drotg( 8.0, 6.0, c, s)
> ==>
> da = 10.0
> db = 0.6
> c = 0.8
> s = 0.6
> \end{verbatim}
> <<fortran>>=
> subroutine drotg(da,db,c,s)
> c
> c construct givens plane rotation.
> c jack dongarra, linpack, 3/11/78.
> c
> double precision da,db,c,s,roe,scale,r,z
> c
> roe = db
> if( dabs(da) .gt. dabs(db) ) roe = da
> scale = dabs(da) + dabs(db)
> if( scale .ne. 0.0d0 ) go to 10
> c = 1.0d0
> s = 0.0d0
> r = 0.0d0
> z = 0.0d0
> go to 20
> 10 r = scale*dsqrt((da/scale)**2 + (db/scale)**2)
> r = dsign(1.0d0,roe)*r
> c = da/r
> s = db/r
> z = 1.0d0
> if( dabs(da) .gt. dabs(db) ) z = s
> if( dabs(db) .ge. dabs(da) .and. c .ne. 0.0d0 ) z = 1.0d0/c
> 20 da = r
> db = z
> return
> end
> @
> \section{Makefile}
> <<*>>=
> TANGLE=/usr/local/bin/NOTANGLE
> WEAVE=/usr/local/bin/NOWEAVE
> LATEX=/usr/bin/latex
>
> all: code doc run
>
> code: drotg.pamphlet
> ${TANGLE} -Rfortran drotg.pamphlet >drotg.f
>
> doc:
> ${WEAVE} -t8 -delay drotg.pamphlet >drotg.tex
> ${LATEX} drotg.tex 2>/dev/null 1>/dev/null
> ${LATEX} drotg.tex 2>/dev/null 1>/dev/null
>
> run:
> @echo done
> remake:
> ${TANGLE} -t8 drotg.pamphlet >Makefile.drotg
>
> @
> \eject
> \begin{thebibliography}{99}
> \bibitem{1} Lawson, C.L., Hanson, R.J., Kincaid, D.R., and Krogh, F.T.
> ``Basic Linear Algebra Subprograms for Fortran Usage''
> ACM Trans. on Math. Soft. (TOMS) Vol 5, pp308--325 (1979)
> \bibitem{2} Numerical Algorthms Fortran Library routine F06AAF\\
> {\sl http://www.nag.co.uk/numeric/fl/manual/pdf/F06/f06aaf.pdf}
> \bibitem{3} IBM ESSL Documentation routine DROTG\\
> {\sl http://csit1cwe.fsu.edu/extra\_link/essl/essl250.html\#HDRHSROTG}
> \end{thebibliography}
> \end{document}
>
>
>
> _______________________________________________
> Axiom-developer mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/axiom-developer
>
>
>
--
Camm Maguire address@hidden
==========================================================================
"The earth is but one country, and mankind its citizens." -- Baha'u'llah
- Re: [Axiom-developer] Interfacing with the rest of the world, (continued)
- Re: [Axiom-developer] Interfacing with the rest of the world, Bob McElrath, 2005/11/10
- [Axiom-developer] Axiom + High Energy Physics, C Y, 2005/11/10
- [Axiom-developer] Re: Axiom + High Energy Physics, Bob McElrath, 2005/11/10
- [Axiom-developer] Re: Axiom + High Energy Physics, C Y, 2005/11/10
- [Axiom-developer] Re: Axiom + High Energy Physics, Bob McElrath, 2005/11/10
- [Axiom-developer] Re: Axiom + High Energy Physics, C Y, 2005/11/10
- [Axiom-developer] Re: Axiom + High Energy Physics, root, 2005/11/10
- RE: [Axiom-developer] Re: Axiom + High Energy Physics, Bill Page, 2005/11/10
- Re: [Axiom-developer] Re: Axiom + High Energy Physics, Mike Dewar, 2005/11/14
- [Axiom-developer] Re: Axiom + High Energy Physics, root, 2005/11/10
- Re: [Axiom-developer] Re: Axiom + High Energy Physics,
Camm Maguire <=
- [Axiom-developer] Re: Axiom + High Energy Physics, Bob McElrath, 2005/11/10
- [Axiom-developer] Re: Axiom + High Energy Physics, Bob McElrath, 2005/11/15
- Re: [Axiom-developer] Re: Axiom + High Energy Physics, Bertfried Fauser, 2005/11/15
- [Axiom-developer] Re: Axiom + High Energy Physics, Camm Maguire, 2005/11/15
- Re: [Axiom-developer] Re: Axiom + High Energy Physics, Andrey G. Grozin, 2005/11/10
- Re: [Axiom-developer] Re: Axiom + High Energy Physics, C Y, 2005/11/10
- Re: [Axiom-developer] Re: Axiom + High Energy Physics, root, 2005/11/10
- Re: [Axiom-developer] MuPad under trouble, Nicolas M. Thiery, 2005/11/09
- Re: [Axiom-developer] MuPad under trouble, Ralf Hemmecke, 2005/11/09