Interfaces

Matrices

TypedMatrices.list_matricesFunction
list_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)])
source

Properties

TypedMatrices.@propertiesMacro
@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]
source
TypedMatrices.propertiesFunction
properties(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)
source

Grouping

TypedMatrices.add_to_groupsFunction
add_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)
source
TypedMatrices.remove_from_groupFunction
remove_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)
source
TypedMatrices.save_groupFunction
save_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")
source
TypedMatrices.load_groupFunction
load_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")
source

Testing Interfaces

TypedMatrices.test_algorithmFunction
test_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.
  • 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.

source