Class BasicUtilsKt

  • All Implemented Interfaces:

    
    public final class BasicUtilsKt
    
                        
    • 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
    • Constructor Detail

    • Method Detail

      • minpos

         final static Integer minpos(DoubleArray v)

        Finds the position of the minimum value in a vector.

        Parameters:
        v - The input vector
        Returns:

        The index (0-based) of the minimum value

      • minpos

         final static IntArray minpos(DoubleArray v, Integer n)

        Finds the positions of the n smallest values in a vector.

        Parameters:
        v - The input vector
        n - The number of smallest elements to find
        Returns:

        Array of indices (0-based) of the n smallest values, sorted by value

      • maxpos

         final static Integer maxpos(DoubleArray v)

        Finds the position of the maximum value in a vector.

        Parameters:
        v - The input vector
        Returns:

        The index (0-based) of the maximum value

      • maxpos

         final static IntArray maxpos(DoubleArray v, Integer n)

        Finds the positions of the n largest values in a vector.

        Parameters:
        v - The input vector
        n - The number of largest elements to find
        Returns:

        Array of indices (0-based) of the n largest values, sorted by value descending

      • logspacei

         final static IntArray logspacei(Double a, Double b, Integer points)

        Generates logarithmically spaced integers in a, b.

        Parameters:
        a - Lower bound
        b - Upper bound
        points - Number of points
        Returns:

        Array of logarithmically spaced integers

      • spectd

         final static SpectralDecomposition spectd(Matrix A)

        Computes the spectral decomposition of a matrix. Returns eigenvalues, eigenvectors, and projectors.

        Parameters:
        A - The input matrix
        Returns:

        SpectralDecomposition containing spectrum, projectors, eigenvectors, and eigenvalue matrix

      • ones

         final static Matrix ones(Integer n)

        Creates a column vector of ones.

        Parameters:
        n - Size of the vector
        Returns:

        Column vector of ones

      • e

         final static Matrix e(Integer n)

        Creates a vector e(n) = 1, 1, ..., 1^T used in matrix operations.

        Parameters:
        n - Size of the vector
        Returns:

        Column vector of ones

      • eye

         final static Matrix eye(Integer n)

        Creates an identity matrix.

        Parameters:
        n - Size of the matrix
        Returns:

        Identity matrix of size n x n

      • zeros

         final static Matrix zeros(Integer m, Integer n)

        Creates a zero matrix.

        Parameters:
        m - Number of rows
        n - Number of columns
        Returns:

        Zero matrix of size m x n