Package jline.lib.kpctoolbox.basic
Class BasicUtils
java.lang.Object
jline.lib.kpctoolbox.basic.BasicUtils
Basic utility functions for the KPC-Toolbox.
Ported from MATLAB: matlab/lib/kpctoolbox/basic/
-
Method Summary
Modifier and TypeMethodDescriptionstatic Matrixe(int n) Creates a vector e(n) = [1, 1, ..., 1]^T used in matrix operations.static Matrixeye(int n) Creates an identity matrix.static int[]logspacei(double a, double b, int points) Generates logarithmically spaced integers in [a, b].static intmaxpos(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 intminpos(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 Matrixones(int n) Creates a column vector of ones.static SpectralDecompositionComputes the spectral decomposition of a matrix.static Matrixzeros(int m, int n) Creates a zero matrix.
-
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
Computes the spectral decomposition of a matrix. Returns eigenvalues, eigenvectors, and projectors. -
ones
Creates a column vector of ones. -
e
Creates a vector e(n) = [1, 1, ..., 1]^T used in matrix operations. -
eye
Creates an identity matrix. -
zeros
Creates a zero matrix.
-