jax-js
    Preparing search index...
    • Compute the Cholesky decomposition of a symmetric positive-definite matrix.

      The Cholesky decomposition of a matrix A is:

      • A = L @ L^T (for upper=false, default)
      • A = U^T @ U (for upper=true)

      where L is a lower-triangular matrix and U is an upper-triangular matrix. The input matrix must be symmetric and positive-definite.

      Parameters

      • a: ArrayLike
      • __namedParameters: { upper?: boolean } = {}

      Returns Array

      import { lax, numpy as np } from "@jax-js/jax";

      const x = np.array([[2., 1.], [1., 2.]]);

      // Lower Cholesky factorization (default):
      const L = lax.linalg.cholesky(x);
      // L ≈ [[1.4142135, 0], [0.70710677, 1.2247449]]

      // Upper Cholesky factorization:
      const U = lax.linalg.cholesky(x, { upper: true });
      // U ≈ [[1.4142135, 0.70710677], [0, 1.2247449]]