Class BasicUtils

java.lang.Object
jline.lib.kpctoolbox.basic.BasicUtils

public final class BasicUtils extends Object
Basic utility functions for the KPC-Toolbox. Ported from MATLAB: matlab/lib/kpctoolbox/basic/
  • Method Summary

    Modifier and Type
    Method
    Description
    static Matrix
    e(int n)
    Creates a vector e(n) = [1, 1, ..., 1]^T used in matrix operations.
    static Matrix
    eye(int n)
    Creates an identity matrix.
    static int[]
    logspacei(double a, double b, int points)
    Generates logarithmically spaced integers in [a, b].
    static int
    maxpos(double[] v)
    Finds the position of the maximum value in a vector.
    static int[]
    maxpos(double[] v, int n)
    Finds the positions of the n largest values in a vector.
    static int
    minpos(double[] v)
    Finds the position of the minimum value in a vector.
    static int[]
    minpos(double[] v, int n)
    Finds the positions of the n smallest values in a vector.
    static Matrix
    ones(int n)
    Creates a column vector of ones.
    Computes the spectral decomposition of a matrix.
    static Matrix
    zeros(int m, int n)
    Creates a zero matrix.

    Methods inherited from class java.lang.Object

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

    • minpos

      public static int minpos(double[] v)
      Finds the position of the minimum value in a vector.
    • minpos

      public static int[] minpos(double[] v, int n)
      Finds the positions of the n smallest values in a vector.
    • maxpos

      public static int maxpos(double[] v)
      Finds the position of the maximum value in a vector.
    • maxpos

      public static int[] maxpos(double[] v, int n)
      Finds the positions of the n largest values in a vector.
    • logspacei

      public static int[] logspacei(double a, double b, int points)
      Generates logarithmically spaced integers in [a, b].
    • spectd

      public static SpectralDecomposition spectd(Matrix A)
      Computes the spectral decomposition of a matrix. Returns eigenvalues, eigenvectors, and projectors.
    • ones

      public static Matrix ones(int n)
      Creates a column vector of ones.
    • e

      public static Matrix e(int n)
      Creates a vector e(n) = [1, 1, ..., 1]^T used in matrix operations.
    • eye

      public static Matrix eye(int n)
      Creates an identity matrix.
    • zeros

      public static Matrix zeros(int m, int n)
      Creates a zero matrix.