org.ejml.ops
Class CRandomMatrices
- java.lang.Object
-
- org.ejml.ops.CRandomMatrices
-
public class CRandomMatrices extends java.lang.ObjectContains a list of functions for creating random dense complex matrices and vectors with different structures.
-
-
Constructor Summary
Constructors Constructor and Description CRandomMatrices()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static CDenseMatrix64FcreateHermitian(int length, double min, double max, java.util.Random rand)Creates a random Hermitian matrix with elements from min to max value.static CDenseMatrix64FcreateHermPosDef(int width, java.util.Random rand)Creates a random symmetric positive definite matrix.static CDenseMatrix64FcreateRandom(int numRow, int numCol, double min, double max, java.util.Random rand)Returns a matrix where all the elements are selected independently from a uniform distribution between 'min' and 'max' inclusive.static CDenseMatrix64FcreateRandom(int numRow, int numCol, java.util.Random rand)Returns a matrix where all the elements are selected independently from a uniform distribution between -1 and 1 inclusive.static voidsetHermitian(CDenseMatrix64F A, double min, double max, java.util.Random rand)Assigns the provided square matrix to be a random Hermitian matrix with elements from min to max value.static voidsetRandom(CD1Matrix64F mat, double min, double max, java.util.Random rand)Sets each element in the matrix to a value drawn from an uniform distribution from 'min' to 'max' inclusive.static voidsetRandom(CDenseMatrix64F mat, java.util.Random rand)Sets each element in the matrix to a value drawn from an uniform distribution from 0 to 1 inclusive.
-
-
-
Method Detail
-
createRandom
public static CDenseMatrix64F createRandom(int numRow, int numCol, java.util.Random rand)
Returns a matrix where all the elements are selected independently from a uniform distribution between -1 and 1 inclusive.
- Parameters:
numRow- Number of rows in the new matrix.numCol- Number of columns in the new matrix.rand- Random number generator used to fill the matrix.- Returns:
- The randomly generated matrix.
-
createRandom
public static CDenseMatrix64F createRandom(int numRow, int numCol, double min, double max, java.util.Random rand)
Returns a matrix where all the elements are selected independently from a uniform distribution between 'min' and 'max' inclusive.
- Parameters:
numRow- Number of rows in the new matrix.numCol- Number of columns in the new matrix.min- The minimum value each element can be.max- The maximum value each element can be.rand- Random number generator used to fill the matrix.- Returns:
- The randomly generated matrix.
-
setRandom
public static void setRandom(CDenseMatrix64F mat, java.util.Random rand)
Sets each element in the matrix to a value drawn from an uniform distribution from 0 to 1 inclusive.
- Parameters:
mat- The matrix who is to be randomized. Modified.rand- Random number generator used to fill the matrix.
-
setRandom
public static void setRandom(CD1Matrix64F mat, double min, double max, java.util.Random rand)
Sets each element in the matrix to a value drawn from an uniform distribution from 'min' to 'max' inclusive.
- Parameters:
min- The minimum value each element can be.max- The maximum value each element can be.mat- The matrix who is to be randomized. Modified.rand- Random number generator used to fill the matrix.
-
createHermPosDef
public static CDenseMatrix64F createHermPosDef(int width, java.util.Random rand)
Creates a random symmetric positive definite matrix.- Parameters:
width- The width of the square matrix it returns.rand- Random number generator used to make the matrix.- Returns:
- The random symmetric positive definite matrix.
-
createHermitian
public static CDenseMatrix64F createHermitian(int length, double min, double max, java.util.Random rand)
Creates a random Hermitian matrix with elements from min to max value.- Parameters:
length- Width and height of the matrix.min- Minimum value an element can have.max- Maximum value an element can have.rand- Random number generator.- Returns:
- A symmetric matrix.
-
setHermitian
public static void setHermitian(CDenseMatrix64F A, double min, double max, java.util.Random rand)
Assigns the provided square matrix to be a random Hermitian matrix with elements from min to max value.- Parameters:
A- The matrix that is to be modified. Must be square. Modified.min- Minimum value an element can have.max- Maximum value an element can have.rand- Random number generator.
-
-
DMelt 3.0 © DataMelt by jWork.ORG