time | Calls | line |
---|
| | 477 | function Bpresent = isBpresent(B, nin, Amatrix, n)
|
| | 478 |
|
< 0.001 | 1 | 479 | if isempty(B) % allow eigs(A,[],k,sigma,opts);
|
| | 480 | Bpresent = true; % this will cause input [] to be skipped
|
| | 481 | return;
|
| | 482 | end
|
< 0.001 | 1 | 483 | if ~isnumeric(B)
|
| | 484 | Bpresent = false;
|
| | 485 | return;
|
| | 486 | end
|
< 0.001 | 1 | 487 | if ~isscalar(B)
|
| | 488 | % B is not a scalar.
|
| | 489 | if ~isa(B,'double')
|
| | 490 | error(message('MATLAB:eigs:BnonDouble'));
|
| | 491 | elseif ~isequal(size(B), [n,n])
|
| | 492 | error(message('MATLAB:eigs:BsizeMismatchA'));
|
| | 493 | end
|
| | 494 | Bpresent = true;
|
| | 495 | return;
|
| | 496 | end
|
| | 497 |
|
< 0.001 | 1 | 498 | if n ~= 1
|
| | 499 | % B is a numeric scalar, and A is not scalar:
|
| | 500 | % This input is really K and B is not specified
|
< 0.001 | 1 | 501 | Bpresent = false;
|
< 0.001 | 1 | 502 | return;
|
| | 503 | end
|
| | 504 | % This input could be B or K.
|
| | 505 | % If A is scalar, then the only valid value for k is 1.
|
| | 506 | % So if this input is scalar, let it be B, namely
|
| | 507 | % eigs(4,2,...) assumes A=4, B=2, NOT A=4, k=2
|
| | 508 | % Unless, of course, the scalar is 1, in which case
|
| | 509 | % assume that it is meant to be K.
|
| | 510 | if (B == 1) && ((Amatrix && nin <= 4) || (~Amatrix && nin <= 5))
|
| | 511 | Bpresent = false;
|
| | 512 | else
|
| | 513 | Bpresent = true;
|
| | 514 | if ~isa(B,'double')
|
| | 515 | error(message('MATLAB:eigs:BnonDouble'));
|
| | 516 | end
|
| | 517 | end
|
| | 518 | end
|
Other subfunctions in this file are not included in this listing.