1.0.3 • Published 9 years ago

ndarray-gram-schmidt-qr v1.0.3

Weekly downloads
2
License
MIT
Repository
github
Last release
9 years ago

ndarray-gram-schmidt-qr

Build Status npm version

A module for calculating the in-place QR decomposition of a matrix

Introduction

The algorithm is the numerically stable variant of the Gram-Schmidt QR decomposition as found on p. 58 of Trefethen and Bau's Numerical Linear Algebra. In pseudocode, the algorithm is:

for i = 1 to n
  v_i = a_i

for i = 1 to n
  r_ii = ||v_i||
  q_i = v_i / r_ii

  for j = i+1 to n
    r_ij = q_i' * v_j
    v_j = v_j - r_ij * q_i

Only square matrices are currently tested. For complex numbers see ndarray-gram-schmidt-qr-complex.

Usage

The algorithm currently only calculates the in-place QR decomposition and returns true on successful completion.

var qr = require('ndarray-gram-schmidt-qr'),
    pool = require('ndarray-scratch');

var A = ndarray( new Float64Array([1,2,7,4,5,1,7,4,9]), [3,3] );
var R = pool.zeros( A.shape, A.dtype );

qr( A, R );

Then the product A * R is approximately equal to the original matrix.

Credits

(c) 2015 Ricky Reusser. MIT License

1.0.3

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago

0.0.3

9 years ago

0.0.2

9 years ago