NK
export function createMatrix(rows: i32, cols: i32): f64[][] {
const data = new Array<f64[]|null>(rows);
for (let i = 0; i < rows; i++) {
data[i] = new Array<f64>(cols);
for (let j = 0; j < cols; j++) {
data[i][j] = Math.random() * 2 - 1;
}
}
return data as f64[][];
}
https://webassembly.studio/?f=v97zqx1s4pc
export function createMatrix(rows: i32, cols: i32): f64[][] {
const data: f64[][] = [];
for (let i = 0; i < rows; i++) {
data.push(new Array<f64>(cols));
for (let j = 0; j < cols; j++) {
data[i][j] = Math.random() * 2 - 1;
}
}
return data;
}