本文整理汇总了Java中org.ejml.data.DenseMatrix64F类的典型用法代码示例。如果您正苦于以下问题:Java DenseMatrix64F类的具体用法?Java DenseMatrix64F怎么用?Java DenseMatrix64F使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DenseMatrix64F类属于org.ejml.data包,在下文中一共展示了DenseMatrix64F类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getEigenvectors
import org.ejml.data.DenseMatrix64F; //导入依赖的package包/类
/**
* Calculates a List of eigenvalues and eigenvectors from the provided 3x3 (covariance) matrix.
*
* @param matrix 3x3 Matrix to derive the eigenvalues and eigenvectors from.
* @return List of pairs containing both the eigenvalues and the eigenvectors. The entries are
* sorted in ascending order of the eigenvalue.
*/
private static List<Pair<Float,Vector3f>> getEigenvectors(DenseMatrix64F matrix) {
List<Pair<Float,Vector3f>> eigenvectors = new ArrayList<>();
EigenDecomposition<DenseMatrix64F> eig = DecompositionFactory.eig(3, true);
eig.decompose(matrix);
int eigValNum = eig.getNumberOfEigenvalues();
for(int i = 0; i < eigValNum; i++){
DenseMatrix64F eigMat = eig.getEigenVector(i);
if(eigMat != null){
eigenvectors.add(new Pair<>((float)eig.getEigenvalue(i).getReal(), new Vector3f((float)eigMat.get(0,0), (float)eigMat.get(1,0), (float)eigMat.get(2,0))));
}
}
eigenvectors.sort(Comparator.comparing(e -> e.first));
return eigenvectors;
}
示例2: MatrixFormulation
import org.ejml.data.DenseMatrix64F; //导入依赖的package包/类
private MatrixFormulation() {
int numRows = response.length;
int numCols = predictors.length + ((hasIntercept) ? 1 : 0);
this.X = createMatrixA(numRows, numCols);
this.Xt = new DenseMatrix64F(numCols, numRows);
CommonOps.transpose(X, Xt);
this.XtXInv = new DenseMatrix64F(numCols, numCols);
this.b = new DenseMatrix64F(numCols, 1);
this.y = new DenseMatrix64F(numRows, 1);
solveSystem(numRows, numCols);
this.fitted = computeFittedValues();
this.residuals = computeResiduals();
this.sigma2 = estimateSigma2(numCols);
this.covarianceMatrix = new DenseMatrix64F(numCols, numCols);
CommonOps.scale(sigma2, XtXInv, covarianceMatrix);
}
示例3: ArmaKalmanFilter
import org.ejml.data.DenseMatrix64F; //导入依赖的package包/类
ArmaKalmanFilter(final ArmaStateSpace ss) {
this.y = ss.differencedSeries();
this.r = ss.r();
this.transitionFunction = new DenseMatrix64F(ss.transitionMatrix());
final RowD1Matrix64F R = new DenseMatrix64F(r, 1, true, ss.movingAverageVector());
this.stateDisturbance = new DenseMatrix64F(r, r);
multOuter(R, stateDisturbance);
this.predictedState = new DenseMatrix64F(r, 1, true, new double[r]);
this.filteredState = new DenseMatrix64F(r, 1, true, new double[r]);
this.predictedStateCovariance = initializePredictedCovariance(ss);
this.filteredStateCovariance = new DenseMatrix64F(r, r);
this.predictionErrorVariance = new double[y.length];
this.predictionError = new double[y.length];
this.predictedCovarianceFirstColumn = new DenseMatrix64F(r, 1);
extractColumn(predictedStateCovariance, 0, predictedCovarianceFirstColumn);
this.kalmanOutput = filter();
}
示例4: ArimaKalmanFilter
import org.ejml.data.DenseMatrix64F; //导入依赖的package包/类
ArimaKalmanFilter(final ArimaStateSpace ss) {
this.y = ss.observations();
this.r = ss.r();
this.d = ss.d();
this.rd = r + d;
this.transitionMatrix = new DenseMatrix64F(ss.transitionMatrix());
final RowD1Matrix64F R = new DenseMatrix64F(rd, 1, true, ss.movingAverageVector());
this.stateDisturbance = new DenseMatrix64F(rd, rd);
multOuter(R, stateDisturbance);
this.predictedState = new DenseMatrix64F(rd, 1, true, new double[rd]);
this.filteredState = new DenseMatrix64F(rd, 1, true, new double[rd]);
this.predictedStateCovariance = initializePredictedCovariance(ss);
this.filteredStateCovariance = new DenseMatrix64F(rd, rd);
this.predictionErrorVariance = new double[y.length];
this.predictionError = new double[y.length];
this.Z = new DenseMatrix64F(1, rd, true, ss.stateEffectsVector());
this.Zt = new DenseMatrix64F(rd, 1, true, new double[rd]);
this.ZP = new DenseMatrix64F(1, rd, true, new double[rd]);
this.PZtf = new DenseMatrix64F(rd, 1, true, new double[rd]);
this.PZtfZ = new DenseMatrix64F(rd, rd, true, new double[rd * rd]);
this.kalmanOutput = filter();
}
示例5: F15
import org.ejml.data.DenseMatrix64F; //导入依赖的package包/类
public F15(int d) {
super(d, 15);
name = "F15 D/m-group Shifted and m-rotated Rastrigin's Function";
P = new int[numberOfDimensions];
P = Util.randomPermutation(numberOfDimensions);
OShift = new double[numberOfDimensions];
for (int i=0; i<numberOfDimensions; i++){
OShift[i] = Util.nextDouble(lowerLimit.get(i),upperLimit.get(i));
}
M = new double[m*m];
DenseMatrix64F A = RandomMatrices.createOrthogonal(m, m, Util.rnd);
for (int i=0; i<m; i++){
for (int j=0; j<m; j++){
M[i * m + j] = A.get(i, j);
}
}
}
示例6: F17
import org.ejml.data.DenseMatrix64F; //导入依赖的package包/类
public F17(int d) {
super(d, 17);
name = "F17 D/m-group Shifted and m-dimensional Schwefel's Problem 1.2";
P = new int[numberOfDimensions];
P = Util.randomPermutation(numberOfDimensions);
OShift = new double[numberOfDimensions];
for (int i=0; i<numberOfDimensions; i++){
OShift[i] = Util.nextDouble(lowerLimit.get(i),upperLimit.get(i));
}
M = new double[m*m];
DenseMatrix64F A = RandomMatrices.createOrthogonal(m, m, Util.rnd);
for (int i=0; i<m; i++){
for (int j=0; j<m; j++){
M[i * m + j] = A.get(i, j);
}
}
}
示例7: F4
import org.ejml.data.DenseMatrix64F; //导入依赖的package包/类
public F4(int d) {
super(d, 4);
name = "F04 Single-group Shifted and m-rotated Elliptic Function";
P = new int[numberOfDimensions];
P = Util.randomPermutation(numberOfDimensions);
OShift = new double[numberOfDimensions];
for (int i=0; i<numberOfDimensions; i++){
OShift[i] = i;
}
M = new double[m*m];
DenseMatrix64F A = RandomMatrices.createOrthogonal(m, m, Util.rnd);
for (int i=0; i<m; i++){
for (int j=0; j<m; j++){
M[i * m + j] = A.get(i, j);
}
}
}
示例8: F20
import org.ejml.data.DenseMatrix64F; //导入依赖的package包/类
public F20(int d) {
super(d, 20);
name = "F20 Shifted Rosenbrock's Function";
OShift = new double[numberOfDimensions];
for (int i=0; i<numberOfDimensions; i++){
OShift[i] = Util.nextDouble(lowerLimit.get(i),upperLimit.get(i));
}
M = new double[m*m];
DenseMatrix64F A = RandomMatrices.createOrthogonal(m, m, Util.rnd);
for (int i=0; i<m; i++){
for (int j=0; j<m; j++){
M[i * m + j] = A.get(i, j);
}
}
}
示例9: F7
import org.ejml.data.DenseMatrix64F; //导入依赖的package包/类
public F7(int d) {
super(d, 7);
name = "F07 Single-group Shifted m-dimensional Schwefel's Problem 1.2";
P = new int[numberOfDimensions];
P = Util.randomPermutation(numberOfDimensions);
OShift = new double[numberOfDimensions];
for (int i=0; i<numberOfDimensions; i++){
OShift[i] = Util.nextDouble(lowerLimit.get(i),upperLimit.get(i));
}
M = new double[m*m];
DenseMatrix64F A = RandomMatrices.createOrthogonal(m, m, Util.rnd);
for (int i=0; i<m; i++){
for (int j=0; j<m; j++){
M[i * m + j] = A.get(i, j);
}
}
}
示例10: F9
import org.ejml.data.DenseMatrix64F; //导入依赖的package包/类
public F9(int d) {
super(d, 9);
name = "F09 D/2m-group Shifted and m-rotated Elliptic Function";
P = new int[numberOfDimensions];
P = Util.randomPermutation(numberOfDimensions);
OShift = new double[numberOfDimensions];
for (int i=0; i<numberOfDimensions; i++){
OShift[i] = Util.nextDouble(lowerLimit.get(i),upperLimit.get(i));
}
M = new double[m*m];
DenseMatrix64F A = RandomMatrices.createOrthogonal(m, m, Util.rnd);
for (int i=0; i<m; i++){
for (int j=0; j<m; j++){
M[i * m + j] = A.get(i, j);
}
}
}
示例11: F19
import org.ejml.data.DenseMatrix64F; //导入依赖的package包/类
public F19(int d) {
super(d, 19);
name = "F19 Shifted Schwefel's Problem 1.2";
OShift = new double[numberOfDimensions];
for (int i=0; i<numberOfDimensions; i++){
OShift[i] = Util.nextDouble(lowerLimit.get(i),upperLimit.get(i));
}
M = new double[m*m];
DenseMatrix64F A = RandomMatrices.createOrthogonal(m, m, Util.rnd);
for (int i=0; i<m; i++){
for (int j=0; j<m; j++){
M[i * m + j] = A.get(i, j);
}
}
}
示例12: F8
import org.ejml.data.DenseMatrix64F; //导入依赖的package包/类
public F8(int d) {
super(d, 8);
name = "F08 Single-group Shifted m-dimensional Rosenbrock's Function";
P = new int[numberOfDimensions];
P = Util.randomPermutation(numberOfDimensions);
OShift = new double[numberOfDimensions];
for (int i=0; i<numberOfDimensions; i++){
OShift[i] = Util.nextDouble(lowerLimit.get(i),upperLimit.get(i));
}
M = new double[m*m];
DenseMatrix64F A = RandomMatrices.createOrthogonal(m, m, Util.rnd);
for (int i=0; i<m; i++){
for (int j=0; j<m; j++){
M[i * m + j] = A.get(i, j);
}
}
}
示例13: F11
import org.ejml.data.DenseMatrix64F; //导入依赖的package包/类
public F11(int d) {
super(d, 11);
name = "F11 D/2m-group Shifted and m-rotated Ackley's Function";
P = new int[numberOfDimensions];
P = Util.randomPermutation(numberOfDimensions);
OShift = new double[numberOfDimensions];
for (int i=0; i<numberOfDimensions; i++){
OShift[i] = Util.nextDouble(lowerLimit.get(i),upperLimit.get(i));
}
M = new double[m*m];
DenseMatrix64F A = RandomMatrices.createOrthogonal(m, m, Util.rnd);
for (int i=0; i<m; i++){
for (int j=0; j<m; j++){
M[i * m + j] = A.get(i, j);
}
}
}
示例14: F6
import org.ejml.data.DenseMatrix64F; //导入依赖的package包/类
public F6(int d) {
super(d, 6);
name = "F06 Single-group Shifted and m-rotated Ackley's Function";
P = new int[numberOfDimensions];
P = Util.randomPermutation(numberOfDimensions);
OShift = new double[numberOfDimensions];
for (int i=0; i<numberOfDimensions; i++){
OShift[i] = Util.nextDouble(lowerLimit.get(i),upperLimit.get(i));
}
M = new double[m*m];
DenseMatrix64F A = RandomMatrices.createOrthogonal(m, m, Util.rnd);
for (int i=0; i<m; i++){
for (int j=0; j<m; j++){
M[i * m + j] = A.get(i, j);
}
}
}
示例15: F5
import org.ejml.data.DenseMatrix64F; //导入依赖的package包/类
public F5(int d) {
super(d, 5);
name = "F05 Single-group Shifted and m-rotated Rastrigin's Function";
P = new int[numberOfDimensions];
P = Util.randomPermutation(numberOfDimensions);
OShift = new double[numberOfDimensions];
for (int i=0; i<numberOfDimensions; i++){
OShift[i] = Util.nextDouble(lowerLimit.get(i),upperLimit.get(i));
}
M = new double[m*m];
DenseMatrix64F A = RandomMatrices.createOrthogonal(m, m, Util.rnd);
for (int i=0; i<m; i++){
for (int j=0; j<m; j++){
M[i * m + j] = A.get(i, j);
}
}
}