-
Notifications
You must be signed in to change notification settings - Fork 0
Matrix
Calculus_is_fun edited this page Aug 28, 2024
·
18 revisions
the number of columns this matrix will have.
The values in the matrix in reading order of LTR. can be Numbers, BigInts, or Rationals. They all get converted to Rationals.
let A = new Matrix(2, [1, 2, 3, 4]);
If indices is the string "identity", creates an identity matrix of given size.
adds argument to this element-wise
let A = new Matrix(2, [1n, 3n, 4n, new Rational(5n, 2n)]);
let B = new Matrix(2, [new Rational(1n, 2n), 1n, 4n, -1n]);
A.add(B);
A=
let A = new Matrix(2, [1, 2, new Rational(2n,3n), 10]);
console.log(A.toLatex()); // "\begin{bmatrix}1&2\\\frac{2}{3}&10\end{bmatrix}"