-
Notifications
You must be signed in to change notification settings - Fork 13
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
Fix constructor of ScaledSobolSeq #17
Fix constructor of ScaledSobolSeq #17
Conversation
add next!(s::ScaledSobolSeq) to allow for iteration over ScaledSobolSeq
8b24950
to
46e5ac7
Compare
…aledSobolSeq directly, support AbstractVector
src/Sobol.jl
Outdated
end | ||
SobolSeq(N::Integer, lb, ub) = | ||
ScaledSobolSeq{Int(N)}(copy!(Vector{Float64}(undef,N), lb), copy!(Vector{Float64}(undef,N), ub)) | ||
function ScaledSobolSeq(lb::Vector{<:Real}, ub::Vector{<:Real}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be AbstractVector
src/Sobol.jl
Outdated
@@ -122,11 +122,19 @@ struct ScaledSobolSeq{N} <: AbstractSobolSeq{N} | |||
s::SobolSeq{N} | |||
lb::Vector{Float64} | |||
ub::Vector{Float64} | |||
ScaledSobolSeq(lb::Vector{Float64}, ub::Vector{Float64}) = | |||
function ScaledSobolSeq(N::Integer, lb::Vector{<:Real}, ub::Vector{<:Real}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The right thing to do is to use ScaledSobolSeq{N}(...) where {N}
for the inner constructor here. (This changed in Julia 0.7, which is why this code stopped working.)
Thanks for catching this! I pushed commit that modifies this PR a bit as commented above. |
Awesome, thank you! |
The following example from the README did not work:
SobolSeq(2, [-1,0,0],[1,3,2])
I added
N
to the arguments of the inner constructor.