Skip to content

Conversation

alecarraro
Copy link
Collaborator

@alecarraro alecarraro commented Jul 26, 2025

This is the first of a sequence of 3/4 pull requests to implement the overapproximation methods for maps with matrix zonotopes. In this PR i implement

  • An AbstractMatrixZonotope supertype
  • A MatrixZonotopeProduct type to store lazy products of matrix zonotopes
  • A MatrixZonotopeExp to represent lazily the exponential $\exp(\mathcal{A})$
  • overapproximate_norm and remove_redundant_factors for MatrixZonotopeProduct
  • linear_map for MatrixZonotope

@schillic
Copy link
Member

Could you add a separate PR for fixing scale, including a test?

@alecarraro
Copy link
Collaborator Author

Could you add a separate PR for fixing scale, including a test?

Done. Should I undo the commit in this one then?

@schillic
Copy link
Member

Yes - there will be a merge conflict sooner or later anyway.

@schillic
Copy link
Member

Still a conflict here...

reduced = MatrixZonotope{eltype(factors_[1]), typeof(center(factors_[1]))}[]

i = 1
while i < length(factors_)
Copy link
Member

Choose a reason for hiding this comment

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

This can be turned into a normal for loop. Is that intended? See also the next comment.

end

# in the last element apply linear map to the left
if i == length(factors_)
Copy link
Member

Choose a reason for hiding this comment

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

This condition always holds.

end
end
if isempty(reduced)
return center(factors_[end-1]) # return concrete matrix
Copy link
Member

Choose a reason for hiding this comment

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

Why end-1?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ok, this was added to fix an edge case, but it actually breaks others. I will edit it and add more corner tests

while i < length(factors_)
MZ = factors_[i]
if isempty(generators(MZ))
factors_[i+1] = linear_map(center(MZ), factors_[i + 1])
Copy link
Member

Choose a reason for hiding this comment

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

I do not understand this code. This function should not modify factors_.

Co-authored-by: Christian Schilling <[email protected]>
@schillic
Copy link
Member

Apart from remove_redundant_factors I can approve this PR. I have the feeling that remove_redundant_factors will take a bit longer to discuss. Do you want to move it to a separate PR so we can merge this? (Up to you.)

@alecarraro
Copy link
Collaborator Author

yes lets move it to a different PR,

@alecarraro
Copy link
Collaborator Author

alecarraro commented Jul 27, 2025

I removed all the appearence of remove_redundant_factors from this PR and created a new branch for that. i will update the function and create a new PR later

@schillic schillic merged commit 458fb29 into master Jul 27, 2025
7 checks passed
@schillic schillic deleted the alecarraro/LM_mz branch July 27, 2025 15:36
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