view yetilab/matrix/type.yeti @ 287:d6811e2949ff

Periodic window probably better after all
author Chris Cannam
date Thu, 30 May 2013 17:56:29 +0100
parents 197d23954a4e
children
line wrap: on
line source

module yetilab.matrix.type;

load yetilab.vector.type;

typedef opaque matrix =
    DenseRows. array<vector> | // array of rows
    DenseCols. array<vector> | // array of columns
    SparseCSR. {
        .values is vector,
        .indices is array<number>, // column index of each value
        .pointers is array<number>, // offset of first value in each row
        .extent is number // max possible index + 1, i.e. number of columns
        } |
    SparseCSC. {
        .values is vector,
        .indices is array<number>, // row index of each value
        .pointers is array<number>, // offset of first value in each column
        .extent is number // max pointers index + 1, i.e. number of rows
        };

();