class OrthonormalBasis:
basis = []
def insert(s, vec):
residual = vec - s.projection(vec)
s.basis.append(residual.normalized())
def projection(s, vec):
if len(s.basis) == 0: # maybe we should raise an exception,
return 0. * vec # but this makes our insert() work in the null-basis case.
else:
return reduce(operator.add, [(vec & qi) * qi for qi in s.basis])
def __init__(s, non_orthonormal_basis = []):
for vec in non_orthonormal_basis:
s.insert(vec)
I don't really remember much linear algebra but I remeber thinking it was cool (and a great break from what I was really supposed to be studying) when I took it. unfortunately as with any higher math stuff, once that more theoretical stuff at the end of the quarter starts getting mixed in I realize I'm just not a mathematician at heart and just like hearing about it from others.
The undergrad "Advanced Linear Algebra" course I took got a little out of hand. Giant festering mass of theory. Plus cognitive dissonance from taking a numerical computing course at the same time, and at some point getting hit with the shocking realization that the Jordan normal form is numerically useless ("discontinuous whenever it is interesting" --Kahan). But that course was not the best-taught in the world anyway. Students to prof (moonlighting over from Claremont Graduate School): "You just read proofs out of the book onto the blackboard. You kinda suck." Prof (moonlighting over from Claremont Graduate School) to students: "They're not paying me very much to teach this course."
Hm, I seem to have lost the $70 little textbook. Or did I possibly lend it to anyone around these parts? (Horn and Johnson, Matrix Analysis?) I wouldn't mind looking at the part about unitary and normal matrices.
whee
Date: 2003-05-22 01:19 am (UTC)Re: whee
Date: 2003-05-22 01:33 am (UTC)Re: whee
Date: 2003-05-22 01:09 pm (UTC)Hm, I seem to have lost the $70 little textbook. Or did I possibly lend it to anyone around these parts? (Horn and Johnson, Matrix Analysis?) I wouldn't mind looking at the part about unitary and normal matrices.
Re: whee
Date: 2003-05-22 02:10 pm (UTC)Even more shocking, I may remember where I put it....
Re: whee
Date: 2003-05-22 06:51 pm (UTC)