Skip to content

Latest commit

 

History

History
263 lines (170 loc) · 6.68 KB

File metadata and controls

263 lines (170 loc) · 6.68 KB

dlartv

Apply a vector of real plane rotations to elements of real vectors X and Y.

Usage

var dlartv = require( '@stdlib/lapack/base/dlartv' );

dlartv( N, X, strideX, Y, strideY, C, S, strideCS )

Applies a vector of real plane rotations to elements of real vectors X and Y.

var Float64Array = require( '@stdlib/array/float64' );

var X = new Float64Array( [ 1.0, 1.0 ] );
var Y = new Float64Array( [ 1.0, 1.0 ] );
var C = new Float64Array( [ 1.0, 1.0 ] );
var S = new Float64Array( [ 0.0, 0.0 ] );

dlartv( 2, X, 1, Y, 1, C, S, 1 );
// X => <Float64Array>[ 1.0, 1.0 ]
// Y => <Float64Array>[ 1.0, 1.0 ]

The function has the following parameters:

  • N: number of plane rotations to apply.
  • X: first input Float64Array.
  • strideX: X stride length.
  • Y: second input Float64Array.
  • strideY: Y stride length.
  • C: input Float64Array containing the cosine values of the plane rotations.
  • S: input Float64Array containing the sine values of the plane rotations.
  • strideCS: CS stride length.

Note that indexing is relative to the first index. To introduce an offset, use typed array views.

var Float64Array = require( '@stdlib/array/float64' );

// Initial arrays...
var X0 = new Float64Array( [ 0.0, 1.0, 1.0 ] );
var Y0 = new Float64Array( [ 0.0, 1.0, 1.0 ] );
var C0 = new Float64Array( [ 0.0, 1.0, 1.0 ] );
var S0 = new Float64Array( [ 0.0, 0.0, 0.0 ] );

// Create offset views...
var X1 = new Float64Array( X0.buffer, X0.BYTES_PER_ELEMENT*1 ); // start at 2nd element
var Y1 = new Float64Array( Y0.buffer, Y0.BYTES_PER_ELEMENT*1 ); // start at 2nd element
var C1 = new Float64Array( C0.buffer, C0.BYTES_PER_ELEMENT*1 ); // start at 2nd element
var S1 = new Float64Array( S0.buffer, S0.BYTES_PER_ELEMENT*1 ); // start at 2nd element

dlartv( 2, X1, 1, Y1, 1, C1, S1, 1 );
// X0 => <Float64Array>[ 0.0, 1.0, 1.0 ]
// Y0 => <Float64Array>[ 0.0, 1.0, 1.0 ]

dlartv.ndarray( N, X, sx, ox, Y, sy, oy, C, sc, oc, S, ss, os )

Applies a vector of real plane rotations to elements of real vectors X and Y using alternative semantic indexing.

var Float64Array = require( '@stdlib/array/float64' );

var X = new Float64Array( [ 1.0, 1.0 ] );
var Y = new Float64Array( [ 1.0, 1.0 ] );
var C = new Float64Array( [ 1.0, 1.0 ] );
var S = new Float64Array( [ 0.0, 0.0 ] );

dlartv.ndarray( 2, X, 1, 0, Y, 1, 0, C, 1, 0, S, 1, 0 );
// X => <Float64Array>[ 1.0, 1.0 ]
// Y => <Float64Array>[ 1.0, 1.0 ]

The function has the following parameters:

  • N: number of plane rotations to apply.
  • X: first input Float64Array.
  • sx: X stride length.
  • ox: starting index for X.
  • Y: second input Float64Array.
  • sy: Y stride length.
  • oy: starting index for Y.
  • C: input Float64Array containing the cosine values of the plane rotations.
  • sc: C stride length.
  • oc: starting index for C.
  • S: input Float64Array containing the sine values of the plane rotations.
  • ss: S stride length.
  • os: starting index for S.

While typed array views mandate a view offset based on the underlying buffer, the offset parameters support indexing semantics based on starting indices. For example,

var Float64Array = require( '@stdlib/array/float64' );

var X = new Float64Array( [ 1.0, 1.0 ] );
var Y = new Float64Array( [ 1.0, 1.0 ] );
var C = new Float64Array( [ 1.0, 1.0 ] );
var S = new Float64Array( [ 0.5, 0.4 ] );

dlartv.ndarray( 2, X, -1, 1, Y, 1, 0, C, 1, 0, S, 1, 0 );
// X => <Float64Array>[ 1.4, 1.5 ]
// Y => <Float64Array>[ 0.5, 0.6 ]

Notes

Examples

var Float64Array = require( '@stdlib/array/float64' );
var dlartv = require( '@stdlib/lapack/base/dlartv' );

var X = new Float64Array( [ 1.0, 1.0 ] );
var Y = new Float64Array( [ 1.0, 1.0 ] );
var C = new Float64Array( [ 1.0, 1.0 ] );
var S = new Float64Array( [ 0.5, 0.5 ] );

X = dlartv( 2, X, 1, Y, 1, C, S, 1 );
console.log( X );
console.log( Y );

C APIs

Usage

TODO

TODO

TODO.

TODO

TODO

TODO

Examples

TODO