function [ dist_ratio intra_dist inter_dist ] = compute_distance_ratio( X, L, L_, N )

    Q = sum( L_(:) < 0 );
    R = size(X,1);
    N = size(X,2);
    intra_dist = sum( diag( X * L * X' ) );
    %inter_dist = N * sum( sum( X .^ 2 ) ) - sum( sum( X, 2 ) .^ 2 );
    inter_dist = sum( diag( X * L_ * X' ) );
    dist_ratio = intra_dist / inter_dist;
    
%     if nargin >= 4
%         dist_L1 = real(sqrt(ml_sqrDist(X, X)));
%         intra_dist = sum(dist_L1(logical(W(:))));
%         inter_dist = sum(dist_L1(:));
%     end
    
end