SROTI/DROTI

Apply sparse Givens rotation

Name SROTI/DROTI

Apply sparse Givens rotation

Purpose Given real scalars c and s, a sparse vector x stored in compact form via a set of indices, and a dense vector y stored in full storage form, these subprograms apply the Givens rotation

xi

c

s

xi

for i = 1, …, n.

yi

s

c

yi

More precisely, let x be a sparse n-vector with m n interesting (usually nonzero) elements, and let {k1, k2, ..., km} be the indices of these elements. All uninteresting elements of x are assumed to be zero. Let y be an ordinary n-vector that has zero elements corresponding to the uninteresting elements of x. If x is represented by arrays x and indx such that indx(i) = ki and x(i) = xki, these subprograms compute

xi

c

s

xi

for i = 1, …, m.

yki

s

c

yki

Usually, c and s have been determined by the companion subprogram SROTG or DROTG.

Usage

VECLIB:

 

 

INTEGER*4

m, indx(m)

 

REAL*4

x(m), y(n), c, s

 

CALL SROTI(m, x, indx, y, c, s)

 

INTEGER*4

m, indx(m)

 

REAL*8

x(m), y(n), c, s

CALL DROTI(m, x, indx, y, c, s)

VECLIB8:

INTEGER*8

m, indx(m)

REAL*4

x(m), y(n), c, s

CALL SROTI(m, x, indx, y, c, s)

INTEGER*8

m, indx(m)

REAL*8

x(m), y(n), c, s

CALL DROTI(m, x, indx, y, c, s)

120HP MLIB User’s Guide