Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
matthieugomez committed Oct 2, 2020
1 parent e0a5f2a commit c1d899b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "LeastSquaresOptim"
uuid = "0fc2ff8b-aaa3-5acd-a817-1944a5e08891"
version = "0.7.6"
version = "0.8"

[deps]
FiniteDiff = "6a86dc24-6348-571c-b903-95158fe2bd41"
Expand Down
18 changes: 5 additions & 13 deletions src/types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,14 @@ struct LeastSquaresProblem{Tx, Ty, Tf, TJ, Tg}
end


function LeastSquaresProblem(x::Tx, y::Ty, f!::Tf, J::TJ, g!::Tg) where {Tx, Ty, Tf, TJ, Tg}
LeastSquaresProblem{Tx, Ty, Tf, TJ, Tg}(x, y, f!, J, g!)
end


function LeastSquaresProblem(;x = error("initial x required"), y = nothing, f! = error("initial f! required"), g! = nothing, J = nothing, output_length = 0, autodiff = :central)
if typeof(y) == Nothing
if output_length == 0
output_length = size(J, 2)
if typeof(J) == Nothing
error("specify J or output_length")
else
output_length = size(J, 2)
end
end
y = zeros(eltype(x), output_length)
end
Expand Down Expand Up @@ -148,12 +147,6 @@ function optimize!(nls::LeastSquaresProblem, optimizer::Union{Nothing, AbstractO
end


Base.@deprecate optimize!(nls::LeastSquaresProblem, optimizer::AbstractOptimizer, solver::Union{Nothing, AbstractSolver}; kwargs...) optimize!(nls, typeof{optimizer}(solver); kwargs...)
Base.@deprecate optimize!(nls::LeastSquaresProblem, solver::AbstractSolver; kwargs...) optimize!(nls, Dogleg{solver}; kwargs...)
Base.@deprecate LeastSquaresProblemAllocated(nls::LeastSquaresProblem, optimizer::AbstractOptimizer, solver::AbstractSolver) LeastSquaresProblemAllocated(nls, default_optimizer(optimizer, solver))





###############################################################################
Expand Down Expand Up @@ -204,4 +197,3 @@ function Base.show(io::IO, r::LeastSquaresResult)
@printf io " * Multiplication Calls: %d\n" r.mul_calls
return
end

1 change: 1 addition & 0 deletions src/utils/lsmr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ function lsmr!(x, A, b, v, h, hbar;
α = norm(v)
α > 0 && rmul!(v, inv(α))


# Initialize variables for 1st iteration.
ζbar = α * β
αbar = α
Expand Down

2 comments on commit c1d899b

@matthieugomez
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register()

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/22328

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.8.0 -m "<description of version>" c1d899b887aea621dc09a46e91cb4b14fc07522c
git push origin v0.8.0

Please sign in to comment.