{"action":"created","issue":{"url":"https://api.github.com/repos/JuliaNLSolvers/NLsolve.jl/issues/144","repository_url":"https://api.github.com/repos/JuliaNLSolvers/NLsolve.jl","labels_url":"https://api.github.com/repos/JuliaNLSolvers/NLsolve.jl/issues/144/labels{/name}","comments_url":"https://api.github.com/repos/JuliaNLSolvers/NLsolve.jl/issues/144/comments","events_url":"https://api.github.com/repos/JuliaNLSolvers/NLsolve.jl/issues/144/events","html_url":"https://github.com/JuliaNLSolvers/NLsolve.jl/issues/144","id":295983130,"number":144,"title":"Design of a simple fixed point library","user":{"login":"jlperla","id":13106721,"avatar_url":"https://avatars2.githubusercontent.com/u/13106721?v=4","gravatar_id":"","url":"https://api.github.com/users/jlperla","html_url":"https://github.com/jlperla","followers_url":"https://api.github.com/users/jlperla/followers","following_url":"https://api.github.com/users/jlperla/following{/other_user}","gists_url":"https://api.github.com/users/jlperla/gists{/gist_id}","starred_url":"https://api.github.com/users/jlperla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jlperla/subscriptions","organizations_url":"https://api.github.com/users/jlperla/orgs","repos_url":"https://api.github.com/users/jlperla/repos","events_url":"https://api.github.com/users/jlperla/events{/privacy}","received_events_url":"https://api.github.com/users/jlperla/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-02-09T19:21:34Z","updated_at":"2018-02-09T19:22:33Z","closed_at":null,"author_association":"NONE","body":"It might make sense to have it in NLsolve.jl, or it might make sense to have a FixedPoint.jl separately.  Regardless, here is a rough example of the simplest algorithm I was thinking of.  Two versions, one inplace and one outofplace?\r\n```\r\nfunction fixedpoint(f, x0; residualnorm = (x -> norm(x,Inf)), tol = 1E-10, maxiter=100)    \r\n    residual = Inf\r\n    iter = 1\r\n    xold = x0\r\n    while residual > tol && iter < maxiter\r\n        xnew = f(xold)        \r\n        residual = residualnorm(xold - xnew);\r\n        xold = xnew\r\n        iter += 1\r\n    end\r\n    return xold\r\nend\r\n\r\nfunction fixedpoint!(f!, x0; residualnorm = (x -> norm(x,Inf)), tol = 1E-10, maxiter=100)    \r\n    residual = Inf\r\n    iter = 1\r\n    xold = x0\r\n    xnew = copy(x0)\r\n    while residual > tol && iter < maxiter\r\n        f!(xold, xnew)        \r\n        residual = residualnorm(xold - xnew);\r\n        xold = xnew\r\n        iter += 1\r\n    end\r\n    return xold\r\nend\r\n```"},"comment":{"url":"https://api.github.com/repos/JuliaNLSolvers/NLsolve.jl/issues/comments/364534389","html_url":"https://github.com/JuliaNLSolvers/NLsolve.jl/issues/144#issuecomment-364534389","issue_url":"https://api.github.com/repos/JuliaNLSolvers/NLsolve.jl/issues/144","id":364534389,"user":{"login":"jlperla","id":13106721,"avatar_url":"https://avatars2.githubusercontent.com/u/13106721?v=4","gravatar_id":"","url":"https://api.github.com/users/jlperla","html_url":"https://github.com/jlperla","followers_url":"https://api.github.com/users/jlperla/followers","following_url":"https://api.github.com/users/jlperla/following{/other_user}","gists_url":"https://api.github.com/users/jlperla/gists{/gist_id}","starred_url":"https://api.github.com/users/jlperla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jlperla/subscriptions","organizations_url":"https://api.github.com/users/jlperla/orgs","repos_url":"https://api.github.com/users/jlperla/repos","events_url":"https://api.github.com/users/jlperla/events{/privacy}","received_events_url":"https://api.github.com/users/jlperla/received_events","type":"User","site_admin":false},"created_at":"2018-02-09T19:22:33Z","updated_at":"2018-02-09T19:22:33Z","author_association":"NONE","body":"Finally, to ensure that people do not use the inplace version `fixedpoint!` with incompatible types, the initial value for the iteration could use a test like `x0 isa Number || x0 isa StaticArray`"}}
{"actor":{"display_login":"jlperla"}}