-
Notifications
You must be signed in to change notification settings - Fork 43
Describe LinearOperator{T, S}(args...) in docs
#405
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,57 +1,41 @@ | ||||||||||||||||||||||
| # Constructors. | ||||||||||||||||||||||
| """ | ||||||||||||||||||||||
| LinearOperator(M::AbstractMatrix{T}; symmetric=false, hermitian=false, S = Vector{T}) where {T} | ||||||||||||||||||||||
| Construct a linear operator from a dense or sparse matrix. | ||||||||||||||||||||||
| Use the optional keyword arguments to indicate whether the operator | ||||||||||||||||||||||
| is symmetric and/or hermitian. | ||||||||||||||||||||||
| Change `S` to use LinearOperators on GPU. | ||||||||||||||||||||||
| LinearOperator(M::AbstractMatrix{T}; symmetric=defaultsymmetric(M), hermitian=defaulthermitian(M), S = Vector{T}) where {T} | ||||||||||||||||||||||
| Construct a linear operator from a dense or sparse matrix. Use the optional | ||||||||||||||||||||||
| keyword arguments to indicate whether the operator is symmetric and/or | ||||||||||||||||||||||
| hermitian. Change `S` to use LinearOperators on GPU. | ||||||||||||||||||||||
|
Comment on lines
+3
to
+6
|
||||||||||||||||||||||
| LinearOperator(M::AbstractMatrix{T}; symmetric=defaultsymmetric(M), hermitian=defaulthermitian(M), S = Vector{T}) where {T} | |
| Construct a linear operator from a dense or sparse matrix. Use the optional | |
| keyword arguments to indicate whether the operator is symmetric and/or | |
| hermitian. Change `S` to use LinearOperators on GPU. | |
| LinearOperator(M::AbstractMatrix{T}; symmetric=defaultsymmetric(M), hermitian=defaulthermitian(M), S = storage_type(M)) where {T} | |
| Construct a linear operator from a dense or sparse matrix. Use the optional | |
| keyword arguments to indicate whether the operator is symmetric and/or | |
| hermitian. The default storage type `S` is determined by `storage_type(M)`, which | |
| typically evaluates to `Vector{T}` for standard matrix types. Change `S` to use | |
| LinearOperators on GPU. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is inherited from previous code.
Copilot
AI
Feb 22, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This LinearOperator{T, S}(M::AbstractMatrix{T}; ...) constructor is missing documentation. Since the PR goal is to "Describe LinearOperator{T, S}(args...) in docs" and this is the main matrix constructor that implements the symmetric and hermitian defaults, it should have its own docstring explaining its purpose as the type-inferrable variant and documenting its parameters.
Copilot
AI
Feb 22, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This refactoring introduces a subtle behavioral change for complex Symmetric matrices. Previously, only real Symmetric matrices matched a specialized constructor (setting symmetric=true, hermitian=true), while complex Symmetric matrices fell back to the default constructor with symmetric=false, hermitian=false. Now, the defaultsymmetric(M::Symmetric) = true method applies to all Symmetric matrices, including complex ones. This is mathematically correct (a symmetric matrix is symmetric regardless of element type), but it is a breaking change that should be documented in release notes.
| defaultsymmetric(M::Symmetric) = true | |
| defaultsymmetric(M::Symmetric{<:Real}) = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be fair to call this a bugfix, not a breaking change.
Uh oh!
There was an error while loading. Please reload this page.