Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation Incorrect #1082

Closed
tb6g16 opened this issue Feb 27, 2024 · 2 comments
Closed

Documentation Incorrect #1082

tb6g16 opened this issue Feb 27, 2024 · 2 comments

Comments

@tb6g16
Copy link

tb6g16 commented Feb 27, 2024

I've noticed that in the explanation in the docs of the Nelder-Mead solver contains a couple of bugs, specifically the snippet of code to construct the initial simplexer for a Matlab like simplex:

function Optim.simplexer(A::MatlabSimplexer, initial_x::AbstractArray{T, N}) where {T, N}
    n = length(initial_x)
    initial_simplex = Array{T, N}[initial_x for i = 1:n+1]
    for j = 1:n
        initial_simplex[j+1][j] += initial_simplex[j+1][j] == zero(T) ? S.b * initial_simplex[j+1][j] : S.a
    end
    initial_simplex
end

I was going to submit a small pull request to fix this before I noticed that the fixes had already been implemented:

function Optim.simplexer(S::MatlabSimplexer, initial_x::AbstractArray{T, N}) where {T, N}
n = length(initial_x)
initial_simplex = Array{T, N}[copy(initial_x) for i = 1:n+1]
for j = 1:n
initial_simplex[j+1][j] += initial_simplex[j+1][j] != zero(T) ? S.b * initial_simplex[j+1][j] : S.a
end
initial_simplex
end

Presumably the docs using this example should be updated to the correct version.

@tb6g16 tb6g16 changed the title Github Pages Documentation Incorrect Documentation Incorrect Mar 4, 2024
@pkofod
Copy link
Member

pkofod commented Mar 23, 2024

It seems like the docs are not running for some reason.. Thanks for noticing.

@pkofod
Copy link
Member

pkofod commented Mar 23, 2024

Thanks to @asinghvi17 it is now correctly updated :)

@pkofod pkofod closed this as completed Mar 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants