[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]
Base Operating System and Extensions Technical Reference, Volume 2

SROTG, DROTG, CROTG, or ZROTG Subroutine

Purpose

Constructs Givens plane rotation.

Library

BLAS Library (libblas.a)

FORTRAN Syntax

SUBROUTINE SROTG(A,B,C,S)
REAL A,B,C,S
SUBROUTINE DROTG(A,B,C,S)
DOUBLE PRECISION A,B,C,S
SUBROUTINE CROTG(A,B,C,S)
REAL C
COMPLEX A,B,S
SUBROUTINE ZROTG(A,B,C,S)
DOUBLE PRECISION C
COMPLEX*16 A,B,S

Description

Given vectors A and B, the SROTG, DROTG, CROTG, or ZROTG subroutine computes:

        A              B
a = ---------, b = ---------
    |A| + |B|      |A| + |B|
                                     2   2 1/2
roe = { a if |A| > |B| } r = roe (  a + b  ),
      { b if |B| >= |A| }
C = { A/r if r not = 0}   S = { B/r if r not = 0 }
    { 1 if r = 0 }        { 0 if r = 0 }

The numbers C, S, and r then satisfy the matrix equation:

---     ---     ---   ---     ---   ---
|  C   S  |     |   A   |     |   r   |
|         |  .  |       |  =  |       |
| -S   C  |     |   B   |     |   0   |
---     ---     ---   ---     ---   ---

The subroutines also compute:

    { S   if |A| > |B|,
z = { 1/C if |B| >= |A| and C not = 0,
    { 1   if C = 0.

The subroutines return r overwriting A and z overwriting B, as well as returning C and S.

Parameters

A On entry, contains a scalar constant; on exit, contains the value r.
B On entry, contains a scalar constant; on exit, contains the value z.
C Can contain any value on entry; the value C returned on exit.
S Can contain any value on entry; the value S returned on exit.

[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]