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


Java CommonOps.transpose方法代码示例

本文整理汇总了Java中org.ejml.ops.CommonOps.transpose方法的典型用法代码示例。如果您正苦于以下问题:Java CommonOps.transpose方法的具体用法?Java CommonOps.transpose怎么用?Java CommonOps.transpose使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.ejml.ops.CommonOps的用法示例。


在下文中一共展示了CommonOps.transpose方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: MatrixFormulation

import org.ejml.ops.CommonOps; //导入方法依赖的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

示例2: canComputeChiSquared

import org.ejml.ops.CommonOps; //导入方法依赖的package包/类
@Test
public void canComputeChiSquared()
{
	// We have to use the transpose of the table
	DenseMatrix64F m = new DenseMatrix64F(chi2);
	CommonOps.transpose(m);
	int max = m.numCols;
	double[] et = m.data;
	for (int i = 0, j = 0; i < p.length; i++)
	{
		ChiSquaredDistributionTable upperTable = ChiSquaredDistributionTable.createUpperTailed(p[i], max);
		// Use 1-p as the significance level to get the same critical values
		ChiSquaredDistributionTable lowerTable = ChiSquaredDistributionTable.createLowerTailed(1 - p[i], max);
		for (int df = 1; df <= max; df++)
		{
			double o = upperTable.getCrititalValue(df);
			double e = et[j++];
			//System.out.printf("p=%.3f,df=%d = %f\n", p[i], df, o);
			Assert.assertEquals(e, o, 1e-2);

			// The test only stores 2 decimal places so use the computed value to set upper/lower
			double upper = o * 1.01;
			double lower = o * 0.99;

			Assert.assertTrue("Upper did not reject higher", upperTable.reject(upper, df));
			Assert.assertFalse("Upper did not reject actual value", upperTable.reject(o, df));
			Assert.assertFalse("Upper did not accept lower", upperTable.reject(lower, df));

			Assert.assertTrue("Lower did not reject lower", lowerTable.reject(lower, df));
			Assert.assertFalse("Lower did not accept actual value", lowerTable.reject(o, df));
			Assert.assertFalse("Lower did not accept higher", lowerTable.reject(upper, df));
		}
	}
}
 
开发者ID:aherbert,项目名称:GDSC-SMLM,代码行数:35,代码来源:ChiSquaredDistributionTableTest.java

示例3: main

import org.ejml.ops.CommonOps; //导入方法依赖的package包/类
public static void main(String[] args) {
    DenseMatrix64F y = new DenseMatrix64F(1, 2, true, new double[]{1.0, 2.0});
    DenseMatrix64F yT = CommonOps.transpose(y, null);
    DenseMatrix64F m = new DenseMatrix64F(2,2);
    CommonOps.mult(yT, y, m);

    SimpleMatrix m2 = new SimpleMatrix(2,2, true, new double[]{1,2,3,4});
    org.ejml.factory.SingularValueDecomposition<DenseMatrix64F> svd = DecompositionFactory.svd(2, 2, false, true, false);
    svd.decompose(m);
    m = svd.getV(null, true);

}
 
开发者ID:LakkiB,项目名称:mlstorm,代码行数:13,代码来源:IncrementalStormPca.java

示例4: process

import org.ejml.ops.CommonOps; //导入方法依赖的package包/类
@Override
public void process(double[] input, double[] output) {
	RodriguesRotationJacobian g = new RodriguesRotationJacobian();
	
	g.process(input[0],input[1],input[2]);

	DenseMatrix64F J = DenseMatrix64F.wrap(3,9,output);
	
	System.arraycopy(g.Rx.data,0,output,0,9);
	System.arraycopy(g.Ry.data,0,output,9,9);
	System.arraycopy(g.Rz.data,0,output,18,9);

	CommonOps.transpose(J);
}
 
开发者ID:intrack,项目名称:BoofCV-master,代码行数:15,代码来源:TestRodriguesRotationGradient.java

示例5: transpose

import org.ejml.ops.CommonOps; //导入方法依赖的package包/类
public void transpose() {
    CommonOps.transpose(this.data);
}
 
开发者ID:yuval,项目名称:ninja,代码行数:4,代码来源:NinjaMatrix.java

示例6: transpose

import org.ejml.ops.CommonOps; //导入方法依赖的package包/类
public Matrix transpose() {
	DenseMatrix64F ret = new DenseMatrix64F(matrix.numCols, matrix.numRows);
	CommonOps.transpose(matrix, ret);
	return new EJMLDenseDoubleMatrix2D(ret);
}
 
开发者ID:ujmp,项目名称:universal-java-matrix-package,代码行数:6,代码来源:EJMLDenseDoubleMatrix2D.java

示例7: adjustHomographSign

import org.ejml.ops.CommonOps; //导入方法依赖的package包/类
/**
 * Since the sign of the homography is ambiguous a point is required to make sure the correct
 * one was selected.
 *
 * @param p test point, used to determine the sign of the matrix.
 */
protected void adjustHomographSign( PairLineNorm p , DenseMatrix64F H ) {

	CommonOps.transpose(H,H_t);

	double val = GeometryMath_F64.innerProd(p.l1, H_t, p.l2);

	if( val < 0 )
		CommonOps.scale(-1, H);
}
 
开发者ID:intrack,项目名称:BoofCV-master,代码行数:16,代码来源:AdjustHomographyMatrix.java


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