Change tabs to spaces.

This commit is contained in:
Stephen Chung
2021-05-24 12:12:16 +08:00
parent 98a232cb8c
commit aa8dee6460
4 changed files with 88 additions and 88 deletions

View File

@@ -1,13 +1,13 @@
const SIZE = 50;
fn new_mat(x, y) {
let row = [];
row.pad(y, 0.0);
let matrix = [];
matrix.pad(x, row);
matrix
let row = [];
row.pad(y, 0.0);
let matrix = [];
matrix.pad(x, row);
matrix
}
fn mat_gen() {
@@ -20,13 +20,13 @@ fn mat_gen() {
m[i][j] = tmp * (i - j) * (i + j);
}
}
m
}
fn mat_mul(a, b) {
let b2 = new_mat(a[0].len, b[0].len);
for i in range(0, a[0].len) {
for j in range(0, b[0].len) {
b2[j][i] = b[i][j];
@@ -35,13 +35,13 @@ fn mat_mul(a, b) {
let c = new_mat(a.len, b[0].len);
for i in range(0, c.len) {
for j in range(0, c[i].len) {
c[i][j] = 0.0;
for z in range(0, a[i].len) {
c[i][j] += a[i][z] * b2[j][z];
}
for i in range(0, c.len) {
for j in range(0, c[i].len) {
c[i][j] = 0.0;
for z in range(0, a[i].len) {
c[i][j] += a[i][z] * b2[j][z];
}
}
}
@@ -56,7 +56,7 @@ const c = mat_mul(a, b);
/*
for i in range(0, SIZE) {
print(c[i]);
print(c[i]);
}
*/