Skip to content

Commit 228c04e

Browse files
🤖 Format .jl files (#506)
Co-authored-by: tmigot <tmigot@users.noreply.github.com>
1 parent 3091fb0 commit 228c04e

File tree

3 files changed

+39
-9
lines changed

3 files changed

+39
-9
lines changed

src/nlp/api.jl

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,10 @@ overwriting `vals`.
316316
"""
317317
function jac_lin_coord! end
318318

319-
@deprecate jac_lin_coord!(nlp::AbstractNLPModel, x::AbstractVector, vals::AbstractVector) jac_lin_coord!(nlp, vals)
319+
@deprecate jac_lin_coord!(nlp::AbstractNLPModel, x::AbstractVector, vals::AbstractVector) jac_lin_coord!(
320+
nlp,
321+
vals,
322+
)
320323

321324
"""
322325
vals = jac_lin_coord(nlp)
@@ -451,7 +454,12 @@ Evaluate ``J(x)v``, the linear Jacobian-vector product at `x` in place.
451454
function jprod_lin! end
452455

453456
@deprecate jprod_lin(nlp::AbstractNLPModel, x::AbstractVector, v::AbstractVector) jprod_lin(nlp, v)
454-
@deprecate jprod_lin!(nlp::AbstractNLPModel, x::AbstractVector, v::AbstractVector, Jv::AbstractVector) jprod_lin!(nlp, v, Jv)
457+
@deprecate jprod_lin!(
458+
nlp::AbstractNLPModel,
459+
x::AbstractVector,
460+
v::AbstractVector,
461+
Jv::AbstractVector,
462+
) jprod_lin!(nlp, v, Jv)
455463

456464
"""
457465
Jv = jprod_lin!(nlp, rows, cols, vals, v, Jv)
@@ -592,8 +600,16 @@ Evaluate ``J(x)^Tv``, the linear transposed-Jacobian-vector product at `x` in pl
592600
"""
593601
function jtprod_lin! end
594602

595-
@deprecate jtprod_lin(nlp::AbstractNLPModel, x::AbstractVector, v::AbstractVector) jtprod_lin(nlp, v)
596-
@deprecate jtprod_lin!(nlp::AbstractNLPModel, x::AbstractVector, v::AbstractVector, Jtv::AbstractVector) jtprod_lin!(nlp, v, Jtv)
603+
@deprecate jtprod_lin(nlp::AbstractNLPModel, x::AbstractVector, v::AbstractVector) jtprod_lin(
604+
nlp,
605+
v,
606+
)
607+
@deprecate jtprod_lin!(
608+
nlp::AbstractNLPModel,
609+
x::AbstractVector,
610+
v::AbstractVector,
611+
Jtv::AbstractVector,
612+
) jtprod_lin!(nlp, v, Jtv)
597613

598614
"""
599615
Jtv = jtprod_lin!(nlp, rows, cols, vals, v, Jtv)
@@ -797,7 +813,12 @@ function jac_lin_op!(
797813
return LinearOperator{T}(nlp.meta.nlin, nlp.meta.nvar, false, false, prod!, ctprod!, ctprod!)
798814
end
799815

800-
@deprecate jac_lin_op!(nlp::AbstractNLPModel, x::AbstractVector, Jv::AbstractVector, Jtv::AbstractVector) jac_lin_op!(nlp, Jv, Jtv)
816+
@deprecate jac_lin_op!(
817+
nlp::AbstractNLPModel,
818+
x::AbstractVector,
819+
Jv::AbstractVector,
820+
Jtv::AbstractVector,
821+
) jac_lin_op!(nlp, Jv, Jtv)
801822

802823
"""
803824
J = jac_lin_op!(nlp, rows, cols, vals, Jv, Jtv)

src/nls/api.jl

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ export residual, residual!, jac_residual, jac_structure_residual, jac_structure_
22
export jac_coord_residual!, jac_coord_residual, jprod_residual, jprod_residual!
33
export jtprod_residual, jtprod_residual!, jac_op_residual, jac_op_residual!
44
export hess_residual, hess_structure_residual, hess_structure_residual!
5-
export hess_coord_residual!, hess_coord_residual, jth_hess_residual, jth_hess_residual_coord, jth_hess_residual_coord!
5+
export hess_coord_residual!,
6+
hess_coord_residual, jth_hess_residual, jth_hess_residual_coord, jth_hess_residual_coord!
67
export hprod_residual, hprod_residual!, hess_op_residual, hess_op_residual!
78

89
"""
@@ -337,7 +338,11 @@ end
337338
Evaluate the Hessian of j-th residual at `x` in sparse coordinate format.
338339
Only the lower triangle is returned.
339340
"""
340-
function jth_hess_residual_coord(nls::AbstractNLSModel{T, S}, x::AbstractVector, j::Int) where {T, S}
341+
function jth_hess_residual_coord(
342+
nls::AbstractNLSModel{T, S},
343+
x::AbstractVector,
344+
j::Int,
345+
) where {T, S}
341346
@lencheck nls.meta.nvar x
342347
@rangecheck 1 nls.nls_meta.nequ j
343348
vals = S(undef, nls.nls_meta.nnzh)
@@ -350,7 +355,12 @@ end
350355
Evaluate the Hessian of j-th residual at `x` in sparse coordinate format, with `vals` of
351356
length `nls.nls_meta.nnzh`, in place. Only the lower triangle is returned.
352357
"""
353-
function jth_hess_residual_coord!(nls::AbstractNLSModel{T, S}, x::AbstractVector, j::Int, vals::AbstractVector) where {T, S}
358+
function jth_hess_residual_coord!(
359+
nls::AbstractNLSModel{T, S},
360+
x::AbstractVector,
361+
j::Int,
362+
vals::AbstractVector,
363+
) where {T, S}
354364
@lencheck nls.meta.nvar x
355365
@rangecheck 1 nls.nls_meta.nequ j
356366
@lencheck nls.nls_meta.nnzh vals

test/nlp/simple-model.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,6 @@ function NLPModels.jprod_nln!(
159159
return Jv
160160
end
161161

162-
163162
function NLPModels.jprod_lin!(nlp::SimpleNLPModel, v::AbstractVector, Jv::AbstractVector)
164163
@lencheck 2 v
165164
@lencheck 1 Jv

0 commit comments

Comments
 (0)