UNPKG

nowjs-core

Version:

NowCanDo Javascript Core [nowjs-core] is a library written by TypeScript code maintains under Apache 2.0 licence

39 lines (38 loc) 1.23 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const index_1 = require("../../exceptions/index"); const index_2 = require("./index"); class NumericIdentityMatrix extends index_2.NumericMatrix { constructor(size = 2) { super(size, size); this.arr = []; for (let i = 0; i < size; i++) { this.arr.push([]); for (let j = 0; j < size; j++) { this.arr[i].push(i === j ? 1 : 0); } } } add(other) { throw new index_1.Exception('Operation is not permitted.'); } subtract(other) { throw new index_1.Exception('Operation is not permitted.'); } multiply(other) { throw new index_1.Exception('Operation is not permitted.'); } divide(other) { throw new index_1.Exception('Operation is not permitted.'); } power(other) { throw new index_1.Exception('Operation is not permitted.'); } dotProduct(other) { throw new index_1.Exception('Operation is not permitted.'); } set(value, row, col) { throw new index_1.Exception('Operation is not permitted.'); } } exports.NumericIdentityMatrix = NumericIdentityMatrix;