File: gee_its_simple_check.m

package info (click to toggle)
suitesparse 1%3A5.8.1%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 152,716 kB
  • sloc: ansic: 774,385; cpp: 24,213; makefile: 6,310; fortran: 1,927; java: 1,826; csh: 1,686; ruby: 725; sh: 535; perl: 225; python: 209; sed: 164; awk: 60
file content (30 lines) | stat: -rw-r--r-- 743 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
function gee_its_simple_check (A, name, b)
%GEE_ITS_SIMPLE_CHECK private function to check input arguments
% Ensures the matrix A is square, and that the right-hand-side b has the same
% number of rows as A (if present).  All matrices must be 2D, as well.
%
% Example:
%   gee_its_simple_check (A, 'A', b)
%
% See also: gee_its_simple

% Copyright 2007, Timothy A. Davis, http://www.suitesparse.com

[m n] = size (A) ;
if (m ~= n)
    error ('%s must be square', name) ;
end

if (ndims (A) ~= 2)
    error ('%s must be a 2D matrix', name) ;
end

if (nargin > 2)
    if (m ~= size (b,1))
        error ('%s and b must have the same number of rows', name) ;
    end
    if (ndims (b) ~= 2)
        error ('b must be a 2D matrix') ;
    end
end