.TH "lartg" 3 "Version 3.12.0" "LAPACK" \" -*- nroff -*- .ad l .nh .SH NAME lartg \- lartg: generate plane rotation, more accurate than BLAS rot .SH SYNOPSIS .br .PP .SS "Functions" .in +1c .ti -1c .RI "subroutine \fBclartg\fP (f, g, c, s, r)" .br .RI "\fBCLARTG\fP generates a plane rotation with real cosine and complex sine\&. " .ti -1c .RI "subroutine \fBdlartg\fP (f, g, c, s, r)" .br .RI "\fBDLARTG\fP generates a plane rotation with real cosine and real sine\&. " .ti -1c .RI "subroutine \fBslartg\fP (f, g, c, s, r)" .br .RI "\fBSLARTG\fP generates a plane rotation with real cosine and real sine\&. " .ti -1c .RI "subroutine \fBzlartg\fP (f, g, c, s, r)" .br .RI "\fBZLARTG\fP generates a plane rotation with real cosine and complex sine\&. " .in -1c .SH "Detailed Description" .PP .SH "Function Documentation" .PP .SS "subroutine clartg (complex(wp) f, complex(wp) g, real(wp) c, complex(wp) s, complex(wp) r)" .PP \fBCLARTG\fP generates a plane rotation with real cosine and complex sine\&. .PP \fBPurpose:\fP .RS 4 .PP .nf !> !> CLARTG generates a plane rotation so that !> !> [ C S ] \&. [ F ] = [ R ] !> [ -conjg(S) C ] [ G ] [ 0 ] !> !> where C is real and C**2 + |S|**2 = 1\&. !> !> The mathematical formulas used for C and S are !> !> sgn(x) = { x / |x|, x != 0 !> { 1, x = 0 !> !> R = sgn(F) * sqrt(|F|**2 + |G|**2) !> !> C = |F| / sqrt(|F|**2 + |G|**2) !> !> S = sgn(F) * conjg(G) / sqrt(|F|**2 + |G|**2) !> !> Special conditions: !> If G=0, then C=1 and S=0\&. !> If F=0, then C=0 and S is chosen so that R is real\&. !> !> When F and G are real, the formulas simplify to C = F/R and !> S = G/R, and the returned values of C, S, and R should be !> identical to those returned by SLARTG\&. !> !> The algorithm used to compute these quantities incorporates scaling !> to avoid overflow or underflow in computing the square root of the !> sum of squares\&. !> !> This is the same routine CROTG fom BLAS1, except that !> F and G are unchanged on return\&. !> !> Below, wp=>sp stands for single precision from LA_CONSTANTS module\&. !> .fi .PP .RE .PP \fBParameters\fP .RS 4 \fIF\fP .PP .nf !> F is COMPLEX(wp) !> The first component of vector to be rotated\&. !> .fi .PP .br \fIG\fP .PP .nf !> G is COMPLEX(wp) !> The second component of vector to be rotated\&. !> .fi .PP .br \fIC\fP .PP .nf !> C is REAL(wp) !> The cosine of the rotation\&. !> .fi .PP .br \fIS\fP .PP .nf !> S is COMPLEX(wp) !> The sine of the rotation\&. !> .fi .PP .br \fIR\fP .PP .nf !> R is COMPLEX(wp) !> The nonzero component of the rotated vector\&. !> .fi .PP .RE .PP \fBAuthor\fP .RS 4 Weslley Pereira, University of Colorado Denver, USA .RE .PP \fBDate\fP .RS 4 December 2021 .RE .PP \fBFurther Details:\fP .RS 4 .PP .nf !> !> Based on the algorithm from !> !> Anderson E\&. (2017) !> Algorithm 978: Safe Scaling in the Level 1 BLAS !> ACM Trans Math Softw 44:1--28 !> https://doi\&.org/10\&.1145/3061665 !> !> .fi .PP .RE .PP .PP Definition at line \fB115\fP of file \fBclartg\&.f90\fP\&. .SS "subroutine dlartg (real(wp) f, real(wp) g, real(wp) c, real(wp) s, real(wp) r)" .PP \fBDLARTG\fP generates a plane rotation with real cosine and real sine\&. .PP \fBPurpose:\fP .RS 4 .PP .nf !> !> DLARTG generates a plane rotation so that !> !> [ C S ] \&. [ F ] = [ R ] !> [ -S C ] [ G ] [ 0 ] !> !> where C**2 + S**2 = 1\&. !> !> The mathematical formulas used for C and S are !> R = sign(F) * sqrt(F**2 + G**2) !> C = F / R !> S = G / R !> Hence C >= 0\&. The algorithm used to compute these quantities !> incorporates scaling to avoid overflow or underflow in computing the !> square root of the sum of squares\&. !> !> This version is discontinuous in R at F = 0 but it returns the same !> C and S as ZLARTG for complex inputs (F,0) and (G,0)\&. !> !> This is a more accurate version of the BLAS1 routine DROTG, !> with the following other differences: !> F and G are unchanged on return\&. !> If G=0, then C=1 and S=0\&. !> If F=0 and (G \&.ne\&. 0), then C=0 and S=sign(1,G) without doing any !> floating point operations (saves work in DBDSQR when !> there are zeros on the diagonal)\&. !> !> Below, wp=>dp stands for double precision from LA_CONSTANTS module\&. !> .fi .PP .RE .PP \fBParameters\fP .RS 4 \fIF\fP .PP .nf !> F is REAL(wp) !> The first component of vector to be rotated\&. !> .fi .PP .br \fIG\fP .PP .nf !> G is REAL(wp) !> The second component of vector to be rotated\&. !> .fi .PP .br \fIC\fP .PP .nf !> C is REAL(wp) !> The cosine of the rotation\&. !> .fi .PP .br \fIS\fP .PP .nf !> S is REAL(wp) !> The sine of the rotation\&. !> .fi .PP .br \fIR\fP .PP .nf !> R is REAL(wp) !> The nonzero component of the rotated vector\&. !> .fi .PP .RE .PP \fBAuthor\fP .RS 4 Edward Anderson, Lockheed Martin .RE .PP \fBDate\fP .RS 4 July 2016 .RE .PP \fBContributors:\fP .RS 4 Weslley Pereira, University of Colorado Denver, USA .RE .PP \fBFurther Details:\fP .RS 4 .PP .nf !> !> Anderson E\&. (2017) !> Algorithm 978: Safe Scaling in the Level 1 BLAS !> ACM Trans Math Softw 44:1--28 !> https://doi\&.org/10\&.1145/3061665 !> !> .fi .PP .RE .PP .PP Definition at line \fB110\fP of file \fBdlartg\&.f90\fP\&. .SS "subroutine slartg (real(wp) f, real(wp) g, real(wp) c, real(wp) s, real(wp) r)" .PP \fBSLARTG\fP generates a plane rotation with real cosine and real sine\&. .PP \fBPurpose:\fP .RS 4 .PP .nf !> !> SLARTG generates a plane rotation so that !> !> [ C S ] \&. [ F ] = [ R ] !> [ -S C ] [ G ] [ 0 ] !> !> where C**2 + S**2 = 1\&. !> !> The mathematical formulas used for C and S are !> R = sign(F) * sqrt(F**2 + G**2) !> C = F / R !> S = G / R !> Hence C >= 0\&. The algorithm used to compute these quantities !> incorporates scaling to avoid overflow or underflow in computing the !> square root of the sum of squares\&. !> !> This version is discontinuous in R at F = 0 but it returns the same !> C and S as CLARTG for complex inputs (F,0) and (G,0)\&. !> !> This is a more accurate version of the BLAS1 routine SROTG, !> with the following other differences: !> F and G are unchanged on return\&. !> If G=0, then C=1 and S=0\&. !> If F=0 and (G \&.ne\&. 0), then C=0 and S=sign(1,G) without doing any !> floating point operations (saves work in SBDSQR when !> there are zeros on the diagonal)\&. !> !> Below, wp=>sp stands for single precision from LA_CONSTANTS module\&. !> .fi .PP .RE .PP \fBParameters\fP .RS 4 \fIF\fP .PP .nf !> F is REAL(wp) !> The first component of vector to be rotated\&. !> .fi .PP .br \fIG\fP .PP .nf !> G is REAL(wp) !> The second component of vector to be rotated\&. !> .fi .PP .br \fIC\fP .PP .nf !> C is REAL(wp) !> The cosine of the rotation\&. !> .fi .PP .br \fIS\fP .PP .nf !> S is REAL(wp) !> The sine of the rotation\&. !> .fi .PP .br \fIR\fP .PP .nf !> R is REAL(wp) !> The nonzero component of the rotated vector\&. !> .fi .PP .RE .PP \fBAuthor\fP .RS 4 Edward Anderson, Lockheed Martin .RE .PP \fBDate\fP .RS 4 July 2016 .RE .PP \fBContributors:\fP .RS 4 Weslley Pereira, University of Colorado Denver, USA .RE .PP \fBFurther Details:\fP .RS 4 .PP .nf !> !> Anderson E\&. (2017) !> Algorithm 978: Safe Scaling in the Level 1 BLAS !> ACM Trans Math Softw 44:1--28 !> https://doi\&.org/10\&.1145/3061665 !> !> .fi .PP .RE .PP .PP Definition at line \fB110\fP of file \fBslartg\&.f90\fP\&. .SS "subroutine zlartg (complex(wp) f, complex(wp) g, real(wp) c, complex(wp) s, complex(wp) r)" .PP \fBZLARTG\fP generates a plane rotation with real cosine and complex sine\&. .PP \fBPurpose:\fP .RS 4 .PP .nf !> !> ZLARTG generates a plane rotation so that !> !> [ C S ] \&. [ F ] = [ R ] !> [ -conjg(S) C ] [ G ] [ 0 ] !> !> where C is real and C**2 + |S|**2 = 1\&. !> !> The mathematical formulas used for C and S are !> !> sgn(x) = { x / |x|, x != 0 !> { 1, x = 0 !> !> R = sgn(F) * sqrt(|F|**2 + |G|**2) !> !> C = |F| / sqrt(|F|**2 + |G|**2) !> !> S = sgn(F) * conjg(G) / sqrt(|F|**2 + |G|**2) !> !> Special conditions: !> If G=0, then C=1 and S=0\&. !> If F=0, then C=0 and S is chosen so that R is real\&. !> !> When F and G are real, the formulas simplify to C = F/R and !> S = G/R, and the returned values of C, S, and R should be !> identical to those returned by DLARTG\&. !> !> The algorithm used to compute these quantities incorporates scaling !> to avoid overflow or underflow in computing the square root of the !> sum of squares\&. !> !> This is the same routine ZROTG fom BLAS1, except that !> F and G are unchanged on return\&. !> !> Below, wp=>dp stands for double precision from LA_CONSTANTS module\&. !> .fi .PP .RE .PP \fBParameters\fP .RS 4 \fIF\fP .PP .nf !> F is COMPLEX(wp) !> The first component of vector to be rotated\&. !> .fi .PP .br \fIG\fP .PP .nf !> G is COMPLEX(wp) !> The second component of vector to be rotated\&. !> .fi .PP .br \fIC\fP .PP .nf !> C is REAL(wp) !> The cosine of the rotation\&. !> .fi .PP .br \fIS\fP .PP .nf !> S is COMPLEX(wp) !> The sine of the rotation\&. !> .fi .PP .br \fIR\fP .PP .nf !> R is COMPLEX(wp) !> The nonzero component of the rotated vector\&. !> .fi .PP .RE .PP \fBAuthor\fP .RS 4 Weslley Pereira, University of Colorado Denver, USA .RE .PP \fBDate\fP .RS 4 December 2021 .RE .PP \fBFurther Details:\fP .RS 4 .PP .nf !> !> Based on the algorithm from !> !> Anderson E\&. (2017) !> Algorithm 978: Safe Scaling in the Level 1 BLAS !> ACM Trans Math Softw 44:1--28 !> https://doi\&.org/10\&.1145/3061665 !> !> .fi .PP .RE .PP .PP Definition at line \fB115\fP of file \fBzlartg\&.f90\fP\&. .SH "Author" .PP Generated automatically by Doxygen for LAPACK from the source code\&.