docs: public static boolean isIdentical(ZMatrixD1 a, ZMatrixD1 b , double tol ) {
          if( a.numRows != b.numRows || a.numCols != b.numCols ) {
              return false;
          }
          if( tol < 0 )
              throw new IllegalArgumentException("Tolerance must be greater than or equal to zero.");
  
          final int length = a.getDataLength();
          for( int i = 0; i < length; i++ ) {
              double valA = a.data[i];
              double valB = b.data[i];
  
              // if either is negative or positive infinity the result will be positive infinity
              // if either is NaN the result will be NaN
              double diff = Math.abs(valA-valB);
  
              // diff = NaN == false
              // diff = infinity == false
              if( tol >= diff )
                  continue;
  
              if( Double.isNaN(valA) ) {
                  return Double.isNaN(valB);
              } else if( Double.isInfinite(valA) ) {
                  return valA == valB;
              } else {
                  return false;
              }
          }
  
          return true;
      }