Matrices as arrows! A biproduct approach to typed linear algebra

Motivated by the need to formalize generation of fast running code for linear algebra applications, we show how an index-free, calculational approach to matrix algebra can be developed by regarding matrices as morphisms of a category with biproducts. This shifts the traditional view of matrices as i...

ver descrição completa

Detalhes bibliográficos
Autor principal: Oliveira, José Nuno Fonseca (author)
Outros Autores: Macedo, Hugo Daniel (author)
Formato: conferencePaper
Idioma:eng
Publicado em: 2010
Assuntos:
Texto completo:http://hdl.handle.net/1822/17802
País:Portugal
Oai:oai:repositorium.sdum.uminho.pt:1822/17802
Descrição
Resumo:Motivated by the need to formalize generation of fast running code for linear algebra applications, we show how an index-free, calculational approach to matrix algebra can be developed by regarding matrices as morphisms of a category with biproducts. This shifts the traditional view of matrices as indexed structures to a type-level perspective analogous to that of the pointfree algebra of programming. The derivation of fusion, cancellation and abide laws from the biproduct equations makes it easy to calculate algorithms implementing matrix multiplication, the kernel operation of matrix algebra, ranging from its divide-and-conquer version to the conventional, iterative one. From errant attempts to learn how particular products and coproducts emerge from biproducts, we not only rediscovered block-wise matrix com- binators but also found a way of addressing other operations calculation- ally such as e.g. Gaussian elimination. A strategy for addressing vector- ization along the same lines is also given.