nerdamer-ts
Version:
javascript light-weight symbolic math expression evaluator
19 lines • 701 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.matsetcol = void 0;
const Symbol_1 = require("../../../../Types/Symbol");
const Errors_1 = require("../../../../Core/Errors");
function matsetcol(matrix, j, col) {
//handle symbolics
if (!j.isConstant())
return (0, Symbol_1.symfunction)('matsetcol', arguments);
j = Number(j);
if (matrix.rows() !== col.elements.length)
throw new Errors_1.DimensionError('Matrix columns must match number of columns!');
col.each(function (x, i) {
matrix.set(i - 1, j, x.elements[0].clone());
});
return matrix;
}
exports.matsetcol = matsetcol;
//# sourceMappingURL=matsetcol.js.map