Skip to content

Latest commit

 

History

History
252 lines (157 loc) · 5.91 KB

File metadata and controls

252 lines (157 loc) · 5.91 KB

dpttrf

Compute the L * D * L ** T factorization of real symmetric positive definite tridiagonal matrix A.

Usage

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

dpttrf( N, D, E, info )

Computes the L * D * L ** T factorization of real symmetric positive definite tridiagonal matrix A.

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

var N = 3;
var info = 0;
var D = new Float64Array( [ 4.0, 5.0, 6.0 ] );
var E = new Float64Array( [ 1.0, 2.0 ] );

dpttrf( N, D, E, info );
// D => <Float64Array>[ 4, 4.75, ~5.15789 ]
// E => <Float64Array>[ 0.25, ~0.4210 ]

The function has the following parameters:

  • N: order of matrix A.
  • D: the N diagonal elements of A as a Float64Array.
  • E: the N-1 subdiagonal elements of A as a Float64Array.
  • info: status code, 0 if successful, <0 if i-th argument had an illegal value, >0 if leading principal minor of order i is not positive; if <N then factorization could not be completed, if >N then the factorization was completed, but D(N) <= 0.

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

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

var N = 3;
var info = 0;

// Initial arrays...
var D0 = new Float64Array( [ 0.0, 4.0, 5.0, 6.0 ] );
var E0 = new Float64Array( [ 0.0, 1.0, 2.0 ] );

// Create offset views...
var D1 = new Float64Array( D0.buffer, D0.BYTES_PER_ELEMENT*1 ); // start at 1st element
var E1 = new Float64Array( E0.buffer, E0.BYTES_PER_ELEMENT*1 ); // start at 1st element

dpttrf( N, D1, E1, info );
// D0 => <Float64Array>[ 0.0, 4.0, 4.75, ~5.15789 ]
// E0 => <Float64Array>[ 0.0, 0.25, ~0.4210 ]

dpttrf.ndarray( N, D, strideD, offsetD, E, strideE, offsetE, info )

Computes the L * D * L ** T factorization of real symmetric positive definite tridiagonal matrix A using alternative indexing semantics.

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

var N = 3;
var info = 0;
var D = new Float64Array( [ 4.0, 5.0, 6.0 ] );
var E = new Float64Array( [ 1.0, 2.0 ] );

dpttrf.ndarray( N, D, 1, 0, E, 1, 0, info );
// D => <Float64Array>[ 4, 4.75, ~5.15789 ]
// E => <Float64Array>[ 0.25, ~0.4210 ]

The function has the following additional parameters:

  • strideD: D stride length.
  • offsetD: starting index for D.
  • strideE: E stride length.
  • offsetE: starting index for E.

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 N = 3;
var info = 0;
var D = new Float64Array( [ 0.0, 4.0, 5.0, 6.0 ] );
var E = new Float64Array( [ 0.0, 1.0, 2.0 ] );

dpttrf.ndarray( N, D, 1, 1, E, 1, 1, info );
// D => <Float64Array>[ 0.0, 4.0, 4.75, ~5.15789 ]
// E => <Float64Array>[ 0.0, 0.25, ~0.4210 ]

Notes

  • dpttrf() corresponds to the LAPACK level 1 function dpttrf.

Examples

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

// Specify input data:
var N = 3;
var info = 0;
var D = new Float64Array( [ 4.0, 5.0, 6.0 ] );
var E = new Float64Array( [ 1.0, 2.0 ] );

// Perform the `L * D * L ** T` factorization:
dpttrf( N, D, E, info );
console.log( D, E, info );

C APIs

Usage

TODO

TODO

TODO.

TODO

TODO

TODO

Examples

TODO