code: public static boolean isOrthogonal(DMatrixSparseCSC Q , double tol )
      {
          if( Q.numRows < Q.numCols ) {
              throw new IllegalArgumentException("The number of rows must be more than or equal to the number of columns");
          }
  
          IGrowArray gw=new IGrowArray();
          DGrowArray gx=new DGrowArray();
  
          for( int i = 0; i < Q.numRows; i++ ) {
  
              for( int j = i+1; j < Q.numCols; j++ ) {
                  double val = CommonOps_DSCC.dotInnerColumns(Q,i,Q,j,gw,gx);
  
                  if( !(Math.abs(val) <= tol))
                      return false;
              }
          }
  
          return true;
      }
docs: <p>
  Checks to see if a matrix is orthogonal or isometric.
  </p>
  
  @param Q The matrix being tested. Not modified.
  @param tol Tolerance.
  @return True if it passes the test.