Class LalMamNum

java.lang.Object
jline.solvers.mam.lal.LalMamNum

public final class LalMamNum extends Object
Dense numeric helpers for the LAL matrix-analytic lowerings, on double[][] so that every step is the numpy expression of the Python solver_mam/lal_*.py modules.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final long
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static double[][]
    add(double[][] a, double[][] b)
     
    static void
    addInPlace(double[][] a, double[][] b)
     
    static int[][]
    adjacency(double[][] q)
    Adjacency lists of the positive off-diagonal entries of a dense matrix.
    static int[][]
    adjacency(int n, List<int[]> edges)
    Adjacency lists from edge lists (self-loops kept, which do not affect SCCs).
    static boolean
    allclose(double[][] a, double[][] b, double rtol, double atol)
    numpy.allclose(a, b, rtol, atol).
    static boolean
    allclose(double[] a, double[] b, double rtol, double atol)
     
    static boolean
    allFinite(double[] a)
     
    static boolean
    allFinite(double[][] a)
     
    static double[][]
    blockDiag(List<double[][]> blocks)
    Block-diagonal concatenation.
    static double[][]
    copy(double[][] a)
     
    static int
    count(int[] comp)
     
    static double
    dot(double[] a, double[] b)
     
    static double[][]
    eye(int n)
     
    static double[][][]
     
    static double[][][]
     
    static String
    g(double x)
    Python format(x, 'g'): six significant digits, trailing zeros removed.
    static double[][]
    inv(double[][] a)
    Inverse via LU; throws ArithmeticException when singular.
    static boolean
    irreducible(double[][] q)
    One strongly connected component over the positive off-diagonal entries.
    static boolean
    isclose(double a, double b, double rtol, double atol)
    numpy.isclose: NaN never equals NaN.
    static double[][]
    kron(double[][] a, double[][] b)
     
    static List<String>
    list(String... xs)
     
    static double
    maxAbs(double[] a)
     
    static double
    maxAbs(double[][] a)
     
    static double
    min(double[] a)
     
    static double
    min(double[][] a)
     
    static double
    minEigSym(double[][] a)
    Smallest eigenvalue of a symmetric matrix.
    static boolean
    mmapIsFeasible(double[][][] mmap)
     
    static boolean
    mmapIsFeasible(double[][][] mmap, double tol)
    Python mmap_isfeasible(mmap, tol).
    static double[][][]
    mmapNormalize(double[][][] mmap)
    Python mmap_normalize on a [D0, D1, D11, ...] list (copies).
    static double[][][]
    mmapSuper(double[][][] a, double[][][] b)
    Python mmap_super(a, b, opt='default'), normalised.
    static double[][]
    mul(double[][] a, double[][] b)
     
    static double[]
    mv(double[][] a, double[] v)
    Matrix times column vector.
    static double
    normInf(double[][] a)
    Infinity norm (max absolute row sum).
    static double[][]
    qbdRLogred(double[][] b, double[][] l, double[][] f, int iterMax, double tol)
    Logarithmic reduction for the QBD rate matrix with an explicit tolerance (Python qbd_R_logred(B, L, F, iter_max, tol)); the JAR's Qbd_R_logred fixes the tolerance at 1e-12.
    refuse(String kind, String message)
    A refusal with id LINE:unsupported:<kind>.
    refuse(String kind, String message, Throwable cause)
     
    static double[]
    rowSums(double[][] a)
     
    static long
    satMul(long a, long b)
    Product of sizes, saturating at Long.MAX_VALUE.
    static double[][]
    scale(double[][] a, double s)
     
    static int[]
    scc(int[][] adj)
    Iterative Tarjan labelling of the strongly connected components.
    static double[]
    solve(double[][] a, double[] b)
     
    static double[][]
    solve(double[][] a, double[][] b)
    Solve A X = B; throws ArithmeticException when singular.
    static double
    spectralRadius(double[][] a)
    Largest eigenvalue modulus.
    static double[]
    stationaryGenerator(double[][] generator)
    Solve a uniquely stationary generator with scale-free balance rows (Python lal_qbd.stationary_generator).
    static double[][]
    sub(double[][] a, double[][] b)
     
    static double
    sum(double[] a)
     
    static double
    sum(double[][] a)
     
    static double[][]
     
    static MatrixCell
    toCell(double[][][] mmap)
     
    static Matrix[]
    toMatrices(double[][][] mmap)
     
    static Matrix
    toMatrix(double[][] a)
     
    static double[][]
    transpose(double[][] a)
     
    static boolean
    uniqueClosedClass(int[][] adj)
    Python unique_closed_class: exactly one closed communicating class.
    static double[]
    vm(double[] v, double[][] a)
    Row vector times matrix.
    static double[][]
    zeros(int n, int m)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Method Details

    • refuse

      public static LineUnsupportedException refuse(String kind, String message)
      A refusal with id LINE:unsupported:<kind>.
    • refuse

      public static LineUnsupportedException refuse(String kind, String message, Throwable cause)
    • g

      public static String g(double x)
      Python format(x, 'g'): six significant digits, trailing zeros removed.
    • zeros

      public static double[][] zeros(int n, int m)
    • eye

      public static double[][] eye(int n)
    • copy

      public static double[][] copy(double[][] a)
    • add

      public static double[][] add(double[][] a, double[][] b)
    • sub

      public static double[][] sub(double[][] a, double[][] b)
    • scale

      public static double[][] scale(double[][] a, double s)
    • addInPlace

      public static void addInPlace(double[][] a, double[][] b)
    • mul

      public static double[][] mul(double[][] a, double[][] b)
    • vm

      public static double[] vm(double[] v, double[][] a)
      Row vector times matrix.
    • mv

      public static double[] mv(double[][] a, double[] v)
      Matrix times column vector.
    • dot

      public static double dot(double[] a, double[] b)
    • sum

      public static double sum(double[] a)
    • sum

      public static double sum(double[][] a)
    • rowSums

      public static double[] rowSums(double[][] a)
    • transpose

      public static double[][] transpose(double[][] a)
    • kron

      public static double[][] kron(double[][] a, double[][] b)
    • maxAbs

      public static double maxAbs(double[][] a)
    • maxAbs

      public static double maxAbs(double[] a)
    • normInf

      public static double normInf(double[][] a)
      Infinity norm (max absolute row sum).
    • allFinite

      public static boolean allFinite(double[][] a)
    • allFinite

      public static boolean allFinite(double[] a)
    • min

      public static double min(double[][] a)
    • min

      public static double min(double[] a)
    • allclose

      public static boolean allclose(double[][] a, double[][] b, double rtol, double atol)
      numpy.allclose(a, b, rtol, atol).
    • allclose

      public static boolean allclose(double[] a, double[] b, double rtol, double atol)
    • isclose

      public static boolean isclose(double a, double b, double rtol, double atol)
      numpy.isclose: NaN never equals NaN.
    • solve

      public static double[][] solve(double[][] a, double[][] b)
      Solve A X = B; throws ArithmeticException when singular.
    • solve

      public static double[] solve(double[][] a, double[] b)
    • inv

      public static double[][] inv(double[][] a)
      Inverse via LU; throws ArithmeticException when singular.
    • stationaryGenerator

      public static double[] stationaryGenerator(double[][] generator)
      Solve a uniquely stationary generator with scale-free balance rows (Python lal_qbd.stationary_generator). The generator is divided by its largest entry, each balance row is scaled by its own largest entry and the last row is replaced by the normalization.
    • spectralRadius

      public static double spectralRadius(double[][] a)
      Largest eigenvalue modulus.
    • adjacency

      public static int[][] adjacency(double[][] q)
      Adjacency lists of the positive off-diagonal entries of a dense matrix.
    • adjacency

      public static int[][] adjacency(int n, List<int[]> edges)
      Adjacency lists from edge lists (self-loops kept, which do not affect SCCs).
    • scc

      public static int[] scc(int[][] adj)
      Iterative Tarjan labelling of the strongly connected components.
    • count

      public static int count(int[] comp)
    • uniqueClosedClass

      public static boolean uniqueClosedClass(int[][] adj)
      Python unique_closed_class: exactly one closed communicating class.
    • irreducible

      public static boolean irreducible(double[][] q)
      One strongly connected component over the positive off-diagonal entries.
    • mmapNormalize

      public static double[][][] mmapNormalize(double[][][] mmap)
      Python mmap_normalize on a [D0, D1, D11, ...] list (copies).
    • mmapSuper

      public static double[][][] mmapSuper(double[][][] a, double[][][] b)
      Python mmap_super(a, b, opt='default'), normalised.
    • mmapIsFeasible

      public static boolean mmapIsFeasible(double[][][] mmap, double tol)
      Python mmap_isfeasible(mmap, tol).
    • mmapIsFeasible

      public static boolean mmapIsFeasible(double[][][] mmap)
    • toMatrix

      public static Matrix toMatrix(double[][] a)
    • toArray

      public static double[][] toArray(Matrix m)
    • toCell

      public static MatrixCell toCell(double[][][] mmap)
    • fromCell

      public static double[][][] fromCell(MatrixCell cell)
    • fromArray

      public static double[][][] fromArray(Matrix[] arr)
    • toMatrices

      public static Matrix[] toMatrices(double[][][] mmap)
    • qbdRLogred

      public static double[][] qbdRLogred(double[][] b, double[][] l, double[][] f, int iterMax, double tol)
      Logarithmic reduction for the QBD rate matrix with an explicit tolerance (Python qbd_R_logred(B, L, F, iter_max, tol)); the JAR's Qbd_R_logred fixes the tolerance at 1e-12.
    • blockDiag

      public static double[][] blockDiag(List<double[][]> blocks)
      Block-diagonal concatenation.
    • minEigSym

      public static double minEigSym(double[][] a)
      Smallest eigenvalue of a symmetric matrix.
    • list

      public static List<String> list(String... xs)
    • satMul

      public static long satMul(long a, long b)
      Product of sizes, saturating at Long.MAX_VALUE.