/** * Returns the trace (sum of diagonal elements) of this matrix. * @return the trace. */ public double trace() { int mn = min(_m,_n); double t = 0.0; for (int i=0; i<mn; ++i) t += _a[i+i*_m]; return t; }
/** * Returns the trace (sum of diagonal elements) of this matrix. * @return the trace. */ public double trace() { int mn = min(_m,_n); double t = 0.0; for (int i=0; i<mn; ++i) t += _a[i][i]; return t; }
public static int min(int[] rx) { return min(rx,null); } public static int min(int[][] rx) {
public static short min(short[] rx) { return min(rx,null); } public static short min(short[][] rx) {
public static short min(short[][][] rx) { return min(rx,null); } public static short min(short[] rx, int[] index) {
public static long min(long[] rx) { return min(rx,null); } public static long min(long[][] rx) {
public static float min(float[][][] rx) { return min(rx,null); } public static float min(float[] rx, int[] index) {
public Void call() { for (int ib=ai.getAndIncrement(); ib<nb; ib=ai.getAndIncrement()) { int i = ib*mb; // beginning of block int j = min(i+mb,n); // beginning of next block (or end) for (int k=i; k<j; ++k) { // for each sample in block, ... Sample s = al.get(k); // get k'th sample from A list solveOne(t,m,times,marks,s,bltask,dtask); // process sample } } bltask.setAllAbsent(); // needed when merging B lists below return null; } });
private static void plot(float[][] f) { trace("plot f min="+ min(f)+" max="+max(f)); edu.mines.jtk.mosaic.SimplePlot sp = new edu.mines.jtk.mosaic.SimplePlot( edu.mines.jtk.mosaic.SimplePlot.Origin.UPPER_LEFT); sp.setSize(920,900); edu.mines.jtk.mosaic.PixelsView pv = sp.addPixels(f); pv.setColorModel(edu.mines.jtk.awt.ColorMap.JET); pv.setInterpolation(edu.mines.jtk.mosaic.PixelsView.Interpolation.NEAREST); } }
private static void plot(float[][] f) { trace("plot f min="+ min(f)+" max="+max(f)); edu.mines.jtk.mosaic.SimplePlot sp = new edu.mines.jtk.mosaic.SimplePlot( edu.mines.jtk.mosaic.SimplePlot.Origin.UPPER_LEFT); sp.setSize(920,900); edu.mines.jtk.mosaic.PixelsView pv = sp.addPixels(f); pv.setColorModel(edu.mines.jtk.awt.ColorMap.JET); pv.setInterpolation(edu.mines.jtk.mosaic.PixelsView.Interpolation.NEAREST); } }
private void initLags(int[] lag1) { Check.argument(lag1.length>0,"lag1.length>0"); Check.argument(lag1[0]==0,"lag1[0]==0"); for (int j=1; j<lag1.length; ++j) Check.argument(lag1[j]>0,"lag1["+j+"]>0"); _m = lag1.length; _lag1 = copy(lag1); _lag2 = zeroint(_m); _lag3 = zeroint(_m); _min1 = min(lag1); _max1 = max(lag1); }
private void initLags(int[] lag1, float[] a) { Check.argument(lag1.length>0,"lag1.length>0"); Check.argument(lag1.length==a.length,"lag1.length==a.length"); Check.argument(lag1[0]==0,"lag1[0]==0"); for (int j=1; j<a.length; ++j) Check.argument(lag1[j]>0,"lag1["+j+"]>0"); _m = lag1.length; _lag1 = copy(lag1); _lag2 = zeroint(_m); _lag3 = zeroint(_m); _min1 = min(lag1); _max1 = max(lag1); }