Class FJUtilsKt

  • All Implemented Interfaces:

    
    public final class FJUtilsKt
    
                        
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final static Matrix kronsum(Matrix A, Matrix B) Compute Kronecker sum of two matricesReturns: A ⊕ B = A ⊗ I + I ⊗ B
      final static Integer vectmatch(DoubleArray row, Matrix matrix) Find the row index in a matrix that matches a given row vectorAssumes there is exactly one matching row in the matrix.
      final static Matrix build_index(Integer m, Integer cr) Build combinatorial index patternsGenerates all ways to distribute 'cr' items into 'm' bins.
      final static DoubleArray getRowAsArray(Matrix matrix, Integer row) Extract a row from a Matrix as a DoubleArray
      final static Unit setSubMatrix(Matrix target, Integer startRow, Integer startCol, Matrix source) Copy a submatrix into a target matrix at specified position
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • kronsum

         final static Matrix kronsum(Matrix A, Matrix B)

        Compute Kronecker sum of two matrices

        Returns: A ⊕ B = A ⊗ I + I ⊗ B

        Parameters:
        A - First matrix
        B - Second matrix
        Returns:

        Kronecker sum A ⊕ B

      • vectmatch

         final static Integer vectmatch(DoubleArray row, Matrix matrix)

        Find the row index in a matrix that matches a given row vector

        Assumes there is exactly one matching row in the matrix.

        Parameters:
        row - Row vector to search for
        matrix - Matrix to search in
        Returns:

        1-based index of the matching row, or -1 if not found

      • build_index

         final static Matrix build_index(Integer m, Integer cr)

        Build combinatorial index patterns

        Generates all ways to distribute 'cr' items into 'm' bins. For example, build_index(2, 1) with m=2, cr=1 gives: 0, 1

        Parameters:
        m - Number of bins/phases
        cr - Number of items to distribute
        Returns:

        Matrix where each row is a distribution pattern

      • getRowAsArray

         final static DoubleArray getRowAsArray(Matrix matrix, Integer row)

        Extract a row from a Matrix as a DoubleArray

        Parameters:
        matrix - Source matrix
        row - Row index (0-based)
        Returns:

        Row as DoubleArray

      • setSubMatrix

         final static Unit setSubMatrix(Matrix target, Integer startRow, Integer startCol, Matrix source)

        Copy a submatrix into a target matrix at specified position

        Parameters:
        target - Target matrix to copy into
        startRow - Starting row in target (0-based)
        startCol - Starting column in target (0-based)
        source - Source matrix to copy from