public static double fro(Zmat A,int ii1,int ii2,int jj1,int jj2){
  int i, i1, i2, j, j1, j2;
  double fac, nrm, scale;
  i1=ii1 - A.basex;
  i2=ii2 - A.basex;
  j1=jj1 - A.basex;
  j2=jj2 - A.basex;
  scale=0.0;
  for (i=i1; i <= i2; i++) {
    for (j=j1; j <= j2; j++) {
      scale=Math.max(scale,Math.abs(A.re[i][j]) + Math.abs(A.im[i][j]));
    }
  }
  if (scale == 0) {
    return 0.0;
  }
  if (scale < 1) {
    scale=scale * 1.0e20;
  }
  scale=1 / scale;
  nrm=0;
  for (i=i1; i <= i2; i++) {
    for (j=j1; j <= j2; j++) {
      fac=scale * A.re[i][j];
      nrm=nrm + fac * fac;
      fac=scale * A.im[i][j];
      nrm=nrm + fac * fac;
    }
  }
  return Math.sqrt(nrm) / scale;
}

public static double fro ( Zmat A , int ii1 , int ii2 , int jj1 , int jj2 ) { int i , i1 , i2 , j , j1 , j2 ; double fac , nrm , scale ; i1 = ii1 - A . basex ; i2 = ii2 - A . basex ; j1 = jj1 - A . basex ; j2 = jj2 - A . basex ; scale = 0.0 ; for ( i = i1 ; i <= i2 ; i ++ ) { for ( j = j1 ; j <= j2 ; j ++ ) { scale = Math . max ( scale , Math . abs ( A . re [ i ] [ j ] ) + Math . abs ( A . im [ i ] [ j ] ) ) ; } } if ( scale == 0 ) { return 0.0 ; } if ( scale < 1 ) { scale = scale * 1.0e20 ; } scale = 1 / scale ; nrm = 0 ; for ( i = i1 ; i <= i2 ; i ++ ) { for ( j = j1 ; j <= j2 ; j ++ ) { fac = scale * A . re [ i ] [ j ] ; nrm = nrm + fac * fac ; fac = scale * A . im [ i ] [ j ] ; nrm = nrm + fac * fac ; } } return Math . sqrt ( nrm ) / scale ; }
computes the frobenius norm of a the submatrix ( ii1 : ii2 , jj1 , jj2 ) of a zmat .
