view yetilab/matrix/type.yeti @ 277:678477bf617c

(clumsily) make slice functions handle out-of-range arguments properly
author Chris Cannam
date Sat, 25 May 2013 18:41:53 +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
        };

();