Manual NLSModel - #37
Conversation
|
Needs more unit tests. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
| # jth_hess_residual_coord, | ||
| hprod_residual, | ||
| hess_op_residual, | ||
| ] |
There was a problem hiding this comment.
Did you try adding the "Check consistency" in a similar way as for nlps?
I guess because this doesn't have the constraints you would have to exclude almost all the functions... So, maybe we should create an issue as a possible follow-up of this PR.
There was a problem hiding this comment.
I don’t understand that test; it seems to be comparing a model to itself.
There was a problem hiding this comment.
Pull Request Overview
This PR introduces manual NLS (Nonlinear Least Squares) model functionality to complement the existing NLP model capabilities. The implementation provides a way to define NLS problems manually by specifying residual functions and their derivatives.
Key changes:
- Adds
NLSModelstruct and constructor for creating least squares optimization problems - Implements NLS-specific API functions for residual evaluation and Jacobian operations
- Includes comprehensive test problems (MGH01 and MGH04) demonstrating the new functionality
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/structure.jl | Exports NLSModel and defines the main NLSModel struct with constructor |
| src/nls_api.jl | Implements NLS-specific API functions for residual and Jacobian operations |
| src/ManualNLPModels.jl | Includes the new NLS API module in the package |
| test/problems/mgh01.jl | Adds MGH01 test problem implementation with Rosenbrock-like residuals |
| test/problems/mgh04.jl | Adds MGH04 test problem implementation with exponential residuals |
| test/nlpmodelstest.jl | Integrates NLS problems into the test suite with precision and dimension checks |
| test/notimplemented.jl | Adds tests verifying proper error handling for unimplemented NLS methods |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
No description provided.