Skip to content

Commit 609ac95

Browse files
committed
Implement stylistic suggestions by antoine-levitt
1 parent 5256e21 commit 609ac95

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
Manifest.toml
12
benchmarks/graphs/*
23
*~
34
*.kate-swp

src/levenberg_marquardt.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,9 @@ function levenberg_marquardt(
174174
jacobian!(df, x) # has alias J
175175
# Use QR with column pivoting to solve the regularized least squares problem
176176
# argmin 0.5*||J(x)*delta_x + f(x)||^2 + lambda*||diagm(J'*J)*delta_x||^2
177-
Q,R,p = qr(J, Val(true))
177+
Q,R,p = qr(J, ColumnNorm())
178178
rhs = -Matrix(Q)'*value(df)
179-
if isreal(R)
179+
if eltype(J) <: Real
180180
RR = vcat(R, lambda*I)
181181
rhs = vcat(rhs, zeros(T, n))
182182
else
@@ -185,7 +185,7 @@ function levenberg_marquardt(
185185
end
186186
v[p] = (RR\rhs)
187187

188-
if avv! != nothing && isreal(J) # Geodesic acceleration for complex Jacobian
188+
if avv! != nothing && isreal(J) # Geodesic acceleration for complex Jacobian needs to be verified for correctness. It might work as is.
189189
#GEODESIC ACCELERATION PART
190190
avv!(dir_deriv, x, v)
191191
mul!(a, J', dir_deriv)

0 commit comments

Comments
 (0)