fix zeroing constant comps
This commit is contained in:
parent
32c8806169
commit
ca567122ff
1 changed files with 2 additions and 3 deletions
|
|
@ -28,9 +28,8 @@ true
|
||||||
function check(f, Jf, x, constant_components::Vector{Int}=Int[]; taylortestplot::Bool=false, taylortestdirection=nothing, f_kwargs...)
|
function check(f, Jf, x, constant_components::Vector{Int}=Int[]; taylortestplot::Bool=false, taylortestdirection=nothing, f_kwargs...)
|
||||||
if isnothing(taylortestdirection)
|
if isnothing(taylortestdirection)
|
||||||
direction = 2 * (rand(size(x)...) .- 0.5)
|
direction = 2 * (rand(size(x)...) .- 0.5)
|
||||||
for cst in constant_components
|
|
||||||
direction[cst] = 0
|
direction[constant_components] .= 0
|
||||||
end
|
|
||||||
|
|
||||||
if direction isa Array
|
if direction isa Array
|
||||||
direction ./= norm(direction)
|
direction ./= norm(direction)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue