/** * Returns the matrix's fraction of non-zero cells; <tt>A.cardinality() / A.size()</tt>. */ public double density(DoubleMatrix2D A) { return A.cardinality() / (double) A.size(); } /**
/** * Returns the sum of all cells; <tt>Sum( x[i,j] )</tt>. * @return the sum. */ public double zSum() { if (size()==0) return 0; return aggregate(cern.jet.math.Functions.plus,cern.jet.math.Functions.identity); } }
/** * Returns the sum of all cells; <tt>Sum( x[i,j] )</tt>. * @return the sum. */ public double zSum() { if (size()==0) return 0; return aggregate(cern.jet.math.Functions.plus,cern.jet.math.Functions.identity); } }
/** * Returns the matrix's fraction of non-zero cells; <tt>A.cardinality() / A.size()</tt>. */ public double density(DoubleMatrix2D A) { return A.cardinality() / (double) A.size(); } /**
public void init() { A.assign(0); int seed = 123456; current = 4*seed+1; density = A.cardinality() / (double) A.size(); } public void apply(cern.colt.Timer timer) {
/** * Returns the Frobenius norm of matrix <tt>A</tt>, which is <tt>Sqrt(Sum(A[i,j]<sup>2</sup>))</tt>. */ public double normF(DoubleMatrix2D A) { if (A.size()==0) return 0; return A.aggregate(hypotFunction(),cern.jet.math.Functions.identity); } /**
/** * Returns the Frobenius norm of matrix <tt>A</tt>, which is <tt>Sqrt(Sum(A[i,j]<sup>2</sup>))</tt>. */ public double normF(DoubleMatrix2D A) { if (A.size()==0) return 0; return A.aggregate(hypotFunction(),cern.jet.math.Functions.identity); } /**
public void init() { A.assign(0); int seed = 123456; current = 4*seed+1; density = A.cardinality() / (double) A.size(); } public void apply(cern.colt.Timer timer) {
/** Returns a string representation of the given matrix with axis as well as rows and columns labeled. Pass <tt>null</tt> to one or more parameters to indicate that the corresponding decoration element shall not appear in the string converted matrix. @param matrix The matrix to format. @param rowNames The headers of all rows (to be put to the left of the matrix). @param columnNames The headers of all columns (to be put to above the matrix). @param rowAxisName The label of the y-axis. @param columnAxisName The label of the x-axis. @param title The overall title of the matrix to be formatted. @return the matrix converted to a string. */ protected String toTitleString(DoubleMatrix2D matrix, String[] rowNames, String[] columnNames, String rowAxisName, String columnAxisName, String title) { if (matrix.size()==0) return "Empty matrix"; String[][] s = format(matrix); //String oldAlignment = this.alignment; //this.alignment = DECIMAL; align(s); //this.alignment = oldAlignment; return new cern.colt.matrix.objectalgo.Formatter().toTitleString(cern.colt.matrix.ObjectFactory2D.dense.make(s), rowNames,columnNames,rowAxisName,columnAxisName,title); } /**
/** Returns a string representation of the given matrix with axis as well as rows and columns labeled. Pass <tt>null</tt> to one or more parameters to indicate that the corresponding decoration element shall not appear in the string converted matrix. @param matrix The matrix to format. @param rowNames The headers of all rows (to be put to the left of the matrix). @param columnNames The headers of all columns (to be put to above the matrix). @param rowAxisName The label of the y-axis. @param columnAxisName The label of the x-axis. @param title The overall title of the matrix to be formatted. @return the matrix converted to a string. */ protected String toTitleString(DoubleMatrix2D matrix, String[] rowNames, String[] columnNames, String rowAxisName, String columnAxisName, String title) { if (matrix.size()==0) return "Empty matrix"; String[][] s = format(matrix); //String oldAlignment = this.alignment; //this.alignment = DECIMAL; align(s); //this.alignment = oldAlignment; return new cern.colt.matrix.objectalgo.Formatter().toTitleString(cern.colt.matrix.ObjectFactory2D.dense.make(s), rowNames,columnNames,rowAxisName,columnAxisName,title); } /**
if (size()==0) return Double.NaN; double a = f.apply(getQuick(rows-1,columns-1)); int d = 1; // last cell already done
if (size()==0) return Double.NaN; double a = f.apply(getQuick(rows-1,columns-1)); int d = 1; // last cell already done
if (size()==0) return Double.NaN; double a = f.apply(getQuick(rows-1,columns-1),other.getQuick(rows-1,columns-1)); int d = 1; // last cell already done
if (size()==0) return Double.NaN; double a = f.apply(getQuick(rows-1,columns-1),other.getQuick(rows-1,columns-1)); int d = 1; // last cell already done
SparseDoubleMatrix2D functionSelector = new SparseDoubleMatrix2D(1, functionDepths.length); for(int i=0; i<signatureNodeIncestVector.size(); ++i) { if(signatureNodeIncestVector.get(0, i) == 0.0) continue; for(int j=0; j<functionNodeIncestVector.size(); ++j) { if(candidateList.get(i, j) == 0.0) continue;