/** * Returns the sum of all cells; <tt>Sum( x[i,j,k] )</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,k] )</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 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 sliceNames The headers of all slices (to be put above each slice). @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 sliceAxisName The label of the z-axis (to be put above each slice). @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. */ private String xtoTitleString(DoubleMatrix3D matrix, String[] sliceNames, String[] rowNames, String[] columnNames, String sliceAxisName, String rowAxisName, String columnAxisName, String title) { if (matrix.size()==0) return "Empty matrix"; StringBuffer buf = new StringBuffer(); for (int i=0; i<matrix.slices(); i++) { if (i!=0) buf.append(sliceSeparator); buf.append(toTitleString(matrix.viewSlice(i),rowNames,columnNames,rowAxisName,columnAxisName,title+"\n"+sliceAxisName+"="+sliceNames[i])); } return buf.toString(); } }
/** 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 sliceNames The headers of all slices (to be put above each slice). @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 sliceAxisName The label of the z-axis (to be put above each slice). @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. */ private String xtoTitleString(DoubleMatrix3D matrix, String[] sliceNames, String[] rowNames, String[] columnNames, String sliceAxisName, String rowAxisName, String columnAxisName, String title) { if (matrix.size()==0) return "Empty matrix"; StringBuffer buf = new StringBuffer(); for (int i=0; i<matrix.slices(); i++) { if (i!=0) buf.append(sliceSeparator); buf.append(toTitleString(matrix.viewSlice(i),rowNames,columnNames,rowAxisName,columnAxisName,title+"\n"+sliceAxisName+"="+sliceNames[i])); } return buf.toString(); } }
if (size()==0) return Double.NaN; double a = f.apply(getQuick(slices-1,rows-1,columns-1)); int d = 1; // last cell already done
if (size()==0) return Double.NaN; double a = f.apply(getQuick(slices-1,rows-1,columns-1)); int d = 1; // last cell already done
if (size()==0) return Double.NaN; double a = f.apply(getQuick(slices-1,rows-1,columns-1),other.getQuick(slices-1,rows-1,columns-1)); int d = 1; // last cell already done
if (size()==0) return Double.NaN; double a = f.apply(getQuick(slices-1,rows-1,columns-1),other.getQuick(slices-1,rows-1,columns-1)); int d = 1; // last cell already done