BaseSpatialWindow extends BaseFunction<T> { protected boolean isEntirelyBorder(int outR0, int outC0 ) { if( outC0 >= Wo || outR0 >= Ho ) return true; else { int padR0 = padding.getPaddingRow0(); int padC0 = padding.getPaddingCol0(); if (outC0 * config.periodX + WW > W + padC0 || outR0 * config.periodY + HH > H + padR0) return true; } return false; } BaseSpatialWindow(ConfigSpatial config, P padding); @Override void _initialize(); static int innerLowerExtent(int period, int padding); static int innerUpperExtent( int windowLength , int period , int padding , int inputLength ); P getPadding();  }
@Test public void isEntirelyBorder() { ConfigSpatial configSpatial = new ConfigSpatial(); ConfigPadding configPadding = new ConfigPadding(); configSpatial.HH = 2; configSpatial.WW = 2; configSpatial.periodY = 1; configSpatial.periodX = 1; configPadding.y0 = 3; configPadding.x0 = 2; configPadding.y1 = 2; configPadding.x1 = 2; Helper alg = new Helper(configSpatial,new ConstantPadding2D_F64(configPadding)); alg.initialize(2,12,13); assertFalse(alg.isEntirelyBorder(0, 0)); assertFalse(alg.isEntirelyBorder(0, alg.Wo-3)); assertFalse(alg.isEntirelyBorder(alg.Ho-3, 0)); assertTrue(alg.isEntirelyBorder(0, alg.Wo)); assertTrue(alg.isEntirelyBorder(alg.Ho, 0)); assertTrue(alg.isEntirelyBorder(0, alg.Wo-1)); assertTrue(alg.isEntirelyBorder(alg.Ho-1, 0)); }