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
|
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<!--Converted with LaTeX2HTML 96.1-h (September 30, 1996) by Nikos Drakos (nikos@cbl.leeds.ac.uk), CBLU, University of Leeds -->
<HTML>
<HEAD>
<TITLE>Sequential LU Factorization</TITLE>
<META NAME="description" CONTENT="Sequential LU Factorization">
<META NAME="keywords" CONTENT="slug">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">
<LINK REL=STYLESHEET HREF="slug.css">
</HEAD>
<BODY LANG="EN" >
<A NAME="tex2html4417" HREF="node178.html"><IMG WIDTH=37 HEIGHT=24 ALIGN=BOTTOM ALT="next" SRC="http://www.netlib.org/utk/icons/next_motif.gif"></A> <A NAME="tex2html4415" HREF="node176.html"><IMG WIDTH=26 HEIGHT=24 ALIGN=BOTTOM ALT="up" SRC="http://www.netlib.org/utk/icons/up_motif.gif"></A> <A NAME="tex2html4409" HREF="node176.html"><IMG WIDTH=63 HEIGHT=24 ALIGN=BOTTOM ALT="previous" SRC="http://www.netlib.org/utk/icons/previous_motif.gif"></A> <A NAME="tex2html4419" HREF="node1.html"><IMG WIDTH=65 HEIGHT=24 ALIGN=BOTTOM ALT="contents" SRC="http://www.netlib.org/utk/icons/contents_motif.gif"></A> <A NAME="tex2html4420" HREF="node190.html"><IMG WIDTH=43 HEIGHT=24 ALIGN=BOTTOM ALT="index" SRC="http://www.netlib.org/utk/icons/index_motif.gif"></A> <BR>
<B> Next:</B> <A NAME="tex2html4418" HREF="node178.html">Parallel LU Factorization</A>
<B>Up:</B> <A NAME="tex2html4416" HREF="node176.html">Translating LAPACK-based programs to </A>
<B> Previous:</B> <A NAME="tex2html4410" HREF="node176.html">Translating LAPACK-based programs to </A>
<BR> <P>
<H2><A NAME="SECTION04921000000000000000">Sequential LU Factorization</A></H2>
<P>
<A NAME="secSequentialLUFactorization"> </A>
<P>
<PRE> SUBROUTINE DGETRF( M, N, A, LDA, IPIV, INFO )
*
* LU factorization of a M-by-N matrix A using partial pivoting with
* row interchanges.
*
INTEGER INFO, LDA, M, N, IPIV( * )
DOUBLE PRECISION A( LDA, * )
*
INTEGER I, IINFO, J, JB, NB
PARAMETER ( NB = 64 )
EXTERNAL DGEMM, DGETF2, DLASWP, DTRSM
INTRINSIC MIN
*
DO 20 J = 1, MIN(M,N), NB
JB = MIN( MIN(M,N)-J+1, NB )
*
* Factor diagonal block and test for exact singularity.
*
CALL DGETF2( M-J+1, JB, A(J,J), LDA, IPIV(J), IINFO )
*
* Adjust INFO and the pivot indices.
*
IF( INFO.EQ.0 .AND. IINFO.GT.0 ) INFO = IINFO + J - 1
DO 10 I = J, MIN(M,J+JB-1)
IPIV(I) = J - 1 + IPIV(I)
10 CONTINUE
*
* Apply interchanges to columns 1:J-1 and J+JB:N.
*
CALL DLASWP( J-1, A, LDA, J, J+JB-1, IPIV, 1 )
IF( J+JB.LE.N ) THEN
CALL DLASWP( N-J-JB+1, A(1,J+JB), LDA, J, J+JB-1, IPIV, 1 )
*
* Compute block row of U and update trailing submatrix.
*
CALL DTRSM( 'Left', 'Lower', 'No transpose', 'Unit', JB,
$ N-J-JB+1, 1.0D+0, A(J,J), LDA, A(J,J+JB), LDA )
IF( J+JB.LE.M )
$ CALL DGEMM( 'No transpose', 'No transpose', M-J-JB+1,
$ N-J-JB+1, JB, -1.0D+0, A(J+JB,J), LDA,
$ A(J,J+JB), LDA, 1.0D+0, A(J+JB,J+JB), LDA )
END IF
20 CONTINUE
RETURN
*
END</PRE>
<P>
<BR> <HR>
<P><ADDRESS>
<I>Susan Blackford <BR>
Tue May 13 09:21:01 EDT 1997</I>
</ADDRESS>
</BODY>
</HTML>
|