TypedMatrices.jl: An Extensible and Type-Based Matrix Collection for Julia
Anzhi Zhang, Massimiliano Fasi · 2025
Read TypedMatrices.jl: An Extensible and Type-Based Matrix Collection for Julia by Anzhi Zhang, Massimiliano Fasi (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2503-11355.txt.
Introduction
Anzhi Zhang and Massimiliano Fasi present a software package for the Julia language that organizes test matrices for numerical work, in a 2025 paper. Test matrices are standard examples used to check that math software behaves. The package ships with built-in matrices and tools that let users pick cases by their properties, such as shape or difficulty. It is built to grow: users can define their own matrix types and add them to the collection. The authors explain the design and show the package in use through several examples.
Catalog record
| CREATOR | Anzhi Zhang, Massimiliano Fasi |
|---|---|
| YEAR | 2025 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 42 KB |
| VERSION | 1.0 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2503-11355
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
TypedMatrices.jl: An Extensible and Type-Based Matrix Collection for Julia Anzhi Zhang, Massimiliano Fasi Abstract TypedMatrices.jl is a Julia package to organize test matrices. By default, the package comes with a number of built-in matrices and interfaces to help users select test cases based on their properties. The package is designed to be extensible, allowing users to define their own matrix types. We discuss the design and implementation of the package and demonstrate its usage with a number of examples. Key words. Test matrices, matrix collection, matrix algorithms, Julia. Version of August 24, 2026. 1 Introduction In order to understand the accuracy of numerical algorithms for linear algebra problems, it is convenient to run these algorithms on a selection of suitably chosen test cases. Ideally, these test problems should satisfy three requirements. First, the they should be representative of the class of applications for which the new algorithms are designed. Second, their solution should be known, either in closed form or to in a way that guarantees high accuracy. Finally, they should be parametrized so that it is possible to make them arbitrarily large and/or arbitrarily difficult. The need for good test matrices, in particular, was recognized early on by the numerical linear algebra community, and a large body of literature has been produced in the last 70 years. To the best of our knowledge, the need to carry out numerical experiments was first highlighted by Newman and Todd [ 32 ] , who remark that it would be impractical to carry out rigorous error analysis of numerical algorithms for all computational problems. Newman and Todd focus on matrix inversion, but other authors considered other linear algebra computations. Clement [ 6 ] , for example, proposes a class of tridiagonal matrices for testing purposes, giving closed formulas for their inverses, determinants, and eigenvalues. Many family of matrices expressly designed for testing purposes were proposed in the early sixties, often in the form of short communication building on each other. A representative example is that of the Pei matrix: Pei [ 33 ] proposed it in 1962, and within one year LaSor [ 28 ] found an explicit expression for its eigenvalues and Newbery [ 31 ] gave an explicit method to compute its eigenvectors. All three communications would easily fit in one page. A summary of the test matrices proposed in the early years of digital computing can be found in the monograph by Gegory and Karney [ 18 ] , who collect a large number of test matrices from the literature. Notably, their work includes the matrices gathered by Westlake in a 22-page appendix to a monograph entirely dedicated to matrix inversion [ 36 ] . Gregory and Karney explicitly state that the purpose of their collection is to provide numerical examples with known solutions that can be used to test algorithms for matrix inversion and computation of eigenvalues and eigenvectors. Test matrices have considerably grown in importance since the late sixties. Today, these test problems are used not only to gauge the accuracy of numerical algorithms, but also to benchmark their performance, to ensure that research is easily reproducible, and to conduct theoretical investigations. Therefore, it is not surprising that several software packages have been developed to streamline the generation of test matrices and to guarantee the reproducibility of numerical results, which is of crucial importance in the mathematical sciences [ 8 ] . Existing software collections and packages are surveyed in section 3 . We introduce TypedMatrices.jl , a Julia package to manage large collections of test matrices by leveraging Julia’s type system. The package is released under the MIT license, is freely available on GitHub, 1 1 1 https://github.com/TypedMatrices/TypedMatrices.jl and can be installed using Julia’s package manager. The collection includes 63 built-in matrices and provides a number of testing interfaces to help users generate test matrices that satisfy a specified subset of the 37 built-in properties. The brief tutorial in section 4 illustrates the main features and use cases. The package is entirely implemented in Julia 2 2 2 https://julialang.org [ 4 ] , a high-level, high-performance programming language for numerical computing. The Julia community is highly active, and the package welcomes contributions from the community. TypedMatrices.jl builds on the features of Julia discussed in section 2 . TypedMatrices.jl is designed to overcome the limitations of existing tools and provide a flexible environment for dynamic matrix generation. The package is designed to be extensible and to allow users to define their own matrix types. The main features of the package are the following. • Matrices are generated dynamically, enabling substantial memory savings, especially for large-scale computations. • The collection leverages Julia’s type system, and matrices can be stored to optimize memory usage and runtime performance. This design facilitates integration with Julia’s multiple dispatch mechanism and provides a modular and adaptable interface. • The matrix entries can be of any scalar type, including user-defined types. • Users can easily extend the library by defining custom matrix types or generators. • The package supports the creation of user-defined groups, allowing users to organize matrices into logical collections. This feature allows researchers to save and share predefined sets of test matrices, thereby simplifying the reproducibility of numerical experiments. The design and implementation of TypedMatrices.jl are discussed in section 5 . This section shows how users can interact with the package and customize it, describes the underlying design principles, and explains the role of the Julia type system in supporting dynamic generation. Section 6 provides some advanced use cases and examples, illustrating the collection’s applicability in real-world scenarios and algorithm development. Section 7 discusses the package’s performance. Section 8 focuses on testing, validation, and performance evaluation of the collection. Section 9 concludes with a discussion of the impact and outlines future work. 2 Background Julia [ 4 ] is a dynamic programming language designed to solve the two-language problems by combining the flexibility and expressiveness of high-level prototyping languages, such as Python, and the performance of lower-level languages. Using a just-in-time (JIT) compilation, Julia delivers performance close to that of C and Fortran, 3 3 3 https://julialang.org/benchmarks and Julia code can be faster than the equivalent C code in numerical linear algebra implementations [ 26 ] . A distinctive features of Julia is the use of a multiple dispatch mechanism based on parametric polymorphism. A function is an object that maps a tuple of arguments to a return value, which can have different behaviors, and therefore different implementations, depending on what arguments it is applied to. In Julia, functions can be overloaded, and each possible behavior of a function, which corresponds to a different implementation, is a method of that function. When a function is applied, Julia chooses which method to use based on the number of arguments given and on the type of all supplied arguments. The use of multiple dispatch is a natural choice for mathematical code, and it allows programmers to write elegant, flexible, and efficient code in most scientific domains. 3 Related Work As far as we are aware, the first collection to be widely available in digital form was the Harwell-Boeing sparse matrix collection [ 10 , 11 ] , a set of problems for linear