Pergunta

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

Foi útil?

Solução

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.

Outras dicas

Perhaps this is what you need:

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

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

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top