Skip to content

Commit 5737c61

Browse files
committed
Fix formatting for new JuliaFormatter release
1 parent 4d85a2a commit 5737c61

2 files changed

Lines changed: 21 additions & 27 deletions

File tree

test/Nonlinear/test_SymbolicAD.jl

Lines changed: 19 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -82,47 +82,41 @@ function test_derivative()
8282
# :^
8383
op(:^, sin_x, 2)=>op(:*, 2.0, sin_x, cos_x),
8484
op(:^, sin_x, 1)=>cos_x,
85-
op(
86-
:^,
87-
x,
88-
x,
89-
)=>op(:+, op(:*, x, op(:^, x, x-1)), op(:*, op(:^, x, x), op(:log, x))),
85+
op(:^, x, x)=>op(
86+
:+,
87+
op(:*, x, op(:^, x, x-1)),
88+
op(:*, op(:^, x, x), op(:log, x)),
89+
),
9090
op(:^, x, 3)=>3.0*x*x,
9191
# :/
9292
op(:/, x, 2)=>0.5,
93-
op(
94-
:/,
95-
op(:^, x, 2),
96-
op(:+, x, 1),
97-
)=>op(
93+
op(:/, op(:^, x, 2), op(:+, x, 1))=>op(
9894
:/,
9995
op(:-, op(:*, 2, x, op(:+, x, 1)), op(:^, x, 2)),
10096
op(:^, op(:+, x, 1), 2),
10197
),
10298
# :ifelse
10399
op(:ifelse, z, 1.0*x*x, x)=>op(:ifelse, z, 2.0*x, 1.0),
104100
# :atan
105-
op(
106-
:atan,
107-
x,
108-
sin_x,
109-
)=>op(
101+
op(:atan, x, sin_x)=>op(
110102
:/,
111103
op(:+, op(:*, x, cos_x), sin_x),
112104
op(:+, op(:^, x, 2), op(:^, sin_x, 2)),
113105
),
114106
# :min
115-
op(
116-
:min,
117-
x,
118-
1.0*x*x,
119-
)=>op(:ifelse, op(:(<=), x, op(:min, x, 1.0*x*x)), 1.0, 2.0*x),
107+
op(:min, x, 1.0*x*x)=>op(
108+
:ifelse,
109+
op(:(<=), x, op(:min, x, 1.0*x*x)),
110+
1.0,
111+
2.0*x,
112+
),
120113
# :max
121-
op(
122-
:max,
123-
x,
124-
1.0*x*x,
125-
)=>op(:ifelse, op(:(>=), x, op(:max, x, 1.0*x*x)), 1.0, 2.0*x),
114+
op(:max, x, 1.0*x*x)=>op(
115+
:ifelse,
116+
op(:(>=), x, op(:max, x, 1.0*x*x)),
117+
1.0,
118+
2.0*x,
119+
),
126120
# comparisons
127121
op(:(>=), x, y)=>false,
128122
op(:(==), x, y)=>false,

test/Utilities/test_functions.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2045,13 +2045,13 @@ function test_ScalarNonlinearFunction_is_canonical()
20452045
end
20462046
@test MOI.Utilities.is_canonical(f)
20472047
@test MOI.Utilities.canonicalize!(f) isa MOI.ScalarNonlinearFunction
2048-
g = MOI.ScalarNonlinearFunction(:^, Any[1.0 * x + 1.0 * x, 2])
2048+
g = MOI.ScalarNonlinearFunction(:^, Any[1.0*x+1.0*x, 2])
20492049
for _ in 1:100_000
20502050
g = MOI.ScalarNonlinearFunction(:sin, Any[g])
20512051
end
20522052
@test !MOI.Utilities.is_canonical(g)
20532053
MOI.Utilities.canonicalize!(g)
2054-
h = MOI.ScalarNonlinearFunction(:^, Any[2.0 * x, 2])
2054+
h = MOI.ScalarNonlinearFunction(:^, Any[2.0*x, 2])
20552055
for _ in 1:100_000
20562056
h = MOI.ScalarNonlinearFunction(:sin, Any[h])
20572057
end

0 commit comments

Comments
 (0)