private static void checkArray(int n1, int n2, float[][] a, String name) { boolean ok = a.length>=n2; for (int i2=0; i2<n2 && ok; ++i2) ok = a[i2].length>=n1; Check.argument(ok,"dimensions of "+name+" are valid"); }
/** * Returns the determinant of the square matrix A. * The determinant exists only for square matrices A. * @return the determinant. */ public double det() { Check.argument(_m==_n,"A is square"); return _det; }
/** * Constructs a rectangle filter with specified index bounds. * @param l the lower index bound in the sum; must not be greater than m. * @param m the upper index bound in the sum; must not be less than l. */ public RecursiveRectangleFilter(int l, int m) { Check.argument(l<=m,"l<=m"); _l = l; _m = m; }
private static void checkArrays(float[][][] x, float[][][] y) { Check.argument(x.length==y.length,"x.length==y.length"); Check.argument(x[0].length==y[0].length,"x[0].length==y[0].length"); Check.argument(x[0][0].length==y[0][0].length, "x[0][0].length==y[0][0].length"); Check.argument(isRegular(x),"x is regular"); Check.argument(isRegular(y),"y is regular"); } }
private static void checkArrays(float[][][] x, float[][][] y) { Check.argument(x.length==y.length,"x.length==y.length"); Check.argument(x[0].length==y[0].length,"x[0].length==y[0].length"); Check.argument(x[0][0].length==y[0][0].length, "x[0][0].length==y[0][0].length"); Check.argument(isRegular(x),"x is regular"); Check.argument(isRegular(y),"y is regular"); }
private static void checkArrays(float[][][] x, float[][][] y) { Check.argument(x.length==y.length,"x.length==y.length"); Check.argument(x[0].length==y[0].length,"x[0].length==y[0].length"); Check.argument(x[0][0].length==y[0][0].length, "x[0][0].length==y[0][0].length"); Check.argument(isRegular(x),"x is regular"); Check.argument(isRegular(y),"y is regular"); }
/** * Called during alignment of this tile by its mosaic. * Or, if the mosaic is null, the tile calls this method, * when one of its tiled views requests alignment. */ void setProjectors(Projector hp, Projector vp) { Check.argument(hp!=null,"horizontal projector not null"); Check.argument(vp!=null,"vertical projector not null"); _hp = hp; _vp = vp; repaint(); }
/** * Called during alignment of this tile by its mosaic. */ void setHorizontalProjector(Projector hp) { Check.argument(hp!=null,"horizontal projector not null"); _hp = hp; repaint(); }
/** * Constructs a new FFT, with specified length. Valid FFT lengths * can be obtained by calling the methods {@link #nfftSmall(int)} * and {@link #nfftFast(int)}. * @param nfft the FFT length, which must be valid. */ public FftComplex(int nfft) { Check.argument(Pfacc.nfftValid(nfft),"nfft="+nfft+" is valid FFT length"); _nfft = nfft; }
/** * Called during alignment of this tile by its mosaic. */ void setVerticalProjector(Projector vp) { Check.argument(vp!=null,"vertical projector not null"); _vp = vp; repaint(); }
/** * Constructs a new FFT, with specified length. Valid FFT lengths * can be obtained by calling the methods {@link #nfftSmall(int)} * and {@link #nfftFast(int)}. * @param nfft the FFT length, which must be valid. */ public FftReal(int nfft) { Check.argument( nfft%2==0 && Pfacc.nfftValid(nfft/2), "nfft="+nfft+" is valid FFT length"); _nfft = nfft; }
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); }
/** * Construct a Gaussian filter with specified width. * @param sigma the width; must not be less than 1. */ public RecursiveGaussianFilter(double sigma) { Check.argument(sigma>=1.0,"sigma>=1.0"); _filter = (sigma<32.0) ? new DericheFilter(sigma) : new VanVlietFilter(sigma); }
private void ensureSamplingK3(float[][][] f) { Check.state(_sk3!=null,"sampling sk3 exists for 3rd dimension"); ensureSamplingK2(f[0]); int l3 = f.length; int n3 = _sk3.getCount(); Check.argument(n3==l3,"array length consistent with sampling sk3"); }
private void ensureSamplingX3(float[][][] f) { Check.state(_sx3!=null,"sampling sx3 exists for 3rd dimension"); ensureSamplingX2(f[0]); int l3 = f.length; int n3 = _sx3.getCount(); Check.argument(n3==l3,"array length consistent with sampling sx3"); }
public void setScattered(float[] f, float[] x1, float[] x2) { _f = copy(f); _mesh = new TriMesh(); int n = f.length; for (int i=0; i<n; ++i) { TriMesh.Node node = new TriMesh.Node(x1[i],x2[i]); node.index = i; boolean added = _mesh.addNode(node); Check.argument(added,"samples have unique coordinates (x1,x2)"); } }