qrupdate-ng 1.2.0
Loading...
Searching...
No Matches
Givens Rotations

Routines for the generation and application of Givens rotations. More...

Collaboration diagram for Givens Rotations:

Functions

subroutine cqrot (dir, m, n, q, ldq, c, s)
 Applies a sequence of Givens rotations from the right to a matrix.
subroutine cqrtv1 (n, u, w)
 Generates Givens rotations to eliminate all but the first element of a vector.
subroutine dqrot (dir, m, n, q, ldq, c, s)
 Applies a sequence of Givens rotations from the right to a matrix.
subroutine dqrtv1 (n, u, w)
 Generates Givens rotations to eliminate all but the first element of a vector.
subroutine sqrot (dir, m, n, q, ldq, c, s)
 Applies a sequence of Givens rotations from the right to a matrix.
subroutine sqrtv1 (n, u, w)
 Generates Givens rotations to eliminate all but the first element of a vector.
subroutine zqrot (dir, m, n, q, ldq, c, s)
 Applies a sequence of Givens rotations from the right to a matrix.
subroutine zqrtv1 (n, u, w)
 Generates Givens rotations to eliminate all but the first element of a vector.

Detailed Description

Routines for the generation and application of Givens rotations.

As a foundational component, this group implements the primary mechanism for maintaining triangular structures in the QR and Cholesky decompositions. It includes routines for generating rotation coefficients and applying rotations to matrices in both forward and backward orders.

Function Documentation

◆ cqrot()

subroutine cqrot ( character, intent(in) dir,
integer, intent(in) m,
integer, intent(in) n,
complex(real32), dimension(ldq,*), intent(inout) q,
integer, intent(in) ldq,
real(real32), dimension(*), intent(in) c,
complex(real32), dimension(*), intent(in) s )

Applies a sequence of Givens rotations from the right to a matrix.

Definition:
!>       subroutine cqrot(dir,m,n,Q,ldq,c,s)
!>
!>       .. Scalar Arguments ..
!>       character           dir
!>       integer             m, n, ldq
!>       ..
!>       .. Array Arguments ..
!>       complex             Q(ldq,*)
!>       real                c(*)
!>       complex             s(*)
!>       ..
!> 
Purpose:
!>
!> CQROT applies a sequence of Givens rotations from the right
!> side to an m-by-n matrix Q.  Given a direction indicator
!> dir, the rotation cosine and sine vectors c and s, CQROT
!> applies the rotations to Q, updating it in place.  If dir
!> is 'F' (forward), rotations are applied from the first to
!> the last; if dir is 'B' (backward), from the last to the
!> first.
!> 
Parameters
[in]dir
!>          dir is CHARACTER
!>          If 'B' or 'b', rotations are applied backwards
!>          (from the last to the first).  If 'F' or 'f',
!>          rotations are applied forwards (from the first to
!>          the last).
!> 
[in]m
!>          m is INTEGER
!>          The number of rows of matrix Q.  m >= 0.
!> 
[in]n
!>          n is INTEGER
!>          The number of columns of the matrix Q.  n >= 0.
!> 
[in,out]Q
!>          Q is COMPLEX array, dimension (ldq,*)
!>          On entry, the matrix Q.  On exit, the updated
!>          matrix Q1.
!> 
[in]ldq
!>          ldq is INTEGER
!>          The leading dimension of Q.  ldq >= m.
!> 
[in]c
!>          c is REAL array, dimension (*)
!>          The rotation cosines.  Must contain at least
!>          n-1 elements.
!> 
[in]s
!>          s is COMPLEX array, dimension (*)
!>          The rotation sines.  Must contain at least
!>          n-1 elements.
!> 

Definition at line 100 of file cqrot.f90.

◆ cqrtv1()

subroutine cqrtv1 ( integer, intent(in) n,
complex(real32), dimension(*), intent(inout) u,
real(real32), dimension(*), intent(out) w )

Generates Givens rotations to eliminate all but the first element of a vector.

Definition:
!>       subroutine cqrtv1(n,u,w)
!>
!>       .. Scalar Arguments ..
!>       integer            n
!>       ..
!>       .. Array Arguments ..
!>       complex            u(*)
!>       real               w(*)
!>       ..
!> 
Purpose:
!>
!> CQRTV1 generates a sequence of n-1 Givens rotations that
!> eliminate all but the first element of a complex vector u.
!> On entry, u contains the vector to be reduced.  On exit,
!> u(1) contains the resulting element, u(2:n) contains the
!> rotation sines, and w contains the rotation cosines.
!>
!> The rotations are generated from the bottom up, so that the
!> first rotation eliminates u(n), the second eliminates u(n-1),
!> and so on.
!> 
Parameters
[in]n
!>          n is INTEGER
!>          The length of the vector u.  If n <= 0, the subroutine
!>          returns immediately without modification.
!> 
[in,out]u
!>          u is COMPLEX array, dimension (n)
!>          On entry, the vector to be reduced.  On exit, u(1)
!>          contains the remaining element, and u(2:n) contains
!>          the sine parts of the Givens rotations.
!> 
[out]w
!>          w is REAL array, dimension (n)
!>          On exit, w contains the cosine parts of the Givens
!>          rotations.
!> 

Definition at line 74 of file cqrtv1.f90.

◆ dqrot()

subroutine dqrot ( character, intent(in) dir,
integer, intent(in) m,
integer, intent(in) n,
real(real64), dimension(ldq,*), intent(inout) q,
integer, intent(in) ldq,
real(real64), dimension(*), intent(in) c,
real(real64), dimension(*), intent(in) s )

Applies a sequence of Givens rotations from the right to a matrix.

Definition:
!>       subroutine dqrot(dir,m,n,Q,ldq,c,s)
!>
!>       .. Scalar Arguments ..
!>       character           dir
!>       integer             m, n, ldq
!>       ..
!>       .. Array Arguments ..
!>       double precision    Q(ldq,*)
!>       double precision    c(*)
!>       double precision    s(*)
!>       ..
!> 
Purpose:
!>
!> DQROT applies a sequence of Givens rotations from the right
!> side to an m-by-n matrix Q.  Given a direction indicator
!> dir, the rotation cosine and sine vectors c and s, DQROT
!> applies the rotations to Q, updating it in place.  If dir
!> is 'F' (forward), rotations are applied from the first to
!> the last; if dir is 'B' (backward), from the last to the
!> first.
!> 
Parameters
[in]dir
!>          dir is CHARACTER
!>          If 'B' or 'b', rotations are applied backwards
!>          (from the last to the first).  If 'F' or 'f',
!>          rotations are applied forwards (from the first to
!>          the last).
!> 
[in]m
!>          m is INTEGER
!>          The number of rows of matrix Q.  m >= 0.
!> 
[in]n
!>          n is INTEGER
!>          The number of columns of the matrix Q.  n >= 0.
!> 
[in,out]Q
!>          Q is DOUBLE PRECISION array, dimension (ldq,*)
!>          On entry, the matrix Q.  On exit, the updated
!>          matrix Q1.
!> 
[in]ldq
!>          ldq is INTEGER
!>          The leading dimension of Q.  ldq >= m.
!> 
[in]c
!>          c is DOUBLE PRECISION array, dimension (*)
!>          The rotation cosines.  Must contain at least n-1
!>          elements.
!> 
[in]s
!>          s is DOUBLE PRECISION array, dimension (*)
!>          The rotation sines.  Must contain at least n-1
!>          elements.
!> 

Definition at line 100 of file dqrot.f90.

◆ dqrtv1()

subroutine dqrtv1 ( integer, intent(in) n,
real(real64), dimension(*), intent(inout) u,
real(real64), dimension(*), intent(out) w )

Generates Givens rotations to eliminate all but the first element of a vector.

Definition:
!>       subroutine dqrtv1(n,u,w)
!>
!>       .. Scalar Arguments ..
!>       integer            n
!>       ..
!>       .. Array Arguments ..
!>       double precision   u(*), w(*)
!>       ..
!> 
Purpose:
!>
!> DQRTV1 generates a sequence of n-1 Givens rotations that
!> eliminate all but the first element of a double precision
!> vector u.  On entry, u contains the vector to be reduced.
!> On exit, u(1) contains the resulting element, u(2:n) contains
!> the rotation sines, and w contains the rotation cosines.
!>
!> The rotations are generated from the bottom up, so that the
!> first rotation eliminates u(n), the second eliminates u(n-1),
!> and so on.
!> 
Parameters
[in]n
!>          n is INTEGER
!>          The length of the vector u.  If n <= 0, the subroutine
!>          returns immediately without modification.
!> 
[in,out]u
!>          u is DOUBLE PRECISION array, dimension (n)
!>          On entry, the vector to be reduced.  On exit, u(1)
!>          contains the remaining element, and u(2:n) contains
!>          the sine parts of the Givens rotations.
!> 
[out]w
!>          w is DOUBLE PRECISION array, dimension (n)
!>          On exit, w contains the cosine parts of the Givens
!>          rotations.
!> 

Definition at line 73 of file dqrtv1.f90.

◆ sqrot()

subroutine sqrot ( character, intent(in) dir,
integer, intent(in) m,
integer, intent(in) n,
real(real32), dimension(ldq,*), intent(inout) q,
integer, intent(in) ldq,
real(real32), dimension(*), intent(in) c,
real(real32), dimension(*), intent(in) s )

Applies a sequence of Givens rotations from the right to a matrix.

Definition:
!>       subroutine sqrot(dir,m,n,Q,ldq,c,s)
!>
!>       .. Scalar Arguments ..
!>       character           dir
!>       integer             m, n, ldq
!>       ..
!>       .. Array Arguments ..
!>       real                Q(ldq,*)
!>       real                c(*)
!>       real                s(*)
!>       ..
!> 
Purpose:
!>
!> SQROT applies a sequence of Givens rotations from the right
!> side to an m-by-n matrix Q.  Given a direction indicator
!> dir, the rotation cosine and sine vectors c and s, SQROT
!> applies the rotations to Q, updating it in place.  If dir
!> is 'F' (forward), rotations are applied from the first to
!> the last; if dir is 'B' (backward), from the last to the
!> first.
!> 
Parameters
[in]dir
!>          dir is CHARACTER
!>          If 'B' or 'b', rotations are applied backwards
!>          (from the last to the first).  If 'F' or 'f',
!>          rotations are applied forwards (from the first to
!>          the last).
!> 
[in]m
!>          m is INTEGER
!>          The number of rows of matrix Q.  m >= 0.
!> 
[in]n
!>          n is INTEGER
!>          The number of columns of the matrix Q.  n >= 0.
!> 
[in,out]Q
!>          Q is REAL array, dimension (ldq,*)
!>          On entry, the matrix Q.  On exit, the updated
!>          matrix Q1.
!> 
[in]ldq
!>          ldq is INTEGER
!>          The leading dimension of Q.  ldq >= m.
!> 
[in]c
!>          c is REAL array, dimension (*)
!>          The rotation cosines.  Must contain at least
!>          n-1 elements.
!> 
[in]s
!>          s is REAL array, dimension (*)
!>          The rotation sines.  Must contain at least
!>          n-1 elements.
!> 

Definition at line 100 of file sqrot.f90.

◆ sqrtv1()

subroutine sqrtv1 ( integer, intent(in) n,
real(real32), dimension(*), intent(inout) u,
real(real32), dimension(*), intent(out) w )

Generates Givens rotations to eliminate all but the first element of a vector.

Definition:
!>       subroutine sqrtv1(n,u,w)
!>
!>       .. Scalar Arguments ..
!>       integer            n
!>       ..
!>       .. Array Arguments ..
!>       real               u(*), w(*)
!>       ..
!> 
Purpose:
!>
!> SQRTV1 generates a sequence of n-1 Givens rotations that
!> eliminate all but the first element of a real vector u.
!> On entry, u contains the vector to be reduced.  On exit,
!> u(1) contains the resulting element, u(2:n) contains the
!> rotation sines, and w contains the rotation cosines.
!>
!> The rotations are generated from the bottom up, so that the
!> first rotation eliminates u(n), the second eliminates u(n-1),
!> and so on.
!> 
Parameters
[in]n
!>          n is INTEGER
!>          The length of the vector u.  If n <= 0, the subroutine
!>          returns immediately without modification.
!> 
[in,out]u
!>          u is REAL array, dimension (n)
!>          On entry, the vector to be reduced.  On exit, u(1)
!>          contains the remaining element, and u(2:n) contains
!>          the sine parts of the Givens rotations.
!> 
[out]w
!>          w is REAL array, dimension (n)
!>          On exit, w contains the cosine parts of the Givens
!>          rotations.
!> 

Definition at line 73 of file sqrtv1.f90.

◆ zqrot()

subroutine zqrot ( character, intent(in) dir,
integer, intent(in) m,
integer, intent(in) n,
complex(real64), dimension(ldq,*), intent(inout) q,
integer, intent(in) ldq,
real(real64), dimension(*), intent(in) c,
complex(real64), dimension(*), intent(in) s )

Applies a sequence of Givens rotations from the right to a matrix.

Definition:
!>       subroutine zqrot(dir,m,n,Q,ldq,c,s)
!>
!>       .. Scalar Arguments ..
!>       character           dir
!>       integer             m, n, ldq
!>       ..
!>       .. Array Arguments ..
!>       double complex      Q(ldq,*)
!>       double precision    c(*)
!>       double complex      s(*)
!>       ..
!> 
Purpose:
!>
!> ZQROT applies a sequence of Givens rotations from the right
!> side to an m-by-n matrix Q.  Given a direction indicator
!> dir, the rotation cosine and sine vectors c and s, ZQROT
!> applies the rotations to Q, updating it in place.  If dir
!> is 'F' (forward), rotations are applied from the first to
!> the last; if dir is 'B' (backward), from the last to the
!> first.
!> 
Parameters
[in]dir
!>          dir is CHARACTER
!>          If 'B' or 'b', rotations are applied backwards
!>          (from the last to the first).  If 'F' or 'f',
!>          rotations are applied forwards (from the first to
!>          the last).
!> 
[in]m
!>          m is INTEGER
!>          The number of rows of matrix Q.  m >= 0.
!> 
[in]n
!>          n is INTEGER
!>          The number of columns of the matrix Q.  n >= 0.
!> 
[in,out]Q
!>          Q is COMPLEX*16 array, dimension (ldq,*)
!>          On entry, the matrix Q.  On exit, the updated
!>          matrix Q1.
!> 
[in]ldq
!>          ldq is INTEGER
!>          The leading dimension of Q.  ldq >= m.
!> 
[in]c
!>          c is DOUBLE PRECISION array, dimension (*)
!>          The rotation cosines.  Must contain at least
!>          n-1 elements.
!> 
[in]s
!>          s is COMPLEX*16 array, dimension (*)
!>          The rotation sines.  Must contain at least
!>          n-1 elements.
!> 

Definition at line 100 of file zqrot.f90.

◆ zqrtv1()

subroutine zqrtv1 ( integer, intent(in) n,
complex(real64), dimension(*), intent(inout) u,
real(real64), dimension(*), intent(out) w )

Generates Givens rotations to eliminate all but the first element of a vector.

Definition:
!>       subroutine zqrtv1(n,u,w)
!>
!>       .. Scalar Arguments ..
!>       integer            n
!>       ..
!>       .. Array Arguments ..
!>       double complex     u(*)
!>       double precision   w(*)
!>       ..
!> 
Purpose:
!>
!> ZQRTV1 generates a sequence of n-1 Givens rotations that
!> eliminate all but the first element of a double complex
!> vector u.  On entry, u contains the vector to be reduced.
!> On exit, u(1) contains the remaining element, u(2:n) contains
!> the rotation sines, and w contains the rotation cosines.
!>
!> The rotations are generated from the bottom up, so that the
!> first rotation eliminates u(n), the second eliminates u(n-1),
!> and so on.
!> 
Parameters
[in]n
!>          n is INTEGER
!>          The length of the vector u.  If n <= 0, the subroutine
!>          returns immediately without modification.
!> 
[in,out]u
!>          u is COMPLEX*16 array, dimension (n)
!>          On entry, the vector to be reduced.  On exit, u(1)
!>          contains the remaining element, and u(2:n) contains
!> the sine parts of the Givens rotations.
!> 
[out]w
!>          w is DOUBLE PRECISION array, dimension (n)
!>          On exit, w contains the cosine parts of the Givens
!>          rotations.
!> 

Definition at line 74 of file zqrtv1.f90.