MadNLP / DynamicNLPModels.jl

NLPModels for dynamic optimization
MIT License
11 stars 1 forks source link

Added support for Jacobian Linear Operator #34

Closed dlcole3 closed 2 years ago

dlcole3 commented 2 years ago

Added a mutable struct LQJacobianOperator <: AbstractLinearOperator that contains the data needed for finding $Jx$, $J^Tx$, and $J^T \Sigma J$ from the first nu columns of the Jacobian. Added an argument truncate to DenseLQDynamicModel that calls a different function (_build_truncated_dense_lq_dynamic_model). This new function returns the DenseLQDynamicModel with the QPData containing the LQJacobianOperator as the Jacobian rather than a matrix. I also exteded mul!() to work with the LQJacobianOperator to calculate $Jx$ and $J^Tx$. I also added tests to runtests.jl to test this new operator, and I added LinearOperators.jl to the dependencies.

This PR does not include the functions to calculate $J^T \Sigma J$. I will do that on a separate PR. I first wanted to get feedback on the current operator.

codecov-commenter commented 2 years ago

Codecov Report

Merging #34 (239a950) into main (8509cfe) will increase coverage by 0.07%. The diff coverage is 98.31%.

@@            Coverage Diff             @@
##             main      #34      +/-   ##
==========================================
+ Coverage   97.97%   98.04%   +0.07%     
==========================================
  Files           1        1              
  Lines         790     1025     +235     
==========================================
+ Hits          774     1005     +231     
- Misses         16       20       +4     
Impacted Files Coverage Δ
src/DynamicNLPModels.jl 98.04% <98.31%> (+0.07%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 8509cfe...239a950. Read the comment docs.