time | Calls | line |
---|
| | 780 | function [innerOpts, useEig, eigsSigma] = extraChecks(innerOpts, B, n, k, spdB, useEig, eigsSigma)
|
| | 781 | % Do remaining argument checks that require knowing the problem type
|
| | 782 |
|
| | 783 | % If B not HPD, OP is not Hermitian (even if A is)
|
< 0.001 | 1 | 784 | innerOpts.ishermprob = innerOpts.ishermprob && (isempty(B) || spdB);
|
| | 785 |
|
| | 786 | % Maintain old sigma behavior and convert to new sigma
|
< 0.001 | 1 | 787 | if ismember(innerOpts.method, {'LI', 'SI'})
|
| | 788 | if innerOpts.isrealprob && ~innerOpts.ishermprob
|
| | 789 | if strcmp(innerOpts.method, 'LI')
|
| | 790 | eigsSigma = 'bothendsimag';
|
| | 791 | innerOpts.method = eigsSigma;
|
| | 792 | else
|
| | 793 | eigsSigma = 'smallestimagabs';
|
| | 794 | innerOpts.method = eigsSigma;
|
| | 795 | end
|
| | 796 | else
|
| | 797 | if strcmp(innerOpts.method, 'LI')
|
| | 798 | eigsSigma = 'largestimag';
|
| | 799 | innerOpts.method = eigsSigma;
|
| | 800 | else
|
| | 801 | eigsSigma = 'smallestimag';
|
| | 802 | innerOpts.method = eigsSigma;
|
| | 803 | end
|
| | 804 | end
|
| | 805 | end
|
| | 806 |
|
| | 807 | % Extra Checks on sigma
|
< 0.001 | 1 | 808 | if innerOpts.ishermprob
|
| | 809 | if ismember(innerOpts.method, {'largestimag', 'smallestimag', 'bothendsimag'})
|
| | 810 | % Problem has all real eigenvalues, and therefore we cannot sort
|
| | 811 | % them by imaginary part. Sort instead by abs(real)
|
| | 812 | innerOpts.method = 'largestabs';
|
| | 813 | end
|
| | 814 |
|
| | 815 | if ~isreal(innerOpts.sigma)
|
| | 816 | % Problem has all real eigenvalues but a complex shift
|
| | 817 | % Taking the real part keeps the problem real and symmetric but
|
| | 818 | % results will be the same
|
| | 819 | innerOpts.sigma = real(innerOpts.sigma);
|
| | 820 | end
|
| | 821 | end
|
| | 822 |
|
| | 823 | % Extra check/set default for input OPTS.p
|
| | 824 |
|
< 0.001 | 1 | 825 | if ~innerOpts.userp && innerOpts.isrealprob && ~innerOpts.ishermprob ...
|
| 1 | 826 | && ismember(innerOpts.method, {'largestimag', 'smallestimag'})
|
| | 827 |
|
| | 828 | % Raise p to account for needing to add conjugate pairs to the subspace
|
| | 829 | innerOpts.p = min(max(4*k,20),n);
|
| | 830 |
|
| | 831 | if innerOpts.p == n
|
| | 832 | % Since we are building the whole space anyway, do a full
|
| | 833 | % decomposition
|
| | 834 | useEig = true;
|
| | 835 | end
|
| | 836 | end
|
| | 837 |
|
< 0.001 | 1 | 838 | end
|
Other subfunctions in this file are not included in this listing.