Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
db65b31
initial skeleton with tests ran
jprhyne May 15, 2024
2ec963d
initial skeleton with tests ran
jprhyne May 15, 2024
fb5dc39
current state of testing implementation
jprhyne May 16, 2024
4c8684d
current state of testing implementation
jprhyne May 16, 2024
af491a4
fixed dlarf1f and dorm2r implementation
jprhyne May 28, 2024
559a7e9
fixed dlarf1f and dorm2r implementation
jprhyne May 28, 2024
3267d41
small change for tau
jprhyne May 29, 2024
648d221
updated check for if we are a trivial case from m/n=1 to lastv=1
jprhyne May 30, 2024
2a87758
updated CMakeLists and added dlarf1l.f
jprhyne May 30, 2024
0be01da
implementing into dorm2l.f
jprhyne May 31, 2024
2d8314f
updating double precision routines to use dlarf1f and dlarf1l. Still …
jprhyne Jun 3, 2024
491c0cf
updating zlarf1f.f
jprhyne Jun 4, 2024
15ec332
updating comment on zlarf1f.f
jprhyne Jun 4, 2024
468cb59
alternative formulation more similar to dlarf1f.f
jprhyne Jun 4, 2024
7708f1e
update dlarf1f.f and zlarf1f.f to not reference v(1)
jprhyne Jun 6, 2024
741907c
updating dlarf1f and dlarf1l to fix a bug found within dorg2l
jprhyne Jun 10, 2024
c744ebe
updating dlarf1l to use firstv scanner properly
jprhyne Jun 12, 2024
b69186b
updating dlarf1l.f
jprhyne Jun 12, 2024
35b3758
implement zlarf1l and use it in relevant routines. TODO: update comme…
jprhyne Jun 14, 2024
d219017
implement zlarf1l and use it in relevant routines. TODO: update comme…
jprhyne Jun 14, 2024
35d6a7b
updating documentation, using xLARF1y where applicable, and removing …
jprhyne Jun 15, 2024
48fbcb1
updating documentation, using xLARF1y where applicable, and removing …
jprhyne Jun 15, 2024
63461c1
updating documentation, using xLARF1y where applicable, and removing …
jprhyne Jun 15, 2024
12075f5
updating documentation, using xLARF1y where applicable, and removing …
jprhyne Jun 15, 2024
b564666
adding macro to lapack_64.h
jprhyne Jun 18, 2024
4a5139e
adding macro to lapack_64.h
jprhyne Jun 18, 2024
5953353
Merge branch 'Reference-LAPACK:master' into orm2r
jprhyne Jun 19, 2024
57b267c
fixing compilation errors due to not checking for lastc=0
jprhyne Jun 20, 2024
9a51a35
fixing compilation errors in test suite
jprhyne Jun 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
initial skeleton with tests ran
  • Loading branch information
jprhyne committed May 15, 2024
commit db65b3102e28c82bcda7aea15abf816696245e24
231 changes: 231 additions & 0 deletions SRC/dlarf1.f
Original file line number Diff line number Diff line change
@@ -0,0 +1,231 @@
*> \brief \b DLARF applies an elementary reflector to a general rectangular matrix.
*
* =========== DOCUMENTATION ===========
*
* Online html documentation available at
* http://www.netlib.org/lapack/explore-html/
*
*> \htmlonly
*> Download DLARF + dependencies
*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/dlarf.f">
*> [TGZ]</a>
*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/dlarf.f">
*> [ZIP]</a>
*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dlarf.f">
*> [TXT]</a>
*> \endhtmlonly
*
* Definition:
* ===========
*
* SUBROUTINE DLARF( SIDE, M, N, V, INCV, TAU, C, LDC, WORK )
*
* .. Scalar Arguments ..
* CHARACTER SIDE
* INTEGER INCV, LDC, M, N
* DOUBLE PRECISION TAU
* ..
* .. Array Arguments ..
* DOUBLE PRECISION C( LDC, * ), V( * ), WORK( * )
* ..
*
*
*> \par Purpose:
* =============
*>
*> \verbatim
*>
*> DLARF applies a real elementary reflector H to a real m by n matrix
*> C, from either the left or the right. H is represented in the form
*>
*> H = I - tau * v * v**T
*>
*> where tau is a real scalar and v is a real vector.
*>
*> If tau = 0, then H is taken to be the unit matrix.
*> \endverbatim
*
* Arguments:
* ==========
*
*> \param[in] SIDE
*> \verbatim
*> SIDE is CHARACTER*1
*> = 'L': form H * C
*> = 'R': form C * H
*> \endverbatim
*>
*> \param[in] M
*> \verbatim
*> M is INTEGER
*> The number of rows of the matrix C.
*> \endverbatim
*>
*> \param[in] N
*> \verbatim
*> N is INTEGER
*> The number of columns of the matrix C.
*> \endverbatim
*>
*> \param[in] V
*> \verbatim
*> V is DOUBLE PRECISION array, dimension
*> (1 + (M-1)*abs(INCV)) if SIDE = 'L'
*> or (1 + (N-1)*abs(INCV)) if SIDE = 'R'
*> The vector v in the representation of H. V is not used if
*> TAU = 0.
*> \endverbatim
*>
*> \param[in] INCV
*> \verbatim
*> INCV is INTEGER
*> The increment between elements of v. INCV <> 0.
*> \endverbatim
*>
*> \param[in] TAU
*> \verbatim
*> TAU is DOUBLE PRECISION
*> The value tau in the representation of H.
*> \endverbatim
*>
*> \param[in,out] C
*> \verbatim
*> C is DOUBLE PRECISION array, dimension (LDC,N)
*> On entry, the m by n matrix C.
*> On exit, C is overwritten by the matrix H * C if SIDE = 'L',
*> or C * H if SIDE = 'R'.
*> \endverbatim
*>
*> \param[in] LDC
*> \verbatim
*> LDC is INTEGER
*> The leading dimension of the array C. LDC >= max(1,M).
*> \endverbatim
*>
*> \param[out] WORK
*> \verbatim
*> WORK is DOUBLE PRECISION array, dimension
*> (N) if SIDE = 'L'
*> or (M) if SIDE = 'R'
*> \endverbatim
*
* Authors:
* ========
*
*> \author Univ. of Tennessee
*> \author Univ. of California Berkeley
*> \author Univ. of Colorado Denver
*> \author NAG Ltd.
*
*> \ingroup larf
*
* =====================================================================
SUBROUTINE DLARF( SIDE, M, N, V, INCV, TAU, C, LDC, WORK )
*
* -- LAPACK auxiliary routine --
* -- LAPACK is a software package provided by Univ. of Tennessee, --
* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
*
* .. Scalar Arguments ..
CHARACTER SIDE
INTEGER INCV, LDC, M, N
DOUBLE PRECISION TAU
* ..
* .. Array Arguments ..
DOUBLE PRECISION C( LDC, * ), V( * ), WORK( * )
* ..
*
* =====================================================================
*
* .. Parameters ..
DOUBLE PRECISION ONE, ZERO
PARAMETER ( ONE = 1.0D+0, ZERO = 0.0D+0 )
INTEGER IONE
PARAMETER ( IONE = 1 )
* ..
* .. Local Scalars ..
LOGICAL APPLYLEFT
INTEGER I, LASTV, LASTC
* ..
* .. External Subroutines ..
EXTERNAL DGEMV, DGER
* ..
* .. External Functions ..
LOGICAL LSAME
INTEGER ILADLR, ILADLC
EXTERNAL LSAME, ILADLR, ILADLC
* ..
* .. Executable Statements ..
*
APPLYLEFT = LSAME( SIDE, 'L' )
LASTV = 0
LASTC = 0
IF( TAU.NE.ZERO ) THEN
! Set up variables for scanning V. LASTV begins pointing to the end
! of V.
IF( APPLYLEFT ) THEN
LASTV = M
ELSE
LASTV = N
END IF
IF( INCV.GT.0 ) THEN
I = 1 + (LASTV-1) * INCV
ELSE
I = 1
END IF
! Look for the last non-zero row in V.
DO WHILE( LASTV.GT.0 .AND. V( I ).EQ.ZERO )
LASTV = LASTV - 1
I = I - INCV
END DO
IF( APPLYLEFT ) THEN
! Scan for the last non-zero column in C(1:lastv,:).
LASTC = ILADLC(LASTV, N, C, LDC)
ELSE
! Scan for the last non-zero row in C(:,1:lastv).
LASTC = ILADLR(M, LASTV, C, LDC)
END IF
END IF
! Note that lastc.eq.0 renders the BLAS operations null; no special
! case is needed at this level.
IF( APPLYLEFT ) THEN
*
* Form H * C
*
IF( LASTV.GT.0 ) THEN
*
* w(1:lastc,1) := C(2:lastv,1:lastc)**T * v(2:lastv,1)
*
CALL DGEMV( 'Transpose', LASTV, LASTC, ONE, C(2,1), LDC,
$ V(INCV), INCV, ZERO, WORK, 1 )
*
* w(1:lastc,1) := w(1:lastc,1) + C(1,1:lastc)**T * v(1,1)
* = w(1:lastc,1) + C(1,1:lastc)**T
*
CALL DAXPY(LASTC, ONE, C, LDC, WORK, 1)
*
* C(1:lastv,1:lastc) := C(...) - v(1:lastv,1) * w(1:lastc,1)**T
*
CALL DGER( LASTV, LASTC, -TAU, V, INCV, WORK, 1, C, LDC )
END IF
ELSE
*
* Form C * H
*
IF( LASTV.GT.0 ) THEN
*
* w(1:lastc,1) := C(1:lastc,1:lastv) * v(1:lastv,1)
*
CALL DGEMV( 'No transpose', LASTC, LASTV, ONE, C, LDC,
$ V, INCV, ZERO, WORK, 1 )
*
* C(1:lastc,1:lastv) := C(...) - w(1:lastc,1) * v(1:lastv,1)**T
*
CALL DGER( LASTC, LASTV, -TAU, WORK, 1, V, INCV, C, LDC )
END IF
END IF
RETURN
*
* End of DLARF
*
END
Binary file added SRC/la_constants.mod
Binary file not shown.
Binary file added SRC/la_xisnan.mod
Binary file not shown.
Loading