Skip to content
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

Documentation update for LinearAlgebra functions #52934

Merged
merged 19 commits into from
Feb 12, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
fb9bdd9
Addnl LA Documentation: Dummy commit with TODOs to get a PR started.
aravindh-krishnamoorthy Jan 16, 2024
aace7ac
LinearAlgebra: Remove exceptions for exported but undocumented functi…
aravindh-krishnamoorthy Jan 19, 2024
8c8edbb
Update LinearAlgebra test to ensure no undocumented exported symbols
aravindh-krishnamoorthy Jan 20, 2024
7bee3ae
Update stdlib/LinearAlgebra/test/runtests.jl
aravindh-krishnamoorthy Jan 20, 2024
0f89207
Update stdlib/LinearAlgebra/test/runtests.jl
aravindh-krishnamoorthy Jan 20, 2024
9267ce2
Merge branch 'master' into la_addnl_docs
aravindh-krishnamoorthy Jan 24, 2024
4b4587c
DocStrings for copy_transpose!
aravindh-krishnamoorthy Jan 24, 2024
c0acaad
DocStrings for RankDeficientException and LAPACKException.
aravindh-krishnamoorthy Jan 26, 2024
f27751d
Initial text on pivoting
aravindh-krishnamoorthy Jan 27, 2024
de24482
Added DocStrings to copyto!
aravindh-krishnamoorthy Jan 28, 2024
6f3338e
Documentation for pivoting and pivoting strategies.
aravindh-krishnamoorthy Jan 29, 2024
61bf648
Incorporate changes from self review.
aravindh-krishnamoorthy Feb 3, 2024
d47f20e
index.md: Remove trailing whitespace.
aravindh-krishnamoorthy Feb 3, 2024
72a188a
Apply suggestions from code review by @dkarrasch
aravindh-krishnamoorthy Feb 7, 2024
e3985dd
Apply suggestions from code review by @stevengj and @dkarrasch
aravindh-krishnamoorthy Feb 7, 2024
296ecd5
Update stdlib/LinearAlgebra/src/matmul.jl
aravindh-krishnamoorthy Feb 7, 2024
a653963
Remove non-breaking space
aravindh-krishnamoorthy Feb 7, 2024
3cb092e
fix adjoint case in copyto!
dkarrasch Feb 11, 2024
a7fd509
fix typo
dkarrasch Feb 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions stdlib/LinearAlgebra/src/LinearAlgebra.jl
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,8 @@ abstract type PivotingStrategy end
NoPivot

Pivoting is not performed. Matrix factorizations such as the LU factorization
may fail without pivoting.
may fail without pivoting, and may also be numerically unstable for floating-point matrices in the face of roundoff error.
This pivot strategy is mainly useful for pedagogical purposes.
"""
struct NoPivot <: PivotingStrategy end

Expand All @@ -206,6 +207,11 @@ struct NoPivot <: PivotingStrategy end

First non-zero element in the remaining rows is chosen as the pivot element.
aravindh-krishnamoorthy marked this conversation as resolved.
Show resolved Hide resolved

Beware that for floating-point matrices, the resulting LU algorithm is numerically unstable — this strategy
aravindh-krishnamoorthy marked this conversation as resolved.
Show resolved Hide resolved
is mainly useful for comparison to hand calculations (which typically use this strategy) or for other
algebraic types (e.g. rational numbers) not susceptible to roundoff errors. Otherwise, the default
`RowMaximum` pivoting strategy should be generally preferred in Gaussian elimination.

Note that the [element type](@ref eltype) of the matrix must admit an [`iszero`](@ref)
method.
"""
Expand All @@ -214,7 +220,9 @@ struct RowNonZero <: PivotingStrategy end
"""
RowMaximum

The maximum element in the remaining rows is chosen as the pivot element.
The maximum-magnitude element in the remaining rows is chosen as the pivot element.
This is the default strategy for LU factorization of floating-point matrices, and is sometimes
referred to as the "partial pivoting" algorithm.

Note that the [element type](@ref eltype) of the matrix must admit an [`abs`](@ref) method,
whose result type must admit a [`<`](@ref) method.
Expand All @@ -224,7 +232,8 @@ struct RowMaximum <: PivotingStrategy end
"""
ColumnNorm

The column with the maximum norm is used for subsequent computation.
The column with the maximum norm is used for subsequent computation. This
is used for pivoted QR factorization.

Note that the [element type](@ref eltype) of the matrix must admit [`norm`](@ref) and
[`abs`](@ref) methods, whose respective result types must admit a [`<`](@ref) method.
Expand Down
2 changes: 1 addition & 1 deletion stdlib/LinearAlgebra/src/matmul.jl
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,7 @@ parameter `tM` as follows:
| --- | :--- | :--- |
| `'N'` | `B[ir_dest, jr_dest]` | `M[ir_src, jr_src]` |
| `'T'` | `B[ir_dest, jr_dest]` | `transpose(M)[ir_src, jr_src]` |
| `'C'` | `B[ir_dest, jr_dest]` | `adjoint(M)[ir_src, jr_src]` |
| `'C'` | `B[ir_dest, jr_dest]` | `conj(transpose((M))[ir_src, jr_src]` |
aravindh-krishnamoorthy marked this conversation as resolved.
Show resolved Hide resolved
dkarrasch marked this conversation as resolved.
Show resolved Hide resolved

The elements `B[ir_dest, jr_dest]` are overwritten. Furthermore, the index range
parameters must satisfy `length(ir_dest) == length(ir_src)` and
Expand Down