-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
343 additions
and
355 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,20 @@ | ||
module MatrixAlgebraKit | ||
|
||
using LinearAlgebra: LinearAlgebra | ||
using LinearAlgebra: Diagonal | ||
using LinearAlgebra: BlasFloat, BlasReal, BlasComplex, BlasInt, triu! | ||
|
||
export qr_compact!, qr_full! | ||
export eigh_full!, eigh_vals!, eigh_trunc! | ||
export svd_compact!, svd_full!, svd_vals!, svd_trunc! | ||
# export eigh_full!, eigh_vals!, eigh_trunc! | ||
export truncrank, trunctol, TruncationKeepSorted, TruncationKeepFiltered | ||
|
||
include("auxiliary.jl") | ||
include("backend.jl") | ||
include("algorithms.jl") | ||
include("truncation.jl") | ||
include("yalapack.jl") | ||
include("qr.jl") | ||
include("svd.jl") | ||
include("eigh.jl") | ||
# include("eigh.jl") | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
struct Algorithm{name,K} | ||
kwargs::K | ||
end | ||
|
||
macro algdef(name) | ||
esc(quote | ||
const $name{K} = Algorithm{$(QuoteNode(name)),K} | ||
export $name | ||
function $name(; kwargs...) | ||
return $name{typeof(kwargs)}(kwargs) | ||
end | ||
function Base.print(io::IO, alg::$name) | ||
print(io, $name, "(") | ||
next = iterate(alg.kwargs) | ||
isnothing(next) && return print(io, ")") | ||
(k, v), state = next | ||
print(io, "; ", string(k), "=", string(v)) | ||
next = iterate(alg.kwargs, state) | ||
while !isnothing(next) | ||
(k, v), state = next | ||
print(io, ", ", string(k), "=", string(v)) | ||
next = iterate(alg.kwargs, state) | ||
end | ||
return print(io, ")") | ||
end | ||
end) | ||
end | ||
|
||
@algdef LAPACK_QRIteration | ||
@algdef LAPACK_DivideAndConquer | ||
@algdef LAPACK_RobustRepresentations | ||
@algdef LAPACK_HouseholderQR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.