- 
                Notifications
    
You must be signed in to change notification settings  - Fork 49
 
Add problems 5-13 except 9,10 #375
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
          
     Merged
      
      
            tmigot
  merged 110 commits into
  JuliaSmoothOptimizers:main
from
arnavk23:luksan/add-problems-5-12
  
      
      
   
  Oct 31, 2025 
      
    
  
     Merged
                    Changes from 14 commits
      Commits
    
    
            Show all changes
          
          
            110 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      7d950c5
              
                Add Problems 5-12 (genbroyden, genbroydenb, placeholders for 7-12) an…
              
              
                arnavk23 0243327
              
                Renaming variables to be consistent across all problems
              
              
                arnavk23 68460ee
              
                Add PureJuMP counterparts for Problems 5-12 (genbroyden, genbroydenb,…
              
              
                arnavk23 ccc6b20
              
                JuMP
              
              
                arnavk23 a70e7f5
              
                Relax test: use intersection of problems in ADNLPProblems and PureJuM…
              
              
                arnavk23 c893535
              
                comments
              
              
                arnavk23 7c5f406
              
                Add convenience wrapper auglag() to ADNLPProblems.auglag
              
              
                arnavk23 9c5c090
              
                Add ADNLS variant for auglag and update auglag metadata nls count
              
              
                arnavk23 7163faa
              
                browngen
              
              
                arnavk23 1fc23d9
              
                changes
              
              
                arnavk23 31e74f3
              
                browngen
              
              
                arnavk23 c2ce1ba
              
                fixing checksum issues
              
              
                arnavk23 9661813
              
                toint
              
              
                arnavk23 9e1d4f0
              
                toint
              
              
                arnavk23 9c79bd9
              
                Delete src/ADNLPProblems/toint.jl
              
              
                arnavk23 1c169ec
              
                Update test_utils.jl
              
              
                arnavk23 56dc762
              
                Delete src/ADNLPProblems/trig.jl
              
              
                arnavk23 76f9e9b
              
                Removing trig and toint
              
              
                arnavk23 fa11e18
              
                Update src/ADNLPProblems/cragglvy2.jl
              
              
                arnavk23 82e2fe6
              
                Update src/ADNLPProblems/auglag.jl
              
              
                arnavk23 ce63619
              
                Update src/ADNLPProblems/auglag.jl
              
              
                arnavk23 aafedce
              
                changes proposed by @tmigot
              
              
                arnavk23 3526af4
              
                pdf changes
              
              
                arnavk23 7d06b5e
              
                Merge branch 'main' into luksan/add-problems-5-12
              
              
                arnavk23 bccf9ff
              
                Implementation of Augmented Lagrangian problem in PureJuMP without ex…
              
              
                arnavk23 11e9015
              
                fixing issues in auglag problem definitions
              
              
                arnavk23 734a28e
              
                Update src/PureJuMP/auglag.jl
              
              
                arnavk23 f8a84f3
              
                Update src/PureJuMP/auglag.jl
              
              
                arnavk23 9ee9737
              
                Update src/PureJuMP/auglag.jl
              
              
                arnavk23 0a4bca7
              
                Update src/PureJuMP/auglag.jl
              
              
                arnavk23 a3cdf38
              
                Update src/PureJuMP/auglag.jl
              
              
                arnavk23 7fce265
              
                Update src/ADNLPProblems/auglag.jl
              
              
                arnavk23 930f079
              
                Update src/ADNLPProblems/auglag.jl
              
              
                arnavk23 8079928
              
                auglag multiply by 10
              
              
                arnavk23 e63ab1e
              
                auglag documentation
              
              
                arnavk23 b4840da
              
                Brown generalized function
              
              
                arnavk23 e0b70d4
              
                Update src/PureJuMP/auglag.jl
              
              
                arnavk23 bbc687e
              
                Update src/ADNLPProblems/browngen.jl
              
              
                arnavk23 ccd1d04
              
                Update src/PureJuMP/auglag.jl
              
              
                arnavk23 fdd1503
              
                Update src/ADNLPProblems/browngen.jl
              
              
                arnavk23 9c57ccd
              
                Update src/ADNLPProblems/broyden7d.jl
              
              
                arnavk23 32afb3c
              
                Update src/Meta/genrose.jl
              
              
                arnavk23 2af4718
              
                Update src/Meta/chainwoo.jl
              
              
                arnavk23 f68e258
              
                Update src/Meta/cragglvy2.jl
              
              
                arnavk23 76c8462
              
                Update src/Meta/browngen.jl
              
              
                arnavk23 1024b3e
              
                Update src/ADNLPProblems/broyden7d.jl
              
              
                arnavk23 945f075
              
                Update src/Meta/broyden7d.jl
              
              
                arnavk23 a14f598
              
                Update src/PureJuMP/broyden7d.jl
              
              
                arnavk23 aad39a9
              
                Update src/ADNLPProblems/cragglvy2.jl
              
              
                arnavk23 5139449
              
                Update src/ADNLPProblems/cragglvy2.jl
              
              
                arnavk23 173a8e4
              
                Update src/ADNLPProblems/cragglvy2.jl
              
              
                arnavk23 7257220
              
                Update src/ADNLPProblems/genbroyden.jl
              
              
                arnavk23 9a2f7eb
              
                Update src/ADNLPProblems/genrose.jl
              
              
                arnavk23 0bd40a8
              
                Update src/ADNLPProblems/genrose.jl
              
              
                arnavk23 405ffe7
              
                Update src/ADNLPProblems/nazareth.jl
              
              
                arnavk23 275c7b6
              
                Update src/ADNLPProblems/nazareth.jl
              
              
                arnavk23 09064a6
              
                Update src/ADNLPProblems/nazareth.jl
              
              
                arnavk23 5d3e551
              
                fixing errors and adding documentation
              
              
                arnavk23 cce8815
              
                Implementation of Problem 13
              
              
                arnavk23 9671fc9
              
                Update src/PureJuMP/auglag.jl
              
              
                arnavk23 2436b24
              
                Update src/PureJuMP/browngen2.jl
              
              
                arnavk23 046ef5a
              
                Update src/PureJuMP/browngen1.jl
              
              
                arnavk23 4629ee7
              
                Update src/PureJuMP/browngen2.jl
              
              
                arnavk23 a4a1d3c
              
                Update src/Meta/browngen2.jl
              
              
                arnavk23 52b88a5
              
                Update src/ADNLPProblems/browngen2.jl
              
              
                arnavk23 3ab4917
              
                Update src/ADNLPProblems/broyden7d.jl
              
              
                arnavk23 4ad0719
              
                Update src/ADNLPProblems/broyden7d.jl
              
              
                arnavk23 14b6acf
              
                Update src/PureJuMP/browngen1.jl
              
              
                arnavk23 e6b5aea
              
                Update src/PureJuMP/browngen1.jl
              
              
                arnavk23 9f159b2
              
                changes
              
              
                arnavk23 8438c54
              
                Added neighbors = [Int[] for _ in 1:n].
              
              
                arnavk23 98f7cfc
              
                Update src/PureJuMP/browngen1.jl
              
              
                arnavk23 99d9e8a
              
                Update src/ADNLPProblems/broyden7d.jl
              
              
                arnavk23 d5ae2c9
              
                Update src/Meta/chainwoo.jl
              
              
                arnavk23 ef363fd
              
                Update src/ADNLPProblems/genbroydenb.jl
              
              
                arnavk23 b301427
              
                Update src/ADNLPProblems/nazareth.jl
              
              
                arnavk23 c695b37
              
                Update src/ADNLPProblems/genbroydenb.jl
              
              
                arnavk23 9aab84b
              
                Update src/ADNLPProblems/genbroydenb.jl
              
              
                arnavk23 db62cf5
              
                Update src/ADNLPProblems/genbroydentri.jl
              
              
                arnavk23 1d89d83
              
                Update src/Meta/genrose.jl
              
              
                arnavk23 3dec1df
              
                Update src/PureJuMP/nazareth.jl
              
              
                arnavk23 59a36a0
              
                Update src/ADNLPProblems/powellsg.jl
              
              
                arnavk23 7e2f98d
              
                Update src/ADNLPProblems/powellsg.jl
              
              
                arnavk23 5996d0d
              
                Update src/ADNLPProblems/powellsg.jl
              
              
                arnavk23 eff9b55
              
                Update src/ADNLPProblems/powellsg.jl
              
              
                arnavk23 8492676
              
                Update src/ADNLPProblems/nazareth.jl
              
              
                arnavk23 03cd941
              
                Update src/ADNLPProblems/nazareth.jl
              
              
                arnavk23 ddfdca0
              
                Update src/ADNLPProblems/nazareth.jl
              
              
                arnavk23 2f697ee
              
                Update src/ADNLPProblems/nazareth.jl
              
              
                arnavk23 d9a82af
              
                Update src/ADNLPProblems/nazareth.jl
              
              
                arnavk23 b987ab1
              
                Update src/ADNLPProblems/nazareth.jl
              
              
                arnavk23 e2a953f
              
                changes
              
              
                arnavk23 2078516
              
                Update src/ADNLPProblems/genbroydenb.jl
              
              
                arnavk23 14759d0
              
                Update src/ADNLPProblems/genbroydenb.jl
              
              
                arnavk23 e2b9dbd
              
                Update src/ADNLPProblems/genbroydenb.jl
              
              
                arnavk23 dcc91dc
              
                Update src/ADNLPProblems/genbroydenb.jl
              
              
                arnavk23 60f7615
              
                Update src/ADNLPProblems/genrose.jl
              
              
                arnavk23 9b82d82
              
                Update src/ADNLPProblems/genrose.jl
              
              
                arnavk23 09e1ac7
              
                Update src/ADNLPProblems/chainwoo.jl
              
              
                arnavk23 ed2fdd8
              
                chainwoo: simplify residual calculations
              
              
                arnavk23 0f7a50e
              
                Update src/ADNLPProblems/chainwoo.jl
              
              
                arnavk23 c305223
              
                Update src/ADNLPProblems/chainwoo.jl
              
              
                arnavk23 c54dcca
              
                Update src/ADNLPProblems/chainwoo.jl
              
              
                arnavk23 49f682e
              
                chainwoo
              
              
                arnavk23 dc2916d
              
                Update src/Meta/chainwoo.jl
              
              
                arnavk23 d1c06f9
              
                easier implementation of the algorithm.
              
              
                arnavk23 4c5115f
              
                genbroydenb and running JuliaFormatter
              
              
                arnavk23 ae0a0eb
              
                fixing x0 in genbroydenb problem
              
              
                arnavk23 ad66a20
              
                vector adaptation for large-scale unconstrained optimization problems.
              
              
                arnavk23 0216f26
              
                Apply suggestions from code review
              
              
                tmigot File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
          Some comments aren't visible on the classic Files Changed page.
        
There are no files selected for viewing
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| export auglag | ||
| 
     | 
||
| function auglag(; use_nls::Bool = false, kwargs...) | ||
| model = use_nls ? :nls : :nlp | ||
| return auglag(Val(model); kwargs...) | ||
| end | ||
| 
     | 
||
| function auglag(::Val{:nls}; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} | ||
| function F!(r, x; n = length(x)) | ||
| # simple residual for placeholder: r = x - 1 | ||
| for i in 1:n | ||
| r[i] = x[i] - one(T) | ||
                
      
                  arnavk23 marked this conversation as resolved.
               
              
                Outdated
          
            Show resolved
            Hide resolved
         | 
||
| end | ||
| return r | ||
| end | ||
| x0 = zeros(T, n) | ||
| return ADNLPModels.ADNLSModel!(F!, x0, n, name = "auglag-nls"; kwargs...) | ||
| end | ||
| 
     | 
||
| function auglag(::Val{:nlp}; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} | ||
| function f(x; n = length(x)) | ||
| # Placeholder augmented Lagrangian style objective | ||
                
      
                  arnavk23 marked this conversation as resolved.
               
              
                Outdated
          
            Show resolved
            Hide resolved
         | 
||
| return sum((x[i] - 1)^2 for i = 1:n) | ||
| end | ||
| x0 = zeros(T, n) | ||
| return ADNLPModels.ADNLPModel(f, x0, name = "auglag"; kwargs...) | ||
| end | ||
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| export browngen | ||
                
      
                  arnavk23 marked this conversation as resolved.
               
              
                Outdated
          
            Show resolved
            Hide resolved
         | 
||
| function browngen(; use_nls::Bool = false, kwargs...) | ||
| model = use_nls ? :nls : :nlp | ||
| return browngen(Val(model); kwargs...) | ||
| end | ||
| 
     | 
||
| function browngen(::Val{:nlp}; n::Int = default_nvar, type::Type = Float64, kwargs...) | ||
| T = type | ||
                
      
                  arnavk23 marked this conversation as resolved.
               
              
                Outdated
          
            Show resolved
            Hide resolved
         | 
||
| function f(x; n = length(x)) | ||
| # Placeholder for generalized Brown function (precision-safe) | ||
                
      
                  arnavk23 marked this conversation as resolved.
               
              
                Outdated
          
            Show resolved
            Hide resolved
         | 
||
| s = zero(T) | ||
| for i in 1:n | ||
| t = x[i] - T(0.5) | ||
                
      
                  arnavk23 marked this conversation as resolved.
               
              
                Outdated
          
            Show resolved
            Hide resolved
         | 
||
| s += t * t | ||
| end | ||
| return s | ||
| end | ||
| x0 = ones(T, n) .* T(0.5) | ||
| return ADNLPModels.ADNLPModel(f, x0, name = "browngen"; kwargs...) | ||
| end | ||
| 
     | 
||
| function browngen(::Val{:nls}; n::Int = default_nvar, type::Type = Float64, kwargs...) | ||
| T = type | ||
| h = T(0.5) | ||
| function F!(r, x) | ||
| @inbounds begin | ||
| rr = r | ||
| xx = x | ||
| for i in 1:n | ||
| rr[i] = xx[i] - h | ||
| end | ||
| end | ||
| return r | ||
| end | ||
| x0 = ones(T, n) .* T(0.5) | ||
| return ADNLPModels.ADNLSModel!(F!, x0, n, name = "browngen-nls"; kwargs...) | ||
| end | ||
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| export broyden7d | ||
| 
     | 
||
| function broyden7d(; use_nls::Bool = false, kwargs...) | ||
| model = use_nls ? :nls : :nlp | ||
| return broyden7d(Val(model); kwargs...) | ||
| end | ||
| 
     | 
||
| function broyden7d(::Val{:nlp}; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} | ||
| function f(x; n = length(x)) | ||
                
      
                  arnavk23 marked this conversation as resolved.
               
              
                Outdated
          
            Show resolved
            Hide resolved
         | 
||
| s = zero(T) | ||
| @inbounds for i = 1:n | ||
| s += x[i]^2 | ||
| end | ||
| return T(0.5) * s | ||
| end | ||
| x0 = -ones(T, n) | ||
| return ADNLPModels.ADNLPModel(f, x0, name = "broyden7d"; kwargs...) | ||
| end | ||
| 
     | 
||
| function broyden7d(::Val{:nls}; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} | ||
| # Provide an in-place residual F! for least-squares-style testing. | ||
| function F!(r, x; n = length(x)) | ||
| @inbounds for i = 1:n | ||
| r[i] = x[i] | ||
| end | ||
| return r | ||
| end | ||
| x0 = -ones(T, n) | ||
| return ADNLPModels.ADNLSModel!(F!, x0, n, name = "broyden7d-nls"; kwargs...) | ||
| end | ||
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| export genbroyden | ||
                
      
                  arnavk23 marked this conversation as resolved.
               
              
                Outdated
          
            Show resolved
            Hide resolved
         | 
||
| 
     | 
||
| """ | ||
| Generalized Broyden tridiagonal problem (variable dimension). | ||
| 
     | 
||
| This implementation follows the style of `broyden3d` but exposes a | ||
| parameter `alpha` to generalize the diagonal nonlinearity. It's provided | ||
| as both an ADNLPModel (objective) and an ADNLSModel (residual form). | ||
| """ | ||
| function genbroyden(; use_nls::Bool = false, kwargs...) | ||
| model = use_nls ? :nls : :nlp | ||
| return genbroyden(Val(model); kwargs...) | ||
| end | ||
| 
     | 
||
| function genbroyden(::Val{:nlp}; n::Int = default_nvar, type::Type{T} = Float64, alpha::Real = 2.0, kwargs...) where {T} | ||
| a = T(alpha) | ||
| function f(x; n = length(x)) | ||
| # Generalized form similar to Broyden tridiagonal: r_i = (3 - a*x_i)*x_i - x_{i-1} - 2*x_{i+1} + 1 | ||
| # Objective is 1/2 * sum r_i^2 | ||
| return T(0.5) * ( | ||
| ((3 - a * x[1]) * x[1] - 2 * x[2] + 1)^2 + | ||
| sum(((3 - a * x[i]) * x[i] - x[i - 1] - 2 * x[i + 1] + 1)^2 for i = 2:(n - 1)) + | ||
| ((3 - a * x[n]) * x[n] - x[n - 1] + 1)^2 | ||
| ) | ||
| end | ||
| x0 = -ones(T, n) | ||
| return ADNLPModels.ADNLPModel(f, x0, name = "genbroyden"; kwargs...) | ||
| end | ||
| 
     | 
||
| function genbroyden(::Val{:nls}; n::Int = default_nvar, type::Type{T} = Float64, alpha::Real = 2.0, kwargs...) where {T} | ||
| a = T(alpha) | ||
| function F!(r, x; n = length(x)) | ||
| r[1] = (3 - a * x[1]) * x[1] - 2 * x[2] + 1 | ||
| r[n] = (3 - a * x[n]) * x[n] - x[n - 1] + 1 | ||
| for i = 2:(n - 1) | ||
| r[i] = (3 - a * x[i]) * x[i] - x[i - 1] - 2 * x[i + 1] + 1 | ||
| end | ||
| return r | ||
| end | ||
| x0 = -ones(T, n) | ||
| return ADNLPModels.ADNLSModel!(F!, x0, n, name = "genbroyden-nls"; kwargs...) | ||
| end | ||
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| export genbroydenb | ||
| 
     | 
||
| function genbroydenb(; use_nls::Bool = false, kwargs...) | ||
                
      
                  arnavk23 marked this conversation as resolved.
               
          
            Show resolved
            Hide resolved
         | 
||
| model = use_nls ? :nls : :nlp | ||
| return genbroydenb(Val(model); kwargs...) | ||
| end | ||
| 
     | 
||
| function genbroydenb(::Val{:nlp}; n::Int = default_nvar, type::Type{T} = Float64, ml::Int = 5, mu::Int = 1, beta::Real = 5.0, kwargs...) where {T} | ||
| b = T(beta) | ||
| function f(x; n = length(x)) | ||
| s = zero(T) | ||
| for i = 1:n | ||
| diag = x[i] * (T(2) + b * x[i]^2) + one(T) | ||
| neigh = zero(T) | ||
| for j = max(1, i - ml):min(n, i + mu) | ||
| if j != i | ||
| neigh += x[j] * (one(T) + x[j]) | ||
                
      
                  arnavk23 marked this conversation as resolved.
               
              
                Outdated
          
            Show resolved
            Hide resolved
         | 
||
| end | ||
| end | ||
| s += (diag - neigh)^2 | ||
| end | ||
| return T(0.5) * s | ||
| end | ||
| x0 = -ones(T, n) | ||
| return ADNLPModels.ADNLPModel(f, x0, name = "genbroydenb"; kwargs...) | ||
| end | ||
| 
     | 
||
| function genbroydenb(::Val{:nls}; n::Int = default_nvar, type::Type{T} = Float64, ml::Int = 5, mu::Int = 1, beta::Real = 5.0, kwargs...) where {T} | ||
| b = T(beta) | ||
| function F!(r, x; n = length(x)) | ||
| for i = 1:n | ||
| diag = x[i] * (T(2) + b * x[i]^2) + one(T) | ||
| neigh = zero(T) | ||
| for j = max(1, i - ml):min(n, i + mu) | ||
| if j != i | ||
| neigh += x[j] * (one(T) + x[j]) | ||
                
      
                  arnavk23 marked this conversation as resolved.
               
              
                Outdated
          
            Show resolved
            Hide resolved
         | 
||
| end | ||
| end | ||
| r[i] = diag - neigh | ||
| end | ||
| return r | ||
| end | ||
| x0 = -ones(T, n) | ||
| return ADNLPModels.ADNLSModel!(F!, x0, n, name = "genbroydenb-nls"; kwargs...) | ||
| end | ||
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| export nazareth | ||
| 
     | 
||
| function nazareth(; use_nls::Bool = false, kwargs...) | ||
| model = use_nls ? :nls : :nlp | ||
| return nazareth(Val(model); kwargs...) | ||
| end | ||
| 
     | 
||
| function nazareth(::Val{:nlp}; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} | ||
| function f(x; n = length(x)) | ||
| s = zero(T) | ||
| @inbounds for i = 1:n | ||
| t = sin(x[i]) - T(0.1) | ||
| s += t * t | ||
| end | ||
| return s | ||
| end | ||
| x0 = zeros(T, n) | ||
| return ADNLPModels.ADNLPModel(f, x0, name = "nazareth", minimize = true; kwargs...) | ||
| end | ||
| 
     | 
||
| function nazareth(::Val{:nls}; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} | ||
| function F!(r, x; n = length(x)) | ||
| @inbounds for i = 1:n | ||
| r[i] = sin(x[i]) - T(0.1) | ||
| end | ||
                
      
                  arnavk23 marked this conversation as resolved.
               
          
            Show resolved
            Hide resolved
         | 
||
| return r | ||
| end | ||
| x0 = zeros(T, n) | ||
| return ADNLPModels.ADNLSModel!(F!, x0, n, name = "nazareth"; kwargs...) | ||
| end | ||
| 
     | 
||
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| export toint | ||
| 
     | 
||
| function toint(; n::Int = default_nvar, kwargs...) | ||
| return toint(Val(:nlp); n = n, kwargs...) | ||
| end | ||
| 
     | 
||
| function toint(::Val{:nlp}; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} | ||
| function f(x; n = length(x)) | ||
| return sum((cos(x[i]) - x[i]^2)^2 for i ∈ 1:n) | ||
| end | ||
| x0 = zeros(T, n) | ||
| return ADNLPModels.ADNLPModel(f, x0, name = "toint", minimize = true, kwargs...) | ||
| end | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| export trig | ||
| 
     | 
||
| function trig(::Val{:nlp}; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} | ||
| function f(x; n = length(x)) | ||
| return sum((sin(x[i]) + 0.5 * x[i])^2 for i = 1:n) | ||
| end | ||
| x0 = zeros(T, n) | ||
| return ADNLPModels.ADNLPModel(f, x0, name = "trig"; kwargs...) | ||
| end | 
      
      Oops, something went wrong.
        
    
  
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
Uh oh!
There was an error while loading. Please reload this page.