Developer Reference for Intel® oneAPI Math Kernel Library for Fortran

ID 766686
Date 6/24/2024
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

?lartg

Generates a plane rotation with real cosine and real/complex sine.

Syntax

call slartg( f, g, cs, sn, r )

call dlartg( f, g, cs, sn, r )

call clartg( f, g, cs, sn, r )

call zlartg( f, g, cs, sn, r )

Include Files

  • mkl.fi

Description

The routine generates a plane rotation so that


Equation

where cs2 + |sn|2 = 1

This is a slower, more accurate version of the BLAS Level 1 routine ?rotg, except for the following differences.

For slartg/dlartg:

f and g are unchanged on return;

If g=0, then cs=1 and sn=0;

If f=0 and g 0, then cs=0 and sn=1 without doing any floating point operations (saves work in ?bdsqr when there are zeros on the diagonal);

If f exceeds g in magnitude, cs will be positive.

For clartg/zlartg:

f and g are unchanged on return;

If g=0, then cs=1 and sn=0;

If f=0, then cs=0 and sn is chosen so that r is real.

Input Parameters

f, g

REAL for slartg

DOUBLE PRECISION for dlartg

COMPLEX for clartg

DOUBLE COMPLEX for zlartg

The first and second component of vector to be rotated.

Output Parameters

cs

REAL for slartg/clartg

DOUBLE PRECISION for dlartg/zlartg

The cosine of the rotation.

sn

REAL for slartg

DOUBLE PRECISION for dlartg

COMPLEX for clartg

DOUBLE COMPLEX for zlartg

The sine of the rotation.

r

REAL for slartg

DOUBLE PRECISION for dlartg

COMPLEX for clartg

DOUBLE COMPLEX for zlartg

The nonzero component of the rotated vector.