This is a static copy of a profile report

Home

Function details for eigs>CHOLfactorBThis is a static copy of a profile report

Home

eigs>CHOLfactorB (Calls: 1, Time: 0.000 s)
Generated 22-Jul-2019 16:32:29 using performance time.
subfunction in file C:\Program Files\MATLAB\R2019a\toolbox\matlab\sparfun\eigs.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
eigsfunction1
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
700
if isempty(B)
10.000 s15.7%
754
end
10.000 s13.2%
702
R = [];
10.000 s8.1%
704
spdB = false;
10.000 s7.7%
703
permB = [];
10.000 s5.5%
All other lines  0.000 s49.8%
Totals  0.000 s100% 
Children (called functions)
No children
Code Analyzer results
No Code Analyzer messages.
Coverage results
Show coverage for parent directory
Total lines in function59
Non-code lines (comments, blank lines)20
Code lines (lines that can run)39
Code lines that did run5
Code lines that did not run34
Coverage (did run/can run)12.82 %
Function listing
time 
Calls 
 line
 696 
function [R, permB, spdB] = CHOLfactorB(B, cholB, permB, shiftAndInvert, spdB)
 697 
% Get the Cholesky factorization of B and determine if it is Hermitian
 698 
% Positive (semi) Definite
 699 

< 0.001 
      1 
 700
if isempty(B) 
 701 
    % Standard problem, set values to flow through
< 0.001 
      1 
 702
    R = []; 
< 0.001 
      1 
 703
    permB = []; 
< 0.001 
      1 
 704
    spdB = false; 
 705 
elseif cholB
 706 
    % We already have the Cholesky factor, store it in R
 707 
    R = B;
 708 
    spdB = true;
 709 
elseif ishermitian(B) && (isempty(spdB)|| (spdB && ~shiftAndInvert))
 710 
    % We need to see if B is SPD by using chol OR
 711 
    % We know B is SPD, and we need Cholesky decomposition
 712 
    if issparse(B)
 713 
        [R, idxB, permB] = chol(B);
 714 
    else
 715 
        [R, idxB] = chol(B);
 716 
    end
 717 
    
 718 
    if idxB == 0
 719 
        % B is SPD, no further check needed
 720 
        spdB = true;
 721 
    elseif shiftAndInvert && isreal(B)
 722 
        % Check whether B is positive SEMI-definite by checking D from the
 723 
        % whether the D LDL decomposition is positive semi-definite
 724 
        [~, D, ~] = ldl(B,'vector');
 725 
        % Check that diagonal elements are non-negative and 2x2 diagonal
 726 
        % blocks are positive semi-definite:
 727 
        alpha = diag(D);
 728 
        beta = diag(D,1);
 729 
        spdB = checkTridiagForHSD(alpha, beta);
 730 
    else
 731 
        if spdB
 732 
            error(message('MATLAB:eigs:IsSymmetricDefiniteNotPD'));
 733 
        else % spdB is false or []
 734 
            spdB = false;
 735 
        end
 736 
    end
 737 
    
 738 
    if shiftAndInvert || ~spdB
 739 
        % We do not actually need the Cholesky factor to solve the problem
 740 
        R = [];
 741 
        permB = [];
 742 
    end
 743 
    
 744 
else
 745 
    % We do not need chol
 746 
    R = [];
 747 
    permB = [];
 748 
    if isempty(spdB)
 749 
        % B is empty or not Hermitian
 750 
        spdB = false;
 751 
    end
 752 
    % else we take the user's input
 753 
end
< 0.001 
      1 
 754
end 

Other subfunctions in this file are not included in this listing.