Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: GramSchmidt problem

  • To: mathgroup at
  • Subject: [mg57044] Re: GramSchmidt problem
  • From: Paul Abbott <paul at>
  • Date: Thu, 12 May 2005 22:44:28 -0400 (EDT)
  • Organization: The University of Western Australia
  • References: <d5uvda$9at$>
  • Sender: owner-wri-mathgroup at

In article <d5uvda$9at$1 at>,
 Heath Gerhardt <heathgerhardt at> wrote:

> Does anyone know if there are any know problems with GramSchmidt
> crashing Mathematica? When I run it on these 4 25-dimensional vectors it
> crashes on my system:

Tt works perfectly with floating point vectors so I expect that it 
crashes because it is not simplifying the intermediate radical 

Here is functional code for computing GramSchmidt:

  GramSchmidt := Fold[Append[#1, FullSimplify[
   (#/Norm[#]&)[Fold[Projection, #2, #1]]]] & , {}, #1] & ; 

where the projection operator is

  Projection[f_, g_] := FullSimplify[f - (f.g) g]

FullSimplify has been used in both routines so that expressions 
involving radicals are completely simplified.

Calling your set of 4 vectors mat, one computes the orthonormal vectors 


As a check,

  Simplify[% . Transpose[%]]


Paul Abbott                                      Phone: +61 8 6488 2734
School of Physics, M013                            Fax: +61 8 6488 1014
The University of Western Australia         (CRICOS Provider No 00126G)    

  • Prev by Date: InterpolatingFunctionAnatomy.m
  • Next by Date: Re: Reading in a file
  • Previous by thread: Re: Integrate gives wrong answer
  • Next by thread: Re: GramSchmidt problem