node/dlpa/lib/dlpa.js
function matrix(rows, columns, values) {
    // console.log(values);
    const res = [];
    let row = [];
    let real;
    values.forEach((v, i) => {
        if (i % 2 == 0) {
            real = v;
        } else {
            row.push({
                real: real,
                imag: v
            });
            if ((i + 1) / 2 % columns == 0) {
                res.push(row);
                row = [];
            }
        }
    });
    return res;
}
function matrix(rows, columns, values) {
    // console.log(values);
    const res = [];
    let row = [];
    let real;
    values.forEach((v, i) => {
        if (i % 2 == 0) {
            real = v;
        } else {
            row.push({
                real: real,
                imag: v
            });
            if ((i + 1) / 2 % columns == 0) {
                res.push(row);
                row = [];
            }
        }
    });
    return res;
}
function matrix ( rows , columns , values ) { // console.log(values); const res = [ ] ; let row = [ ] ; let real ; values . forEach ( ( v , i ) => { if ( i % 2 == 0 ) { real = v ; } else { row . push ( { real : real , imag : v } ) ; if ( ( i + 1 ) / 2 % columns == 0 ) { res . push ( row ) ; row = [ ] ; } } } ) ; return res ; }
matrix returns a matrix of which values are given ones.
matrix returns a matrix of which values are given ones .