Matrix API support - start with formats?

dominik via Digitalmars-d digitalmars-d at puremagic.com
Fri Aug 21 04:31:14 PDT 2015


coming from a computer graphics and image processing background 
i'd love to have a standard way to deal with matrices.

But matrices come in a lot of different flavors, which need 
different implementations.
- computer graphics applications need mostly 1d-4d vectors and 
matrices.
   encapsulation of transformation types: 
rigid/similarity/affine/linear/projective give the
   opportunity to choose simpler algorithms for e.g. inversion of 
a matrix
- images are usually represented as dense 2d matrix (or 3d if 
multiple colors channels are present)
- equation systems use dense and sparse matrices, and use lots of 
different data structures
   to be optimal for different algorithms. yale dok lil coo to 
name some sparse formats.
   mathematically they have different properties like 
square/rectangular positive/negative
   definit diagonal
- matlab style matrices
   for convenience it should be possible to resize, and 
concatenate matrices in different
   dimensions, e.g. to compose images or to augment equation 
systems

on top of that possibilities to solve those equation systems 
would be handy:
with c++ i mostly use eigen, opennl or ceres

this was just a list of things i thought should be kept in mind 
when implementing a matrix api - the matrix api doesnt have to 
implement all this

imho the matrix api could provide some basic types and a general 
interface to access such matrices. for start a simple dense and 
sparse n-dimensional matrix format with the possibility to 
construct and change matrices. slicing in n-dimensions as simple 
as in matlab would be awesome.

such an api would also be a great base for writing graph based 
algorithms like markov random fields ...

hopes and wishes :)
best dominik


More information about the Digitalmars-d mailing list