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


Java Matrix.numColumns方法代码示例

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


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

示例1: multAdd

import no.uib.cipr.matrix.Matrix; //导入方法依赖的package包/类
@Override
public Matrix multAdd(double alpha, Matrix B, Matrix C) {
    checkMultAdd(B, C);
    if (alpha == 0)
        return C;
    for (int i = 0; i < numRows; i++) {
        Node row = links.startOfRow(i);
        if (row != null)
            for (int j = 0; j < B.numColumns(); j++) {
                Node node = row;
                double v = 0;
                while (node != null && node.row == i) {
                    v += (B.get(node.col, j) * node.val);
                    node = node.rowTail;
                }
                if (v != 0)
                    C.add(i, j, alpha * v);
            }
    }
    return C;
}
 
开发者ID:opprop-benchmarks,项目名称:matrix-toolkits-java,代码行数:22,代码来源:LinkedSparseMatrix.java

示例2: transAmultAdd

import no.uib.cipr.matrix.Matrix; //导入方法依赖的package包/类
@Override
public Matrix transAmultAdd(double alpha, Matrix B, Matrix C) {
    checkTransAmultAdd(B, C);
    if (alpha == 0)
        return C;
    for (int i = 0; i < numColumns; i++) {
        Node row = links.startOfCol(i);
        if (row != null)
            for (int j = 0; j < B.numColumns(); j++) {
                Node node = row;
                double v = 0;
                while (node != null && node.col == i) {
                    v += (B.get(node.row, j) * node.val);
                    node = node.colTail;
                }
                if (v != 0)
                    C.add(i, j, alpha * v);
            }
    }
    return C;
}
 
开发者ID:opprop-benchmarks,项目名称:matrix-toolkits-java,代码行数:22,代码来源:LinkedSparseMatrix.java

示例3: calculateCodifferential

import no.uib.cipr.matrix.Matrix; //导入方法依赖的package包/类
private static <
	V extends Vertex<V,E,F>,
	E extends Edge<V,E,F>,
	F extends Face<V,E,F>,
	HDS extends HalfEdgeDataStructure<V, E, F>
> Matrix calculateCodifferential(HDS heds, AdapterSet adapters, int dim) {
	Matrix hs0inv = invertDiagonalMatrix(getHodgeStar(heds, adapters, dim));
	Matrix hs1 = getHodgeStar(heds, adapters, dim+1);
	Matrix bd = getBoundaryOperator(heds, adapters, dim);
	
	int[][] nz = getColumnNonZeros(bd);
	Matrix M = new CompColMatrix(bd.numRows(),bd.numColumns(),nz);
	M.set(bd);
	for(MatrixEntry me : M) {
		double val = me.get();
		me.set(-1.0*hs0inv.get(me.row(), me.row())*hs1.get(me.column(), me.column())*val);
	}
	return M;
}
 
开发者ID:sechel,项目名称:jtem-halfedgetools,代码行数:20,代码来源:DiscreteDifferentialOperators.java

示例4: getQRDecomposition

import no.uib.cipr.matrix.Matrix; //导入方法依赖的package包/类
@Override
public Pair<IMatrix, IMatrix> getQRDecomposition() {
   Matrix input = internalMatrix.copy();

   // If the Matrix has the wrong dimensions
   if (input.numRows() < input.numColumns()) {
      input = input.transpose(new LinkedSparseMatrix(input.numColumns(), input.numRows()));
   }

   QR rs = QR.factorize(input);
   return Pair.of(new SparseDoubleMatrix(rs.getQ()), new SparseDoubleMatrix(rs.getR()));
}
 
开发者ID:Intelligent-Systems-Group,项目名称:jpl-framework,代码行数:13,代码来源:SparseDoubleMatrix.java

示例5: getQRDecomposition

import no.uib.cipr.matrix.Matrix; //导入方法依赖的package包/类
@Override
public Pair<IMatrix, IMatrix> getQRDecomposition() throws MatrixDecompositionException {
   Matrix input = internalMatrix.copy();

   // If the Matrix has the wrong dimensions
   if (input.numRows() < input.numColumns()) {
      input = input.transpose(new DenseDoubleMatrix(input.numColumns(), input.numRows()).internalMatrix);
   }

   QR rs = QR.factorize(input);
   return Pair.of(new DenseDoubleMatrix(rs.getQ()), new DenseDoubleMatrix(rs.getR()));
}
 
开发者ID:Intelligent-Systems-Group,项目名称:jpl-framework,代码行数:13,代码来源:DenseDoubleMatrix.java

示例6: invertDiagonalMatrix

import no.uib.cipr.matrix.Matrix; //导入方法依赖的package包/类
private static CompDiagMatrix invertDiagonalMatrix(Matrix m) {
	CompDiagMatrix minv = new CompDiagMatrix(m.numRows(),m.numColumns());
	Iterator<MatrixEntry> it = m.iterator();
	while(it.hasNext()) {
		MatrixEntry me = it.next();
		minv.set(me.row(),me.column(),1.0/me.get());
	}
	return minv;
}
 
开发者ID:sechel,项目名称:jtem-halfedgetools,代码行数:10,代码来源:DiscreteDifferentialOperators.java


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