Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/src/InverseDistance.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ f(x) = sin(x) + sin(x)^2 + sin(x)^3
n_samples = 25
lower_bound = 0.0
upper_bound = 10.0
x = sample(n_samples, lower_bound, upper_bound, LowDiscrepancySample(2))
x = sample(n_samples, lower_bound, upper_bound, LowDiscrepancySample(;base=2))
y = f.(x)

scatter(x, y, label="Sampled points", xlims=(lower_bound, upper_bound), legend=:top)
Expand Down
2 changes: 1 addition & 1 deletion lib/SurrogatesPolyChaos/test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ using SafeTestsets
x = sample(20, lb, ub, SobolSample())
y = objective_function.(x)
my_poly1d = PolynomialChaosSurrogate(x, y, lb, ub)
surrogate_optimize(objective_function, SRBF(), a, b, my_poly1d, LowDiscrepancySample(2))
@test_broken surrogate_optimize(objective_function, SRBF(), a, b, my_poly1d, LowDiscrepancySample(;base=2))

lb = [0.0, 0.0]
ub = [10.0, 10.0]
Expand Down
4 changes: 2 additions & 2 deletions src/Radials.jl
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ function _construct_rbf_interp_matrix(x, x_el::Number, lb, ub, phi, q, scale_fac
D = zeros(eltype(x_el), n, n)
end
@inbounds for i in 1:n
for j in 1:n
for j in i:n
D[i, j] = phi((x[i] .- x[j]) ./ scale_factor)
end
end
Expand All @@ -80,7 +80,7 @@ function _construct_rbf_interp_matrix(x, x_el, lb, ub, phi, q, scale_factor, spa
D = zeros(eltype(x_el), n, n)
end
@inbounds for i in 1:n
for j in 1:n
for j in i:n
D[i, j] = phi((x[i] .- x[j]) ./ scale_factor)
end
end
Expand Down
2 changes: 1 addition & 1 deletion test/VariableFidelity.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ my_varfid_change_struct = VariableFidelitySurrogate(x, y, lb, ub, num_high_fidel
n = 10
lb = [0.0, 0.0]
ub = [5.0, 5.0]
x = sample(n, ub, lb, SobolSample())
x = sample(n, lb, ub, SobolSample())
f = x -> x[1] * x[2]
y = f.(x)
my_varfidND = VariableFidelitySurrogate(x, y, lb, ub)
Expand Down
4 changes: 2 additions & 2 deletions test/sampling.jl
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ s = Surrogates.sample(n, lb, ub, LatinHypercubeSample())
@test s isa Vector{Float64} && length(s) == n && all(x -> lb ≤ x ≤ ub, s)

# LowDiscrepancySample
s = Surrogates.sample(20, lb, ub, LowDiscrepancySample(10))
s = Surrogates.sample(20, lb, ub, LowDiscrepancySample(;base=10))
@test s isa Vector{Float64} && length(s) == 20 && all(x -> lb ≤ x ≤ ub, s)

# LatticeRuleSample (not originally in Surrogates.jl, now available through QuasiMonteCarlo.jl)
Expand Down Expand Up @@ -89,7 +89,7 @@ s = Surrogates.sample(n, lb, ub, LatinHypercubeSample())
@test isa(s, Array{Tuple{typeof(s[1][1]), typeof(s[1][1])}, 1}) == true

#LDS
s = Surrogates.sample(n, lb, ub, LowDiscrepancySample([10, 3]))
s = Surrogates.sample(n, lb, ub, LowDiscrepancySample(;base=[10, 3]))
@test isa(s, Array{Tuple{typeof(s[1][1]), typeof(s[1][1])}, 1}) == true

#Distribution 1
Expand Down