Package org.ejml
Class UtilEjml
- java.lang.Object
-
- org.ejml.UtilEjml
-
public class UtilEjml extends java.lang.ObjectVarious functions that are useful but don't have a clear location that they belong in.
-
-
Field Summary
Fields Modifier and Type Field Description static doubleEPSstatic floatF_EPSstatic floatF_PIstatic floatF_PI2static floatF_PId2static intmaxInverseSizestatic doublePIstatic doublePI2static doublePId2static floatTEST_F32static floatTEST_F32_SQstatic doubleTEST_F64static doubleTEST_F64_SQstatic floatTESTP_F32static doubleTESTP_F64
-
Constructor Summary
Constructors Constructor Description UtilEjml()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static double[]adjust(DGrowArray gwork, int desired)Resizes the array to ensure that it is at least of length desired and returns its internal arraystatic float[]adjust(FGrowArray gwork, int desired)Resizes the array to ensure that it is at least of length desired and returns its internal arraystatic int[]adjust(IGrowArray gwork, int desired)Resizes the array to ensure that it is at least of length desired and returns its internal arraystatic int[]adjust(IGrowArray gwork, int desired, int zeroToM)static int[]adjustClear(IGrowArray gwork, int desired)static voidcheckSameInstance(java.lang.Object a, java.lang.Object b)static voidcheckSameShape(Matrix a, Matrix b, boolean allowedSameInstance)static voidcheckSameShape(Matrix a, Matrix b, Matrix c)static voidcheckTooLarge(int rows, int cols)static voidcheckTooLargeComplex(int rows, int cols)static java.lang.StringfancyString(double value, java.text.DecimalFormat format, boolean hasSpace, int length, int significant)static java.lang.StringfancyString(double value, java.text.DecimalFormat format, int length, int significant)static java.lang.StringfancyStringF(double value, java.text.DecimalFormat format, int length, int significant)Fixed length fancy formatting for doubles.static booleanisIdentical(double a, double b, double tol)static booleanisIdentical(float a, float b, float tol)static booleanisUncountable(double val)static booleanisUncountable(float val)static doublemax(double[] array, int start, int length)static floatmax(float[] array, int start, int length)static voidmemset(double[] data, double val, int length)static voidmemset(int[] data, int val, int length)static DMatrixRMajparse_DDRM(java.lang.String s, int numColumns)Give a string of numbers it returns a DenseMatrixstatic DMatrixSparseCSCparse_DSCC(java.lang.String s, int numColumns)static FMatrixRMajparse_FDRM(java.lang.String s, int numColumns)Give a string of numbers it returns a DenseMatrixstatic FMatrixSparseCSCparse_FSCC(java.lang.String s, int numColumns)static intpermutationSign(int[] p, int N, int[] work)static int[]pivotVector(int[] pivots, int length, IGrowArray storage)static float[]randomVector_F32(java.util.Random rand, int length)static double[]randomVector_F64(java.util.Random rand, int length)static <S extends Matrix,D extends Matrix>
LinearSolver<S,D>safe(LinearSolver<S,D> solver)Wraps a linear solver of any type with a safe solver the ensures inputs are not modifiedstatic <D extends ReshapeMatrix>
LinearSolverDense<D>safe(LinearSolverDense<D> solver)static <T> voidsetnull(T[] array)static voidshuffle(int[] list, int N, int start, int end, java.util.Random rand)static int[]shuffled(int N, int shuffleUpTo, java.util.Random rand)static int[]shuffled(int N, java.util.Random rand)static int[]shuffledSorted(int N, int shuffleUpTo, java.util.Random rand)static java.lang.Integer[]sortByIndex(double[] data, int size)static java.lang.StringstringShapes(Matrix A, Matrix B)static java.lang.StringstringShapes(Matrix A, Matrix B, Matrix C)
-
-
-
Field Detail
-
EPS
public static double EPS
-
F_EPS
public static float F_EPS
-
PI
public static double PI
-
PI2
public static double PI2
-
PId2
public static double PId2
-
F_PI
public static float F_PI
-
F_PI2
public static float F_PI2
-
F_PId2
public static float F_PId2
-
TEST_F32
public static float TEST_F32
-
TEST_F64
public static double TEST_F64
-
TESTP_F32
public static float TESTP_F32
-
TESTP_F64
public static double TESTP_F64
-
TEST_F32_SQ
public static float TEST_F32_SQ
-
TEST_F64_SQ
public static double TEST_F64_SQ
-
maxInverseSize
public static int maxInverseSize
-
-
Method Detail
-
checkSameInstance
public static void checkSameInstance(java.lang.Object a, java.lang.Object b)
-
safe
public static <S extends Matrix,D extends Matrix> LinearSolver<S,D> safe(LinearSolver<S,D> solver)
Wraps a linear solver of any type with a safe solver the ensures inputs are not modified
-
safe
public static <D extends ReshapeMatrix> LinearSolverDense<D> safe(LinearSolverDense<D> solver)
-
checkTooLarge
public static void checkTooLarge(int rows, int cols)
-
checkTooLargeComplex
public static void checkTooLargeComplex(int rows, int cols)
-
isUncountable
public static boolean isUncountable(double val)
-
isUncountable
public static boolean isUncountable(float val)
-
isIdentical
public static boolean isIdentical(double a, double b, double tol)
-
isIdentical
public static boolean isIdentical(float a, float b, float tol)
-
memset
public static void memset(double[] data, double val, int length)
-
memset
public static void memset(int[] data, int val, int length)
-
setnull
public static <T> void setnull(T[] array)
-
max
public static double max(double[] array, int start, int length)
-
max
public static float max(float[] array, int start, int length)
-
parse_DDRM
public static DMatrixRMaj parse_DDRM(java.lang.String s, int numColumns)
Give a string of numbers it returns a DenseMatrix
-
parse_FDRM
public static FMatrixRMaj parse_FDRM(java.lang.String s, int numColumns)
Give a string of numbers it returns a DenseMatrix
-
sortByIndex
public static java.lang.Integer[] sortByIndex(double[] data, int size)
-
parse_DSCC
public static DMatrixSparseCSC parse_DSCC(java.lang.String s, int numColumns)
-
parse_FSCC
public static FMatrixSparseCSC parse_FSCC(java.lang.String s, int numColumns)
-
shuffled
public static int[] shuffled(int N, java.util.Random rand)
-
shuffled
public static int[] shuffled(int N, int shuffleUpTo, java.util.Random rand)
-
shuffledSorted
public static int[] shuffledSorted(int N, int shuffleUpTo, java.util.Random rand)
-
shuffle
public static void shuffle(int[] list, int N, int start, int end, java.util.Random rand)
-
pivotVector
public static int[] pivotVector(int[] pivots, int length, IGrowArray storage)
-
permutationSign
public static int permutationSign(int[] p, int N, int[] work)
-
randomVector_F64
public static double[] randomVector_F64(java.util.Random rand, int length)
-
randomVector_F32
public static float[] randomVector_F32(java.util.Random rand, int length)
-
fancyStringF
public static java.lang.String fancyStringF(double value, java.text.DecimalFormat format, int length, int significant)Fixed length fancy formatting for doubles. If possible decimal notation is used. If all the significant digits can't be shown then it will switch to exponential notation. If not all the space is needed then it will be filled in to ensure it has the specified length.- Parameters:
value- value being formattedformat- default format before exponentiallength- Maximum number of characters it can take.significant- Number of significant decimal digits to show at a minimum.- Returns:
- formatted string
-
fancyString
public static java.lang.String fancyString(double value, java.text.DecimalFormat format, int length, int significant)
-
fancyString
public static java.lang.String fancyString(double value, java.text.DecimalFormat format, boolean hasSpace, int length, int significant)
-
adjust
public static int[] adjust(IGrowArray gwork, int desired)
Resizes the array to ensure that it is at least of length desired and returns its internal array
-
adjust
public static int[] adjust(IGrowArray gwork, int desired, int zeroToM)
-
adjustClear
public static int[] adjustClear(IGrowArray gwork, int desired)
-
adjust
public static double[] adjust(DGrowArray gwork, int desired)
Resizes the array to ensure that it is at least of length desired and returns its internal array
-
adjust
public static float[] adjust(FGrowArray gwork, int desired)
Resizes the array to ensure that it is at least of length desired and returns its internal array
-
-