public double[] convolve_rows_gauss(double[] image, double[] mask)
	{
	  long      j, r, c, l;
	  double    sum;
	  double [] h;
	  
	  
	  int n;
	  
	  h = new double[(int) (width*height)];
	  n=(int) ((mask.length-1)*0.5);
	  /* Inner region */
	  for (r=n; r<height-n; r++) {
	    for (c=0; c<width; c++) {
	      l = LINCOOR(r,c,width);
	      sum = 0.0;
	      for (j=-n;j<=n;j++)
	        sum += (double)(image[(int) (l+j*width)])*mask[(int) j+n];
	      h[(int) l] = sum;
	    }
	  }
	  /* Border regions */
	  for (r=0; r<n; r++) {
	    for (c=0; c<width; c++) {
	      l = LINCOOR(r,c,width);
	      sum = 0.0;
	      for (j=-n;j<=n;j++)
	        sum += (double)(image[(int) LINCOOR(BR(r+j),c,width)])*mask[(int) j+n];
	      h[(int) l] = sum;
	    }
	  }
	  for (r=height-n; r<height; r++) {
	    for (c=0; c<width; c++) {
	      l = LINCOOR(r,c,width);
	      sum = 0.0;
	      for (j=-n;j<=n;j++)
	        sum += (double)(image[(int) LINCOOR(BR(r+j),c,width)])*mask[(int) j+n];
	      h[(int) l] = sum;
	    }
	  }
	  return h;
	}