Gram-Schmidt orthonormalization algorithm

This is a discussion on Gram-Schmidt orthonormalization algorithm within the APL forums in Programming Languages category; A while ago I posted to a thread "APL versu MatLab" , http://groups.google.com/group/comp....c5d831c9052795 , seeking more concrete examples of elegance of expression of algorithms in the 2 languages . My niece just finished "Matrix Methods" in U of CO Applied Math so now knows what "orthonormalization" means and how to do it in Matlab . I've told her is is quite elegant in APL ; less so in K . Here's the K version I did to compute my WTC design : norm { _sqrt +/ _sqr x } norm..h : " Euclidian norm , or length of a vector ...

Go Back   Application Development Forum > Programming Languages > APL

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 12-28-2007, 03:30 PM
Bob Armstrong
Guest
 
Default Gram-Schmidt orthonormalization algorithm

A while ago I posted to a thread "APL versu MatLab" ,
http://groups.google.com/group/comp....c5d831c9052795
, seeking more concrete examples of elegance of expression of
algorithms in the 2 languages .

My niece just finished "Matrix Methods" in U of CO Applied Math so now
knows what "orthonormalization" means and how to do it in Matlab .

I've told her is is quite elegant in APL ; less so in K . Here's the
K version I did to compute my WTC design :

norm { _sqrt +/ _sqr x }
norm..h : " Euclidian norm , or length of a vector "

normalize : { x % norm x }
normalize..h : "divide vector by its length to make length 1 "

ortho : { r : 1 # x : normalize' x ; i : 0 ; do[ -1 + # x ; r : r , ,
normalize x[ i ] - r _dot x[ i +: 1 ] _lsq r ] ; r }
ortho..h : " orthonormalizes columns of a matrix . i.e / r : ortho x ;
( r _mul + r ) ~ r _lsq r / "


I worry that when the time comes I want to review all my CoSy notes
from ~ 1986 thru 1999 in old flat APL+PC based CoSy 2 , I won't be
able to get it going . In any case , I'm not goiing to mess with it
now to find my ortho from back then .

Can someone post their algorithm ? I doubt if it has been changed much
in newer APLs tho I know the J does some new tricks .



Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 09:43 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.