Skip to content

Commit

Permalink
Implement stylistic suggestions by antoine-levitt
Browse files Browse the repository at this point in the history
  • Loading branch information
kagalenko-m-b committed Feb 13, 2023
1 parent 5256e21 commit 609ac95
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
Manifest.toml
benchmarks/graphs/*
*~
*.kate-swp
6 changes: 3 additions & 3 deletions src/levenberg_marquardt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,9 @@ function levenberg_marquardt(
jacobian!(df, x) # has alias J
# Use QR with column pivoting to solve the regularized least squares problem
# argmin 0.5*||J(x)*delta_x + f(x)||^2 + lambda*||diagm(J'*J)*delta_x||^2
Q,R,p = qr(J, Val(true))
Q,R,p = qr(J, ColumnNorm())
rhs = -Matrix(Q)'*value(df)
if isreal(R)
if eltype(J) <: Real
RR = vcat(R, lambda*I)
rhs = vcat(rhs, zeros(T, n))
else
Expand All @@ -185,7 +185,7 @@ function levenberg_marquardt(
end
v[p] = (RR\rhs)

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

0 comments on commit 609ac95

Please sign in to comment.