Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ sroti(3DXML) — Extended Math Library 3.4

Media Vault

Software Library

Restoration Projects

Artifacts Sought

SROTI(3DXML)  —  Subroutines

Digital

Name

sroti, droti − Real givens plane rotation applied to sparse vector

FORMAT

{S,D}ROTI ( nz, x, indx, y, c, s )

Arguments

nzinteger∗4
On entry, the number of elements in the vector in the compressed form.
On exit, nz is unchanged. 

xreal∗4 | real∗8
On entry, an array of the elements of vector x in compressed form.
On exit, if nz <= 0, x is unchanged.  If nz > 0, the array X is updated. 

indxinteger∗4
On entry, an array containing the indices of the compressed form. The values in INDX must be distinct for consistent vector or parallel execution.
On exit, indx is unchanged. 

yreal∗4 | real∗8
On entry, an array of the elements of vector y stored in full form.
On exit, if nz <= 0, y is unchanged. If nz > 0, the elements in the vector y corresponding to the indices in the INDX array are overwritten. 

creal∗4 | real∗8
On entry, c is the first rotation element, which can be interpreted as the cosine of the angle of rotation. 
On exit, c is unchanged. 

sreal∗4 | real∗8
On entry, s is the second rotation element, which can be interpreted as the sine of the angle of rotation. 
On exit, s is unchanged. 

Description

The _ROTI routines apply a real Givens rotation to a sparse vector x stored in compressed form and another vector y stored in full form. 

For i = 1, ..., nz:

temp  =  -s ∗ x(i) + c ∗ y(indx(i))

x(i)  =   c ∗ x(i) + s ∗ y(indx(i))

y(indx(i))  =  temp

If nz <= 0, x and y are unchanged. 

Only the elements of y whose indices are listed in INDX are referenced or modified. 

The output vectors x and y have nonzero elements in the locations where either input vector x or y had nonzero elements. Because the _ROTI subprograms do not handle this fill-in, the arrays X and INDX must take this into account on input. This means that all nonzero elements of y must be listed in the array INDX, resulting in an INDX array containing the indices of all nonzero elements of both vectors x and y. 

Example

INTEGER NZ, INDX(10)
REAL∗8 Y(40), X(10), C, S
NZ = 10
CALL DROTI(NZ, X, INDX, Y, C, S)

This FORTRAN code shows how to apply a Givens rotation to a sparse vector x,  stored in compressed form, and another vector y, stored in full form.

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026