Functions
contrib/mul/mbl/mbl_mod_gram_schmidt.h File Reference

Orthogonalise a basis using modified Gram-Schmidt (and normalise) More...

#include <vnl/vnl_matrix.h>

Go to the source code of this file.

Functions

void mbl_mod_gram_schmidt (const vnl_matrix< double > &v, vnl_matrix< double > &e)
 Orthogonalise a basis using modified Gram-Schmidt.
void mbl_mod_gram_schmidt (const vnl_matrix< double > &v, vnl_matrix< double > &e, vnl_vector< double > &n)
 Convert input basis {v} to orthonormal basis {e}.

Detailed Description

Orthogonalise a basis using modified Gram-Schmidt (and normalise)

Author:
Martin Roberts

Note: Modified Gram-Schmidt is more numerically stable than the classical version The partially constructed transformed jth vector is used in the successive projections rather than the untransformed

   Modifications
   Mar. 2011 - Patrick Sauer - added variant that returns normalisation multipliers
   

Definition in file mbl_mod_gram_schmidt.h.


Function Documentation

void mbl_mod_gram_schmidt ( const vnl_matrix< double > &  v,
vnl_matrix< double > &  e 
)

Orthogonalise a basis using modified Gram-Schmidt.

Transform basis {vk} to orthonormal basis {ek} with k in range 1..N

 for j = 1 to N
     ej = vj
     for k = 1 to j-1
         ej = ej - <ej,ek>ek   //NB Classical GS has vj in inner product
     end
     ej = ej/|ej|
  end

Convert input basis {v} to orthonormal basis {e}. Each basis vector is a column of v, and likewise the orthonormal bases are returned as columns of e

Orthogonalise a basis using modified Gram-Schmidt.

Each basis vector is a column of v, and likewise the orthonormal bases are returned as columns of e

Definition at line 28 of file mbl_mod_gram_schmidt.cxx.

void mbl_mod_gram_schmidt ( const vnl_matrix< double > &  v,
vnl_matrix< double > &  e,
vnl_vector< double > &  np 
)

Convert input basis {v} to orthonormal basis {e}.

Each basis vector is a column of v, and likewise the orthonormal bases are returned as columns of e The multipliers used to normalise each vector in {e} are returned in n.

Each basis vector is a column of v, and likewise the orthonormal bases are returned as columns of e The multipliers used to normalise each vector in {e} are returned in np

Definition at line 70 of file mbl_mod_gram_schmidt.cxx.