A Simple and Practical Linear Algebra Library Interface with Static Size Checking

نویسندگان

  • Akinori Abe
  • Eijiro Sumii
چکیده

Linear algebra is a major field of numerical computation and is widely applied. Most linear algebra libraries (in most programming languages) do not statically guarantee consistency of the dimensions of vectors and matrices, causing runtime errors. While advanced type systems—specifically, dependent types on natural numbers—can ensure consistency among the sizes of collections such as lists and arrays [3, 4, 22], such type systems generally require non-trivial changes to existing languages and application programs, or tricky type-level programming. We have developed a linear algebra library interface that verifies the consistency (with respect to dimensions) of matrix operations by means of generative phantom types, implemented via fairly standard ML types and module system. To evaluate its usability, we ported to it a practical machine learning library from a traditional linear algebra library. We found that most of the changes required for the porting could be made mechanically, and changes that needed human thought are minor.

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

A Rational Approach to Portable High Performance: The Basic Linear Algebra

We introduce a collection of high performance kernels for basic linear algebra. The kernels encapsulate small xed size computations in order to provide building blocks for numerical libraries in C++. The sizes are templated parameters of the kernels, so they can be easily congured to a speci c architecture for portability. In this way the BLAIS delivers the power of such code generation systems...

متن کامل

A Rational Approach to Portable High Performance: The Basic Linear Algebra Instruction Set (BLAIS) and the Fixed Algorithm Size Template (FAST) Library

We introduce a collection of high performance kernels for basic linear algebra. The kernels encapsulate small xed size computations in order to provide building blocks for numerical libraries in C++. The sizes are templated parameters of the kernels, so they can be easily congured to a speci c architecture for portability. In this way the BLAIS delivers the power of such code generation systems...

متن کامل

Broadway: A Software Architecture for Scientific Computing

Scientific programs rely heavily on software libraries. This paper describes the limitations of this reliance and shows how it degrades software quality. We offer a solution that uses a compiler to automatically optimize library implementations and the application programs that use them. Using examples and experiments with the PLAPACK parallel linear algebra library and the MPI message passing ...

متن کامل

A Rational Approach to Portable HighPerformance : The Basic Linear

We introduce a collection of high performance kernels for basic linear algebra. The kernels encapsulate small xed size computations in order to provide building blocks for numerical libraries in C++. The sizes are templated parameters of the kernels, so they can be easily con-gured to a speciic architecture for portability. In this way the BLAIS delivers the power of such code generation system...

متن کامل

What a Structural World

Petri nets and stochastic Petri nets have been widely adopted as one of the best tools to model the logical and timing behavior of discrete-state systems. However, their practical applicability is limited by the state-space explosion problem. We survey some of the techniques that have been used to cope with large state spaces, starting from early explicit methods, which require data structures ...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2014