Skip to content

Commit be542e9

Browse files
committed
format
1 parent 6ccbb98 commit be542e9

File tree

2 files changed

+27
-27
lines changed

2 files changed

+27
-27
lines changed

src/QuestBase.jl

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -45,31 +45,4 @@ include("HarmonicVariable.jl")
4545
include("HarmonicEquation.jl")
4646
include("abstracttypes.jl")
4747

48-
macro eqtest(expr)
49-
@assert expr.head == :call && expr.args[1] in [:(==), :(!=)]
50-
return esc(
51-
if expr.args[1] == :(==)
52-
:(@test isequal($(expr.args[2]), $(expr.args[3])))
53-
else
54-
:(@test !isequal($(expr.args[2]), $(expr.args[3])))
55-
end,
56-
)
57-
end
58-
59-
macro eqsym(expr)
60-
@assert expr.head == :call && expr.args[1] in [:(==), :(!=)]
61-
return esc(
62-
if expr.args[1] == :(==)
63-
:(isequal($(expr.args[2]), $(expr.args[3])))
64-
else
65-
:(!isequal($(expr.args[2]), $(expr.args[3])))
66-
end,
67-
)
68-
end
69-
70-
is_identity(A::Matrix{Num}) = (@eqsym A == Matrix{Num}(LinearAlgebra.I, size(A)...))
71-
hasnan(x::Matrix{Num}) = any(my_isnan, unwrap.(x))
72-
my_isnan(x) = isnan(x)
73-
my_isnan(x::BasicSymbolic) = false
74-
7548
end

src/utils.jl

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,30 @@ function get_Jacobian(eqs::Vector{Equation}, vars::Vector{Num})::Matrix{Num}
2727
expr = Num[getfield(eq, :lhs) - getfield(eq, :rhs) for eq in eqs]
2828
return get_Jacobian(expr, vars)
2929
end
30+
31+
macro eqtest(expr)
32+
@assert expr.head == :call && expr.args[1] in [:(==), :(!=)]
33+
return esc(
34+
if expr.args[1] == :(==)
35+
:(@test isequal($(expr.args[2]), $(expr.args[3])))
36+
else
37+
:(@test !isequal($(expr.args[2]), $(expr.args[3])))
38+
end,
39+
)
40+
end
41+
42+
macro eqsym(expr)
43+
@assert expr.head == :call && expr.args[1] in [:(==), :(!=)]
44+
return esc(
45+
if expr.args[1] == :(==)
46+
:(isequal($(expr.args[2]), $(expr.args[3])))
47+
else
48+
:(!isequal($(expr.args[2]), $(expr.args[3])))
49+
end,
50+
)
51+
end
52+
53+
is_identity(A::Matrix{Num}) = (@eqsym A == Matrix{Num}(LinearAlgebra.I, size(A)...))
54+
hasnan(x::Matrix{Num}) = any(my_isnan, unwrap.(x))
55+
my_isnan(x) = isnan(x)
56+
my_isnan(x::BasicSymbolic) = false

0 commit comments

Comments
 (0)