Skip to content

Allow DualVector(::DualVector) for 2nd Order Methods#21

Open
max-vassili3v wants to merge 2 commits into
JuliaArrays:mainfrom
max-vassili3v:dual-inside-dual
Open

Allow DualVector(::DualVector) for 2nd Order Methods#21
max-vassili3v wants to merge 2 commits into
JuliaArrays:mainfrom
max-vassili3v:dual-inside-dual

Conversation

@max-vassili3v
Copy link
Copy Markdown
Collaborator

This PR makes changes to type definitions to allow 'DualVectors inside DualVectors' (and similarly Dual inside Dual), paving the way for implementations of 2nd order methods. Changes are covered with unit tests

@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 5, 2026

Codecov Report

❌ Patch coverage is 60.86957% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 69.74%. Comparing base (5761344) to head (ef6cb94).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/utilities.jl 0.00% 6 Missing ⚠️
src/types.jl 66.66% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #21      +/-   ##
==========================================
- Coverage   70.87%   69.74%   -1.13%     
==========================================
  Files           5        5              
  Lines         103      119      +16     
==========================================
+ Hits           73       83      +10     
- Misses         30       36       +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread src/types.jl
Constructs a DualVector, ensuring that the vector length matches the number of rows in the Jacobian.
"""
struct DualVector{T, V <: AbstractVector{T},M <: AbstractMatrix{T}} <: AbstractVector{Dual{T}}
struct DualVector{T, V <: AbstractVector{<:Union{T, Dual{T}}},M <: AbstractMatrix{T}} <: AbstractVector{Dual{T}}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks wrong. I don't see the role of the Union, and if the elments of value are of type Dual{T} then shouldn't the elements of jacobian also be of type Dual{T}?

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

Successfully merging this pull request may close these issues.

2 participants