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

How to use own low rank types for A and B #2

Open
mipals opened this issue Apr 20, 2020 · 6 comments
Open

How to use own low rank types for A and B #2

mipals opened this issue Apr 20, 2020 · 6 comments

Comments

@mipals
Copy link

mipals commented Apr 20, 2020

I was wondering which operations do you need to have implemented for A and B in order to use your implementation?

Sorry if this should not be posted as an issue. Im pretty new to GitHub.

@dlfivefifty
Copy link
Member

At the moment SemiseparableMatrix is not really implemented, but it supports any matrix types for L and U.

AlmostBandedMatrix has it hard-coded as SemiseparableMatrices.LowRankMatrix, which is a type alias for ApplyMatrix(*,U,V). This could be redesigned. The code itself just uses U,V = arguments(fillpart(A)) so this could be changed to an interface. Though perhaps we would want to support 3-argument low-rank formats (U*Σ*V where Σ is diagonal)?

@dlfivefifty
Copy link
Member

Sorry if this should not be posted as an issue. Im pretty new to GitHub.

Issues are the best place to have these types of conversations, thanks for posting!

@mipals
Copy link
Author

mipals commented Apr 20, 2020

Thanks a lot for the clarification. Do you have any future plans to further develop the capabilities of SemiseparableMatrix?

I dont think its particularly clear from the description that AlmostBandedMatrix is hard-coded with B being a LowRankMatrix, but i guess it makes sense if the code uses U and V directly. Supporting 3-argument low-rank formats could be useful, but I guess it might suffice to just "include" Σ in U and V?

@dlfivefifty
Copy link
Member

Thanks a lot for the clarification. Do you have any future plans to further develop the capabilities of SemiseparableMatrix?

No concrete plans, so I would love to have help! The feature I want most is for representing inverses of banded matrices as Banded + Semiseparable, I'm pretty sure it can be done in O(n).

I dont think its particularly clear from the description that AlmostBandedMatrix is hard-coded with B being a LowRankMatrix

This was just quickly thrown together (hence v0.0.1).

Supporting 3-argument low-rank formats could be useful, but I guess it might suffice to just "include" Σ in U and V?

Right, we can always return U, Σ*V or in lazy form U, ApplyMatrix(*, Σ, V). This would be really easy for anything that supports the ApplyArray interface (in fact sub-views of ApplyArray do and already work):

_two_arguments(A,B) = (A,B)
_two_arguments(A,B, C...) = (A, ApplyMarix(*, B, C...))
two_arguments(A) = _two_arguments(arguments(A)...)

@mipals
Copy link
Author

mipals commented Apr 21, 2020

No concrete plans, so I would love to have help! The feature I want most is for representing inverses of banded matrices as Banded + Semiseparable, I'm pretty sure it can be done in O(n).

I have only worked with symmetric extended generator representable semiseparable matrices (symmetric EGRSS matrices) which have the form tril(UV') + triu(VU',1). For these Cholesky factorizations (and its inverse) have a similar form L = tril(UW') (L^{-1} = tril(YZ') ) and can be computed in O(n). Similar results happens when you add a diagonal matrix tril(UV') + triu(VU',1) + diag(d), so I guess equivalent speeds should be possible for ```Semiseparable + Banded``.

Right, we can always return U, Σ*V or in lazy form U, ApplyMatrix(*, Σ, V). This would be really easy for anything that supports the ApplyArray interface (in fact sub-views of ApplyArray do and already work):

_two_arguments(A,B) = (A,B)
_two_arguments(A,B, C...) = (A, ApplyMarix(*, B, C...))
two_arguments(A) = _two_arguments(arguments(A)...)

That was exactly what i was thinking. I dont know any particulars of the ApplyArray interface, but from you say it does look like a viable route to take.

@dlfivefifty
Copy link
Member

Note https://github.com/JuliaMatrices/LowRankApprox.jl which has a lot of low rank approximations. The only reason I'm not using that is I needed support for views of a low rank matrix to also conform to the "low rank interface", which is true for AppliedArray but not for LowRankApprox.LowRankMatrix.

I should unify this a bit better.

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

2 participants