Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lazy Hankel? #28

Open
vpuri3 opened this issue Nov 8, 2022 · 0 comments
Open

Lazy Hankel? #28

vpuri3 opened this issue Nov 8, 2022 · 0 comments

Comments

@vpuri3
Copy link

vpuri3 commented Nov 8, 2022

Hi Brady, saw your talk today.

I see you are forming the full Hankel matrix, and that is your major time sink. I think you should be able to form a lazy representation to the Hankel matrix as follows:

# https://en.wikipedia.org/wiki/Hankel_matrix
struct HankelMatrix{T,Ta} <: AbstractMatrix{T}
    a::Ta # array of elements [a1, ..., aN] 
end

# overload Base: size
# overload LinearAlgebra:  *, \, mul!, ldiv!, lmul!, rmul!, adjoint, transpose, conj
# ref https://docs.julialang.org/en/v1/manual/interfaces/#man-interface-array

function Base.getindex(H::HankelMatrix, idx)
    correct_index = # integer computation
    return H.a[correct_index]
end

function Base.setindex!(newval, H::HankelMatrix, idx)
    H.a[correct_index] = newval
end

And then you would be able to pass this to any SVD algorithm in Julia.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant