code: public static double qualityTriangular(DMatrixSparseCSC T)
      {
          int N = Math.min(T.numRows,T.numCols);
  
          double max = T.unsafe_get(0,0);
          for( int i = 1; i < N; i++ ) {
              max = Math.max(max,Math.abs(T.unsafe_get(i,i)));
          }
  
          if( max == 0.0 )
              return 0.0;
  
          double quality = 1.0;
          for( int i = 0; i < N; i++ ) {
              quality *= T.unsafe_get(i,i)/max;
          }
  
          return Math.abs(quality);
      }
docs: Computes the quality of a triangular matrix, where the quality of a matrix
  is defined in {@link LinearSolverDense#quality()}.  In
  this situation the quality os the absolute value of the product of
  each diagonal element divided by the magnitude of the largest diagonal element.
  If all diagonal elements are zero then zero is returned.
  
  @param T A matrix.
  @return the quality of the system.