ml-matrix 6.12.1 → 6.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/matrix.d.ts CHANGED
@@ -616,6 +616,26 @@ export abstract class AbstractMatrix {
616
616
  */
617
617
  mmul(other: MaybeMatrix): Matrix;
618
618
 
619
+ /**
620
+ * Returns the Gram matrix `thisᵀ · this` (the `columns × columns` matrix of
621
+ * the dot products of every pair of columns). The result is symmetric, so only
622
+ * its upper triangle is computed and mirrored, and the transpose is never
623
+ * materialized, making it about twice as fast as `this.transpose().mmul(this)`
624
+ * on dense matrices and much faster on sparse ones (zero entries are skipped).
625
+ * For finite inputs the result is identical to `this.transpose().mmul(this)`.
626
+ */
627
+ gram(): Matrix;
628
+
629
+ /**
630
+ * Returns the matrix product between `this` and its transpose (`this · thisᵀ`),
631
+ * optionally weighting each column by `scale` (`this · diag(scale) · thisᵀ`).
632
+ * The result is symmetric, so only its upper triangle is computed and mirrored
633
+ * and the transpose is never materialized, making it about twice as fast as
634
+ * `this.mmul(this.transpose())`.
635
+ * @param scale - Optional per-column factors (length equal to the number of columns).
636
+ */
637
+ mmulByTranspose(scale?: ArrayLike<number>): Matrix;
638
+
619
639
  /**
620
640
  * Returns the square matrix raised to the given power
621
641
  * @param scalar - the non-negative integer power to raise this matrix to
@@ -860,7 +880,7 @@ export abstract class AbstractMatrix {
860
880
  [row: number, column: number, value: number],
861
881
  void,
862
882
  void
863
- >;
883
+ >;
864
884
 
865
885
  /**
866
886
  * iterator from left to right, from top to bottom
@@ -1489,7 +1509,7 @@ export { EigenvalueDecomposition as EVD };
1489
1509
  * The Cholesky decomposition of a matrix. Given a matrix A, the Cholesky Decomposition of A is L
1490
1510
  * such that A = (L)(L.transpose).
1491
1511
  * Only works for symmetric, positive definite matrix A.
1492
- *
1512
+ *
1493
1513
  * @link https://github.com/lutzroeder/Mapack/blob/master/Source/CholeskyDecomposition.cs
1494
1514
  */
1495
1515
  export class CholeskyDecomposition {