2012-02-20 13 views

答えて

5
import Numeric.LinearAlgebra  

orth :: Field a => Matrix a -> [Vector a] 
orth m = toColumns $ fst $ qr m 

またはポイントフリー

orth = toColumns . fst . qr 

Wikipedia説明があります。

1

おそらくこれは、何が必要です:

彼らはNumeric.LinearAlgebra.Algorithms.qrを使用すると言うが、私はQR `の面で` orth`を書く方法を知らない
orth m = toColumns u 
     where (u,_,_) = compactSVD m 

https://github.com/AlbertoRuiz/hmatrix/issues/10#issuecomment-4077403

+0

qr分解からの回転qの列は、全空間にわたっています。入力行列mの範囲空間の正規直交基底を必要とする場合は、qから 'rank m'列だけを取る必要があります(行列ランクはSVDを使って数値的に推定されます)。代わりに上記のようにcompatSVDを使用することもできますが、基底ベクトルは異なります。 –

関連する問題