From 19b6be78b912625d50bbc18be08e07470509646a Mon Sep 17 00:00:00 2001 From: leburgel Date: Wed, 4 Feb 2026 15:42:20 +0100 Subject: [PATCH 1/3] Highlight usage of `default_algorithm` in decomposition documentation --- docs/src/user_interface/decompositions.md | 1 + src/MatrixAlgebraKit.jl | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/src/user_interface/decompositions.md b/docs/src/user_interface/decompositions.md index fe28fcf9..8dd3a1dc 100644 --- a/docs/src/user_interface/decompositions.md +++ b/docs/src/user_interface/decompositions.md @@ -16,6 +16,7 @@ f!(A, [F]; kwargs...) -> F... Here, the input matrix is always the first argument, and optionally the output can be provided as well. The keywords are algorithm-specific, and can be used to influence the behavior of the algorithms. +To check what algorithm is used by default for a given factorization `f` and input `A`, and by extension which keyword arguments it takes, you can call [`default_algorithm(f, A)`](@ref) and check the documentation of resulting algorithm type. Importantly, for generic code patterns it is recommended to always use the output `F` explicitly, since some implementations may not be able to reuse the provided memory. Additionally, the `f!` method typically assumes that it is allowed to destroy the input `A`, and making use of the contents of `A` afterwards should be deemed as undefined behavior. diff --git a/src/MatrixAlgebraKit.jl b/src/MatrixAlgebraKit.jl index 03fb05bd..105f704b 100644 --- a/src/MatrixAlgebraKit.jl +++ b/src/MatrixAlgebraKit.jl @@ -31,6 +31,7 @@ export left_polar!, right_polar! export left_orth, right_orth, left_null, right_null export left_orth!, right_orth!, left_null!, right_null! +export default_algorithm export Native_HouseholderQR, Native_HouseholderLQ export LAPACK_HouseholderQR, LAPACK_HouseholderLQ, LAPACK_Simple, LAPACK_Expert, LAPACK_QRIteration, LAPACK_Bisection, LAPACK_MultipleRelativelyRobustRepresentations, @@ -50,7 +51,7 @@ export notrunc, truncrank, trunctol, truncerror, truncfilter @static if VERSION >= v"1.11.0-DEV.469" eval( Expr( - :public, :default_algorithm, :findtruncated, :findtruncated_svd, + :public, :findtruncated, :findtruncated_svd, :select_algorithm ) ) From 464204b427edab6e2bdc226aa1568e3dbc4fb2db Mon Sep 17 00:00:00 2001 From: leburgel Date: Wed, 4 Feb 2026 16:44:32 +0100 Subject: [PATCH 2/3] Remove `default_algorithm` export --- docs/src/user_interface/decompositions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/user_interface/decompositions.md b/docs/src/user_interface/decompositions.md index 8dd3a1dc..b48bacbe 100644 --- a/docs/src/user_interface/decompositions.md +++ b/docs/src/user_interface/decompositions.md @@ -16,7 +16,7 @@ f!(A, [F]; kwargs...) -> F... Here, the input matrix is always the first argument, and optionally the output can be provided as well. The keywords are algorithm-specific, and can be used to influence the behavior of the algorithms. -To check what algorithm is used by default for a given factorization `f` and input `A`, and by extension which keyword arguments it takes, you can call [`default_algorithm(f, A)`](@ref) and check the documentation of resulting algorithm type. +To check what algorithm is used by default for a given factorization `f` and input `A`, and by extension which keyword arguments it takes, you can call [`MatrixAlgebraKit.default_algorithm(f, A)`](@ref) and check the documentation of resulting algorithm type. Importantly, for generic code patterns it is recommended to always use the output `F` explicitly, since some implementations may not be able to reuse the provided memory. Additionally, the `f!` method typically assumes that it is allowed to destroy the input `A`, and making use of the contents of `A` afterwards should be deemed as undefined behavior. From ffa35b596d6307f5977aebe1ed2c9fec97392f09 Mon Sep 17 00:00:00 2001 From: leburgel Date: Wed, 4 Feb 2026 16:45:26 +0100 Subject: [PATCH 3/3] And then actually do it --- src/MatrixAlgebraKit.jl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/MatrixAlgebraKit.jl b/src/MatrixAlgebraKit.jl index 105f704b..03fb05bd 100644 --- a/src/MatrixAlgebraKit.jl +++ b/src/MatrixAlgebraKit.jl @@ -31,7 +31,6 @@ export left_polar!, right_polar! export left_orth, right_orth, left_null, right_null export left_orth!, right_orth!, left_null!, right_null! -export default_algorithm export Native_HouseholderQR, Native_HouseholderLQ export LAPACK_HouseholderQR, LAPACK_HouseholderLQ, LAPACK_Simple, LAPACK_Expert, LAPACK_QRIteration, LAPACK_Bisection, LAPACK_MultipleRelativelyRobustRepresentations, @@ -51,7 +50,7 @@ export notrunc, truncrank, trunctol, truncerror, truncfilter @static if VERSION >= v"1.11.0-DEV.469" eval( Expr( - :public, :findtruncated, :findtruncated_svd, + :public, :default_algorithm, :findtruncated, :findtruncated_svd, :select_algorithm ) )