TypedMatrices.jl is a registered package in the Julia package registry. Use Julia's package manager to install it:
pkg> add TypedMatrices
Use the package:
julia> using TypedMatrices
You can list all matrices available with list_matrices
:
julia> list_matrices()
43-element Vector{Type{<:AbstractMatrix}}:
- Hadamard
- Binomial
- Neumann
- Lotkin
- Moler
Fiedler
- Frank
- Chow
- DingDong
+ Triw
Circulant
- ⋮
- Rosser
- Pei
+ Randcorr
+ Oscillate
RandSVD
+ Golub
+ Parter
+ DingDong
+ Involutory
+ ⋮
+ Hankel
+ Toeplitz
+ KMS
+ Lehmer
Minij
- Hilbert
- Comparison
- Forsythe
- Grcar
- Poisson
Each type of matrix has its own type and constructors. For example, to create a 5x5 Hilbert matrix:
julia> h = Hilbert(5)
5×5 Hilbert{Rational{Int64}}:
+ Clement
+ Prolate
+ Magic
+ Lotkin
Each type of matrix has its own type and constructors. For example, to create a 5x5 Hilbert matrix:
julia> h = Hilbert(5)
5×5 Hilbert{Rational{Int64}}:
1 1//2 1//3 1//4 1//5
1//2 1//3 1//4 1//5 1//6
1//3 1//4 1//5 1//6 1//7
@@ -38,62 +38,62 @@
Property(:inverse)
Property(:illcond)
Property(:posdef)
To view all available properties, use list_properties
:
julia> list_properties()
9-element Vector{Property}:
- Property(:symmetric)
Property(:regprob)
- Property(:graph)
- Property(:illcond)
Property(:posdef)
- Property(:random)
Property(:sparse)
+ Property(:random)
+ Property(:inverse)
+ Property(:illcond)
+ Property(:symmetric)
Property(:eigen)
- Property(:inverse)
This package has a grouping feature to group matrices. All builtin matrices are in the builtin
group, we also create a user
group for user-defined matrices. You can list all groups with:
julia> list_groups()
2-element Vector{Group}:
- Group(:user)
- Group(:builtin)
To add a matrix to groups and enable it to be listed by list_matrices
, use add_to_groups
:
julia> add_to_groups(Matrix, :user, :test)
julia> list_matrices(Group(:user))
1-element Vector{Type{<:AbstractMatrix}}:
+ Property(:graph)
This package has a grouping feature to group matrices. All builtin matrices are in the builtin
group, we also create a user
group for user-defined matrices. You can list all groups with:
julia> list_groups()
2-element Vector{Group}:
+ Group(:builtin)
+ Group(:user)
To add a matrix to groups and enable it to be listed by list_matrices
, use add_to_groups
:
julia> add_to_groups(Matrix, :user, :test)
julia> list_matrices(Group(:user))
1-element Vector{Type{<:AbstractMatrix}}:
Matrix (alias for Array{T, 2} where T)
We can also add builtin matrices to our own groups:
julia> add_to_groups(Hilbert, :test)
julia> list_matrices(Group(:test))
2-element Vector{Type{<:AbstractMatrix}}:
- Matrix (alias for Array{T, 2} where T)
- Hilbert
To remove a matrix from a group or all groups, use remove_from_group
or remove_from_all_groups
. The empty group will automatically be removed:
julia> remove_from_group(Hilbert, :test)
julia> remove_from_all_groups(Matrix)
julia> list_groups()
2-element Vector{Group}:
- Group(:user)
- Group(:builtin)
list_matrices
is very powerful to list matrices, and filter by groups and properties. All arguments are "and" relationship, i.e. listed matrices must satisfy all conditions.
For example, to list all matrices in the builtin
group, and all matrices with symmetric
property:
julia> list_matrices(Group(:builtin))
43-element Vector{Type{<:AbstractMatrix}}:
- Hadamard
- Binomial
- Neumann
- Lotkin
- Moler
+ Hilbert
+ Matrix (alias for Array{T, 2} where T)
To remove a matrix from a group or all groups, use remove_from_group
or remove_from_all_groups
. The empty group will automatically be removed:
julia> remove_from_group(Hilbert, :test)
julia> remove_from_all_groups(Matrix)
julia> list_groups()
2-element Vector{Group}:
+ Group(:builtin)
+ Group(:user)
list_matrices
is very powerful to list matrices, and filter by groups and properties. All arguments are "and" relationship, i.e. listed matrices must satisfy all conditions.
For example, to list all matrices in the builtin
group, and all matrices with symmetric
property:
julia> list_matrices(Group(:builtin))
43-element Vector{Type{<:AbstractMatrix}}:
Fiedler
- Frank
- Chow
- DingDong
+ Triw
Circulant
- ⋮
- Rosser
- Pei
+ Randcorr
+ Oscillate
RandSVD
- Minij
- Hilbert
- Comparison
- Forsythe
- Grcar
- Poisson
julia> list_matrices(Property(:symmetric))
20-element Vector{Type{<:AbstractMatrix}}:
- Moler
- Fiedler
+ Golub
+ Parter
DingDong
- Circulant
+ Involutory
+ ⋮
Hankel
- InverseHilbert
+ Toeplitz
+ KMS
Lehmer
- Wathen
- Pascal
+ Minij
Clement
+ Prolate
+ Magic
+ Lotkin
julia> list_matrices(Property(:symmetric))
20-element Vector{Type{<:AbstractMatrix}}:
+ Fiedler
+ Circulant
Randcorr
Oscillate
+ DingDong
Cauchy
Wilkinson
- KMS
- Prolate
+ Pascal
+ Moler
+ Hilbert
+ Wathen
+ Poisson
Pei
+ InverseHilbert
+ Hankel
+ KMS
+ Lehmer
Minij
- Hilbert
- Poisson
To list all matrices in the builtin
group with inverse
, illcond
, and eigen
properties:
julia> list_matrices(
+ Clement
+ Prolate
To list all matrices in the builtin
group with inverse
, illcond
, and eigen
properties:
julia> list_matrices(
[
Group(:builtin),
],
@@ -103,13 +103,13 @@
Property(:eigen),
]
)
4-element Vector{Type{<:AbstractMatrix}}:
- Lotkin
- Pascal
Involutory
- Forsythe
To list all matrices with symmetric
, eigen
, and posdef
properties:
julia> list_matrices(:symmetric, :eigen, :posdef)
6-element Vector{Type{<:AbstractMatrix}}:
- Circulant
- Wathen
Pascal
+ Forsythe
+ Lotkin
To list all matrices with symmetric
, eigen
, and posdef
properties:
julia> list_matrices(:symmetric, :eigen, :posdef)
6-element Vector{Type{<:AbstractMatrix}}:
+ Circulant
Oscillate
- Minij
- Poisson
There are many alternative interfaces using list_matrices
, please check the list_matrices
or use Julia help system for more information.