private double[][] CalcConstantCoef(Variogram variogarm,List<KrigingPoint> NNPoints){
  int n=NNPoints.size();
  double[][] mat=new double[n + 1][n + 1];
  double dist=0.0;
  for (int i=0; i < n; i++) {
    for (int j=i; j < n; j++) {
      dist=Math.sqrt(Math.abs(Math.pow(NNPoints.get(i).x - NNPoints.get(j).x,2)) + Math.abs(Math.pow(NNPoints.get(i).y - NNPoints.get(j).y,2)));
      mat[i][j]=getTheoreticalSVValue(dist,variogarm);
      mat[j][i]=mat[i][j];
    }
  }
  for (int i=0; i < n; i++) {
    mat[i][n]=1;
    mat[n][i]=1;
  }
  return mat;
}

private double [ ] [ ] CalcConstantCoef ( Variogram variogarm , List < KrigingPoint > NNPoints ) { int n = NNPoints . size ( ) ; double [ ] [ ] mat = new double [ n + 1 ] [ n + 1 ] ; double dist = 0.0 ; for ( int i = 0 ; i < n ; i ++ ) { for ( int j = i ; j < n ; j ++ ) { dist = Math . sqrt ( Math . abs ( Math . pow ( NNPoints . get ( i ) . x - NNPoints . get ( j ) . x , 2 ) ) + Math . abs ( Math . pow ( NNPoints . get ( i ) . y - NNPoints . get ( j ) . y , 2 ) ) ) ; mat [ i ] [ j ] = getTheoreticalSVValue ( dist , variogarm ) ; mat [ j ] [ i ] = mat [ i ] [ j ] ; } } for ( int i = 0 ; i < n ; i ++ ) { mat [ i ] [ n ] = 1 ; mat [ n ] [ i ] = 1 ; } return mat ; }
this prepares the known points matrix for ordinary kriging
