Skip to content

Commit 04c8ad1

Browse files
authored
Update trig.jl
1 parent efc78ab commit 04c8ad1

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/ADNLPProblems/trig.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,21 @@ function trig(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where
66
s = zero(T)
77
for i = 1:n_local
88
xi = x[i]
9-
term = T(i) * (one(T) - cos(xi))
9+
term = i * (1 - cos(xi))
1010

1111
jlo = max(1, i - 2)
1212
jhi = min(n_local, i + 2)
1313
for j = jlo:jhi
14-
aij = 5 * (1 + (mod(i, 5)) + (mod(j, 5)))
15-
bij = (i + j) // 10
14+
aij = 5 * (1 + mod(i, 5) + mod(j, 5))
15+
bij = (i + j) / 10
1616
term += aij * sin(x[j]) + bij * cos(x[j])
1717
end
1818

1919
if iseven(n_local)
2020
j = i + (n_local ÷ 2)
2121
if 1 <= j <= n_local
22-
aij = 5 * (1 + (mod(i, 5)) + (mod(j, 5)))
23-
bij = (i + j) // 10
22+
aij = 5 * (1 + mod(i, 5) + mod(j, 5))
23+
bij = (i + j) / 10
2424
term += aij * sin(x[j]) + bij * cos(x[j])
2525
end
2626
end

0 commit comments

Comments
 (0)