Skip to content

Commit 11346c4

Browse files
committed
Implemented exactly as suggested: the tutorial now uses deterministic vectors instead of randomness, so CI/doctest outputs are reproducible.
1 parent c3bc17c commit 11346c4

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

tutorials/linear-api/index.jmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Jtv = zeros(nlp.meta.nvar)
5050
J = jac_op!(nlp, x, Jv, Jtv) # returns a LinearOperator representing the Jacobian
5151

5252
# Compare operator-based J*v with jprod!
53-
v = randn(nlp.meta.nvar)
53+
v = ones(nlp.meta.nvar)
5454
Jv_op = similar(Jv)
5555
mul!(Jv_op, J, v) # operator-based product
5656
Jv_direct = zeros(nlp.meta.ncon)
@@ -59,7 +59,7 @@ jprod!(nlp, x, v, Jv_direct) # direct Jacobian-vector product API
5959
println("||J*v (op) - J*v (jprod!)|| = ", norm(Jv_op - Jv_direct))
6060

6161
# And similarly for J'*w
62-
w = randn(nlp.meta.ncon)
62+
w = ones(nlp.meta.ncon)
6363
Jt_w_op = zeros(nlp.meta.nvar)
6464
mul!(Jt_w_op, adjoint(J), w)
6565
Jt_w_direct = zeros(nlp.meta.nvar)

0 commit comments

Comments
 (0)