For a given vector I would like to find the orthogonal basis around it, i.e. the given vector normalized and randomly chosen basis of orthogonal sub-space. Is there a convenient function for this in Julia?
The function you are looking for is called nullspace
.
julia> x = randn(5);
julia> x⊥ = nullspace(x');
julia> x'x⊥
1×4 Array{Float64,2}:
7.69373e-16 -5.45785e-16 -4.27252e-17 1.26778e-16
You could define a function orth (if someonehasn't already done this)
orth(M) = qr(M)[1]
See here: https://groups.google.com/forum/#!topic/julia-users/eG6a4tj7LGg and http://docs.julialang.org/en/release-0.4/stdlib/linalg/
Or from IterativeSolvers.jl:
orthogonalize{T}(v::Vector{T}, K::KrylovSubspace{T})
See: https://github.com/JuliaMath/IterativeSolvers.jl
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With