Frage

orth(somematrix) is built into MATLAB but doesn't seem to be available in the Haskell hmatrix library.

War es hilfreich?

Lösung

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.

Andere Tipps

Perhaps this is what you need:

orth m = toColumns u
        where (u,_,_) = compactSVD m

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

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top