|
@@ -1,7 +1,7 @@
|
|
|
-const kronecker = function(target, mold) {
|
|
|
- const result = [[Math.ceil(target[0] / mold[0]), Math.ceil(target[1] / mold[1])],
|
|
|
- [((target[0] - 1) % mold[0]) + 1, ((target[1] - 1) % mold[1]) + 1]];
|
|
|
-
|
|
|
+const kronecker = function(target, mask) {
|
|
|
+ const result = [[Math.ceil(target[0] / mask[0]), Math.ceil(target[1] / mask[1])],
|
|
|
+ [((target[0] - 1) % mask[0]) + 1, ((target[1] - 1) % mask[1]) + 1]];
|
|
|
+
|
|
|
var quadrant = result[0].join("");
|
|
|
switch (quadrant) {
|
|
|
case "11": quadrant = "00"; break;
|
|
@@ -10,10 +10,10 @@ const kronecker = function(target, mold) {
|
|
|
case "22": quadrant = "11"; break;
|
|
|
}
|
|
|
|
|
|
- if (mold[0] == 2)
|
|
|
+ if (mask[0] == 1)
|
|
|
return quadrant;
|
|
|
|
|
|
- return (quadrant + kronecker(result[1], [mold[0] / 2, mold[1] / 2]));
|
|
|
+ return (quadrant + kronecker(result[1], [mask[0] / 2, mask[1] / 2]));
|
|
|
}
|
|
|
|
|
|
const dotProduct = function(U, V) {
|