How do you compute an orthogonal basis of a matrix using hmatrix?
-
28-10-2019 - |
문제
orth(somematrix)
is built into MATLAB but doesn't seem to be available in the Haskell hmatrix library.
해결책
import Numeric.LinearAlgebra
orth :: Field a => Matrix a -> [Vector a]
orth m = toColumns $ fst $ qr m
or point-free
orth = toColumns . fst . qr
Wikipedia has an explanation.
다른 팁
Perhaps this is what you need:
orth m = toColumns u
where (u,_,_) = compactSVD m
https://github.com/AlbertoRuiz/hmatrix/issues/10#issuecomment-4077403
제휴하지 않습니다 StackOverflow