Socket
Book a DemoInstallSign in
Socket

ndarray-gram-schmidt-qr

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ndarray-gram-schmidt-qr

Modified Gram-Schmidt Algorithm for QR Factorization

latest
Source
npmnpm
Version
1.0.3
Version published
Maintainers
1
Created
Source

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

Keywords

gramschmidt

FAQs

Package last updated on 08 May 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts