Interfaces
Matrices
TypedMatrices.list_matrices — Functionlist_matrices(groups, props)List all matrices that are in groups and have properties.
groups can be vector/varargs of Group or symbol.
props can be vector/varargs of Property, symbol, subtype of PropertyTypes.AbstractProperty or instance of AbstractProperty.
Examples
julia> list_matrices()
julia> list_matrices([Group(:builtin), Group(:user)], [Property(:symmetric), Property(:inverse)])
julia> list_matrices(Property(:symmetric), Property(:inverse))
julia> list_matrices([Property(:symmetric), Property(:inverse)])
julia> list_matrices(:symmetric, :inverse)
julia> list_matrices([:symmetric, :inverse])
julia> list_matrices(PropertyTypes.Symmetric, PropertyTypes.Inverse)
julia> list_matrices([PropertyTypes.Symmetric, PropertyTypes.Inverse])
julia> list_matrices(PropertyTypes.Symmetric(), PropertyTypes.Inverse())
julia> list_matrices([PropertyTypes.Symmetric(), PropertyTypes.Inverse()])
julia> list_matrices(Group(:builtin), Group(:user))
julia> list_matrices([Group(:builtin), Group(:user)])Properties
TypedMatrices.list_properties — Functionlist_properties()List all properties.
TypedMatrices.@properties — Macro@properties Type [propa, propb, ...]Register properties for a type. The properties are a vector of symbols.
See also: properties.
Examples
julia> @properties Matrix [:symmetric, :inverse, :illcond, :posdef, :eigen]TypedMatrices.properties — Functionproperties(type)
properties(matrix)Get the properties of a type or matrix.
See also: @properties.
Examples
julia> @properties Matrix [:symmetric, :posdef]
julia> properties(Matrix)
2-element Vector{Property}:
Property(:symmetric)
Property(:posdef)
julia> properties(Matrix(ones(1, 1)))
2-element Vector{Property}:
Property(:symmetric)
Property(:posdef)Grouping
TypedMatrices.list_groups — Functionlist_groups()List all matrix groups.
TypedMatrices.add_to_groups — Functionadd_to_groups(type, groups)Add a matrix type to groups. If a group does not exist, it will be created.
Groups :builtin and :user are special groups. It is suggested always to add matrices to the :user group.
groups can be vector/varargs of Group or symbol.
See also remove_from_group, remove_from_all_groups.
Examples
julia> add_to_groups(Matrix, [Group(:user), Group(:test)])
julia> add_to_groups(Matrix, Group(:user), Group(:test))
julia> add_to_groups(Matrix, [:user, :test])
julia> add_to_groups(Matrix, :user, :test)TypedMatrices.remove_from_group — Functionremove_from_group(type, group)Remove a matrix type from a group. If the group is empty, it will be deleted.
group can be Group or symbol.
See also add_to_groups, remove_from_all_groups.
Examples
julia> add_to_groups(Matrix, Group(:user))
julia> remove_from_group(Matrix, Group(:user))
julia> add_to_groups(Matrix, :user)
julia> remove_from_group(Matrix, :user)TypedMatrices.remove_from_all_groups — Functionremove_from_all_groups(type)Remove a matrix type from all groups. If a group is empty, it will be deleted.
See also add_to_groups, remove_from_group.
Examples
julia> remove_from_all_groups(Matrix)TypedMatrices.save_group — Functionsave_group(group, file_name)Save matrices to a group.
group can be Group or symbol.
See also load_group.
Examples
julia> save_group(Group(:user), "user_matrices.txt")
julia> save_group(:user, "user_matrices.txt")TypedMatrices.load_group — Functionload_group(group, file_name)Load matrices to a group.
group can be Group or symbol.
See also save_group.
Examples
julia> load_group(Group(:user), "user_matrices.txt")
julia> load_group(:user, "user_matrices.txt")Testing Interfaces
TypedMatrices.test_algorithm — Functiontest_algorithm(func, sizes, props, errors_as_warnings=false, ignore_errors=false, excludes=[])Test an algorithm with all matrix types and sizes.
Arguments
func::Function: The function to test, which accepts a matrix as input.sizes::Vector{<:Integer}: The sizes to test.groups::Vector{Group}=Group[]: The groups to find matrices.props::Vector{Property}=Property[]: The properties to find matrices.errors_as_warnings::Bool=false: If true, errors will be shown as warnings.ignore_errors::Bool=false: If true, errors will be ignored.excludes::Vector=[]: The matrix types to exclude.
The errors_as_warnings and ignore_errors options can be true at the same time. In this case, errors will be ignored.