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

Infinite random wide matrices #183

Closed
DanielVandH opened this issue Jun 30, 2024 · 0 comments
Closed

Infinite random wide matrices #183

DanielVandH opened this issue Jun 30, 2024 · 0 comments

Comments

@DanielVandH
Copy link
Contributor

DanielVandH commented Jun 30, 2024

Going beyond #181, it could also be useful to allow for random $\mathbb R^{n \times \infty}$ matrices, where $n < \infty$. This could be useful for defining infinite random lazy banded matrices. The definition could simply be a wrapped InfRandVector, e.g. this seems fine

struct InfRandMatrix{T, S<:InfiniteArrays.InfRandVector{T}} <: AbstractMatrix{T} 
    seq::S 
    n::Int 
end
function Base.getindex(A::InfRandMatrix, i::Int, j::Int)
    ((i < 1) || (i > A.n) || (j < 0)) && throw(BoundsError(A, (i, j)))
    lin = (j - 1) * A.n + i 
    return seq[lin]
end
Base.size(A::InfRandMatrix) = (A.n, ∞)
seq = InfiniteArrays.InfRandVector()
InfRandMatrix(seq, 5)
5×ℵ₀ InfRandMatrix{Float64, InfiniteArrays.InfRandVector{Float64, DataType, Xoshiro}} with indices Base.OneTo(5)×OneToInf():
 0.00225059  0.866943  0.999317  0.428685   0.830202  0.81882    0.641535    
 0.680748    0.655852  0.744458  0.481688   0.704767  0.0758536  0.883736
 0.73533     0.442892  0.988752  0.387243   0.644419  0.740517   0.520043
 0.806732    0.761242  0.604686  0.0144961  0.577433  0.0988845  0.875899
 0.241418    0.732341  0.594094  0.843347   0.391507  0.760893   0.58049

(modulo testing). Would want #182 fixed first also. brand could then be used like brand(n, ∞, l, r) (with some extensions) to generate infinite random banded matrices.

@DanielVandH DanielVandH closed this as not planned Won't fix, can't repro, duplicate, stale Jul 1, 2024
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

Successfully merging a pull request may close this issue.

1 participant