List of usage examples for org.apache.commons.math3.linear Array2DRowRealMatrix getColumnDimension
@Override public int getColumnDimension()
From source file:outlineDescriptor.EllipticalKernelGenerator.java
/** * Shows a results table containing coordinates of a specified rotation * * @param step Rotation to be displayed//from w ww. j a va 2 s. c o m */ public void showDebug(int step) { Array2DRowRealMatrix ellipse = this.getRotatedEllipseBounds(step); ResultsTable results = new ResultsTable(); for (int x = 0; x < ellipse.getColumnDimension(); x++) { results.incrementCounter(); results.addValue("x", ellipse.getEntry(0, x)); results.addValue("y", ellipse.getEntry(1, x)); results.incrementCounter(); results.addValue("x", ellipse.getEntry(0, x)); results.addValue("y", ellipse.getEntry(2, x)); } results.show("Ellipse " + Double.toString(steps[step]) + " rad.csv"); }
From source file:outlineDescriptor.FieldAnalyzer.java
private int[] getMax(Array2DRowRealMatrix field) { int[] pos = new int[2]; for (int x = 0; x < field.getColumnDimension(); x++) { for (int y = 0; y < field.getRowDimension(); y++) { if (field.getEntry(y, x) > field.getEntry(pos[1], pos[0])) { pos[0] = x;//from w ww . ja v a 2 s. co m pos[1] = y; } } } return pos; }
From source file:outlineDescriptor.ODUtils.java
public static void generateHeatMap(Array2DRowRealMatrix matrix, String name) { ResultsTable results = new ResultsTable(); for (int x = 0; x < matrix.getColumnDimension(); x++) { for (int y = 0; y < matrix.getRowDimension(); y++) { double intensity = matrix.getEntry(y, x); results.incrementCounter();/* w w w . ja v a 2s .c o m*/ results.addValue("x", x); results.addValue("y", y); results.addValue("intensity", intensity); } } results.show(name); }