当前位置: 首页>>代码示例>>Java>>正文


Java DenseMatrix64F类代码示例

本文整理汇总了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;
}
 
开发者ID:vitrivr,项目名称:cineast,代码行数:26,代码来源:MeshTransformUtil.java

示例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);
}
 
开发者ID:signaflo,项目名称:java-timeseries,代码行数:17,代码来源:MultipleLinearRegressionModel.java

示例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();
}
 
开发者ID:signaflo,项目名称:java-timeseries,代码行数:19,代码来源:ArmaKalmanFilter.java

示例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();
}
 
开发者ID:signaflo,项目名称:java-timeseries,代码行数:24,代码来源:ArimaKalmanFilter.java

示例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);
		}
	}
}
 
开发者ID:UM-LPM,项目名称:EARS,代码行数:24,代码来源:F15.java

示例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);
		}
	}
}
 
开发者ID:UM-LPM,项目名称:EARS,代码行数:24,代码来源:F17.java

示例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);
		}
	}
}
 
开发者ID:UM-LPM,项目名称:EARS,代码行数:24,代码来源:F4.java

示例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);
		}
	}
}
 
开发者ID:UM-LPM,项目名称:EARS,代码行数:21,代码来源:F20.java

示例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);
		}
	}
}
 
开发者ID:UM-LPM,项目名称:EARS,代码行数:24,代码来源:F7.java

示例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);
		}
	}
}
 
开发者ID:UM-LPM,项目名称:EARS,代码行数:24,代码来源:F9.java

示例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);
		}
	}
}
 
开发者ID:UM-LPM,项目名称:EARS,代码行数:21,代码来源:F19.java

示例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);
		}
	}
}
 
开发者ID:UM-LPM,项目名称:EARS,代码行数:24,代码来源:F8.java

示例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);
		}
	}
}
 
开发者ID:UM-LPM,项目名称:EARS,代码行数:24,代码来源:F11.java

示例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);
		}
	}
}
 
开发者ID:UM-LPM,项目名称:EARS,代码行数:24,代码来源:F6.java

示例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);
		}
	}
}
 
开发者ID:UM-LPM,项目名称:EARS,代码行数:24,代码来源:F5.java


注:本文中的org.ejml.data.DenseMatrix64F类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。