Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 4 additions & 0 deletions lapack-netlib/SRC/clarf1f.c
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,10 @@ static integer c__1 = 1;
--work;

/* Function Body */
/* Quick return if C is empty */
if (*m <= 0 || *n <= 0)
return;

applyleft = lsame_(side, "L");
lastv = 1;
lastc = 0;
Expand Down
28 changes: 19 additions & 9 deletions lapack-netlib/SRC/clarf1f.f
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ SUBROUTINE CLARF1F( SIDE, M, N, V, INCV, TAU, C, LDC, WORK )
* ..
* .. Local Scalars ..
LOGICAL APPLYLEFT
INTEGER I, LASTV, LASTC
INTEGER I, J, LASTV, LASTC
* ..
* .. External Subroutines ..
EXTERNAL CAXPY, CGEMV, CGERC, CSCAL
Expand All @@ -161,6 +161,11 @@ SUBROUTINE CLARF1F( SIDE, M, N, V, INCV, TAU, C, LDC, WORK )
EXTERNAL LSAME, ILACLR, ILACLC
* ..
* .. Executable Statements ..
*
* Quick return if C is empty
*
IF( M.LE.0 .OR. N.LE.0 )
$ RETURN
*
APPLYLEFT = LSAME( SIDE, 'L' )
LASTV = 1
Expand Down Expand Up @@ -190,6 +195,11 @@ SUBROUTINE CLARF1F( SIDE, M, N, V, INCV, TAU, C, LDC, WORK )
! Scan for the last non-zero row in C(:,1:lastv).
LASTC = ILACLR(M, LASTV, C, LDC)
END IF
! Set index for V. If INCV < 0, then I points to the end of V.
! For INCV > 0, set I to point to V(2)
IF( INCV.GT.0 ) THEN
I = 1 + INCV
END IF
END IF
IF( LASTC.EQ.0 ) THEN
RETURN
Expand All @@ -208,24 +218,24 @@ SUBROUTINE CLARF1F( SIDE, M, N, V, INCV, TAU, C, LDC, WORK )
* w(1:lastc,1) := C(2:lastv,1:lastc)**H * v(2:lastv,1)
*
CALL CGEMV( 'Conjugate transpose', LASTV - 1, LASTC, ONE,
$ C( 2, 1 ), LDC, V( 1 + INCV ), INCV, ZERO,
$ C( 2, 1 ), LDC, V( I ), INCV, ZERO,
$ WORK, 1 )
*
* w(1:lastc,1) += v(1,1) * C(1,1:lastc)**H
*
DO I = 1, LASTC
WORK( I ) = WORK( I ) + CONJG( C( 1, I ) )
DO J = 1, LASTC
WORK( J ) = WORK( J ) + CONJG( C( 1, J ) )
END DO
*
* C(1, 1:lastc) += - tau * v(1,1) * w(1:lastc,1)**H
*
DO I = 1, LASTC
C( 1, I ) = C( 1, I ) - TAU * CONJG( WORK( I ) )
DO J = 1, LASTC
C( 1, J ) = C( 1, J ) - TAU * CONJG( WORK( J ) )
END DO
*
* C(2:lastv,1:lastc) += - tau * v(2:lastv,1) * w(1:lastc,1)**H
*
CALL CGERC( LASTV - 1, LASTC, -TAU, V( 1 + INCV ), INCV,
CALL CGERC( LASTV - 1, LASTC, -TAU, V( I ), INCV,
$ WORK, 1, C( 2, 1 ), LDC )
END IF
ELSE
Expand All @@ -242,7 +252,7 @@ SUBROUTINE CLARF1F( SIDE, M, N, V, INCV, TAU, C, LDC, WORK )
* w(1:lastc,1) := C(1:lastc,2:lastv) * v(2:lastv,1)
*
CALL CGEMV( 'No transpose', LASTC, LASTV - 1, ONE,
$ C( 1, 2 ), LDC, V( 1 + INCV ), INCV, ZERO,
$ C( 1, 2 ), LDC, V( I ), INCV, ZERO,
$ WORK, 1 )
*
* w(1:lastc,1) += v(1,1) * C(1:lastc,1)
Expand All @@ -256,7 +266,7 @@ SUBROUTINE CLARF1F( SIDE, M, N, V, INCV, TAU, C, LDC, WORK )
* C(1:lastc,2:lastv) += - tau * w(1:lastc,1) * v(2:lastv)**H
*
CALL CGERC( LASTC, LASTV - 1, -TAU, WORK, 1,
$ V( 1 + INCV ), INCV, C( 1, 2 ), LDC )
$ V( I ), INCV, C( 1, 2 ), LDC )
END IF
END IF
RETURN
Expand Down
4 changes: 4 additions & 0 deletions lapack-netlib/SRC/clarf1l.c
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,10 @@ static integer c__1 = 1;
--work;

/* Function Body */
/* Quick return if C is empty */
if (*m <= 0 || *n <= 0)
return;

applyleft = lsame_(side, "L");
firstv = 1;
lastc = 0;
Expand Down
16 changes: 15 additions & 1 deletion lapack-netlib/SRC/clarf1l.f
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,11 @@ SUBROUTINE CLARF1L( SIDE, M, N, V, INCV, TAU, C, LDC, WORK )
EXTERNAL LSAME, ILACLR, ILACLC
* ..
* .. Executable Statements ..
*
* Quick return if C is empty
*
IF( M.LE.0 .OR. N.LE.0 )
$ RETURN
*
APPLYLEFT = LSAME( SIDE, 'L' )
FIRSTV = 1
Expand All @@ -174,7 +179,11 @@ SUBROUTINE CLARF1L( SIDE, M, N, V, INCV, TAU, C, LDC, WORK )
ELSE
LASTV = N
END IF
I = 1
IF( INCV.GT.0 ) THEN
I = 1
ELSE
I = 1 - (LASTV-1) * INCV
END IF
! Look for the last non-zero row in V.
DO WHILE( LASTV.GT.FIRSTV .AND. V( I ).EQ.ZERO )
FIRSTV = FIRSTV + 1
Expand All @@ -187,6 +196,11 @@ SUBROUTINE CLARF1L( SIDE, M, N, V, INCV, TAU, C, LDC, WORK )
! Scan for the last non-zero row in C(:,1:lastv).
LASTC = ILACLR(M, LASTV, C, LDC)
END IF
! Set index for V. If INCV > 0, then I points to the start of V.
! For INCV < 0, set I to point to V(M-1)
IF( INCV.LT.0 ) THEN
I = 1 - INCV
END IF
END IF
IF( LASTC.EQ.0 ) THEN
RETURN
Expand Down
4 changes: 4 additions & 0 deletions lapack-netlib/SRC/dlarf1f.c
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,10 @@ static integer c__1 = 1;
--work;

/* Function Body */
/* Quick return if C is empty */
if (*m <= 0 || *n <= 0)
return;

applyleft = lsame_(side, "L");
lastv = 1;
lastc = 0;
Expand Down
18 changes: 14 additions & 4 deletions lapack-netlib/SRC/dlarf1f.f
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,11 @@ SUBROUTINE DLARF1F( SIDE, M, N, V, INCV, TAU, C, LDC, WORK )
EXTERNAL LSAME, ILADLR, ILADLC
* ..
* .. Executable Statements ..
*
* Quick return if C is empty
*
IF( M.LE.0 .OR. N.LE.0 )
$ RETURN
*
APPLYLEFT = LSAME( SIDE, 'L' )
LASTV = 1
Expand Down Expand Up @@ -219,6 +224,11 @@ SUBROUTINE DLARF1F( SIDE, M, N, V, INCV, TAU, C, LDC, WORK )
! Scan for the last non-zero row in C(:,1:lastv).
LASTC = ILADLR(M, LASTV, C, LDC)
END IF
! Set index for V. If INCV < 0, then I points to the end of V.
! For INCV > 0, set I to point to V(2)
IF( INCV.GT.0 ) THEN
I = 1 + INCV
END IF
END IF
IF( LASTC.EQ.0 ) THEN
RETURN
Expand All @@ -240,7 +250,7 @@ SUBROUTINE DLARF1F( SIDE, M, N, V, INCV, TAU, C, LDC, WORK )
*
! w(1:lastc,1) := C(2:lastv,1:lastc)**T * v(2:lastv,1)
CALL DGEMV( 'Transpose', LASTV-1, LASTC, ONE, C(1+1,1),
$ LDC, V(1+INCV), INCV, ZERO, WORK, 1)
$ LDC, V(I), INCV, ZERO, WORK, 1)
! w(1:lastc,1) += C(1,1:lastc)**T * v(1,1) = C(1,1:lastc)**T
CALL DAXPY(LASTC, ONE, C, LDC, WORK, 1)
*
Expand All @@ -250,7 +260,7 @@ SUBROUTINE DLARF1F( SIDE, M, N, V, INCV, TAU, C, LDC, WORK )
! = C(...) - tau * w(1:lastc,1)**T
CALL DAXPY(LASTC, -TAU, WORK, 1, C, LDC)
! C(2:lastv,1:lastc) := C(...) - tau * v(2:lastv,1)*w(1:lastc,1)**T
CALL DGER(LASTV-1, LASTC, -TAU, V(1+INCV), INCV, WORK, 1,
CALL DGER(LASTV-1, LASTC, -TAU, V(I), INCV, WORK, 1,
$ C(1+1,1), LDC)
END IF
ELSE
Expand All @@ -270,7 +280,7 @@ SUBROUTINE DLARF1F( SIDE, M, N, V, INCV, TAU, C, LDC, WORK )
*
! w(1:lastc,1) := C(1:lastc,2:lastv) * v(2:lastv,1)
CALL DGEMV( 'No transpose', LASTC, LASTV-1, ONE,
$ C(1,1+1), LDC, V(1+INCV), INCV, ZERO, WORK, 1 )
$ C(1,1+1), LDC, V(I), INCV, ZERO, WORK, 1 )
! w(1:lastc,1) += C(1:lastc,1) v(1,1) = C(1:lastc,1)
CALL DAXPY(LASTC, ONE, C, 1, WORK, 1)
*
Expand All @@ -280,7 +290,7 @@ SUBROUTINE DLARF1F( SIDE, M, N, V, INCV, TAU, C, LDC, WORK )
! = C(...) - tau * w(1:lastc,1)
CALL DAXPY(LASTC, -TAU, WORK, 1, C, 1)
! C(1:lastc,2:lastv) := C(...) - tau * w(1:lastc,1) * v(2:lastv)**T
CALL DGER( LASTC, LASTV-1, -TAU, WORK, 1, V(1+INCV),
CALL DGER( LASTC, LASTV-1, -TAU, WORK, 1, V(I),
$ INCV, C(1,1+1), LDC )
END IF
END IF
Expand Down
4 changes: 4 additions & 0 deletions lapack-netlib/SRC/dlarf1l.c
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,10 @@ static integer c__1 = 1;
--work;

/* Function Body */
/* Quick return if C is empty */
if (*m <= 0 || *n <= 0)
return;

applyleft = lsame_(side, "L");
firstv = 1;
lastc = 0;
Expand Down
Loading
Loading