1 ## Copyright (C) 2010 VZLU Prague
3 ## This program is free software; you can redistribute it and/or modify
4 ## it under the terms of the GNU General Public License as published by
5 ## the Free Software Foundation; either version 3 of the License, or
6 ## (at your option) any later version.
8 ## This program is distributed in the hope that it will be useful,
9 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
10 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 ## GNU General Public License for more details.
13 ## You should have received a copy of the GNU General Public License
14 ## along with Octave; see the file COPYING. If not, see
15 ## <http://www.gnu.org/licenses/>.
17 function s = plus (s1, s2)
18 if (isa (s1, "blksparse") && isa (s2, "blksparse"))
24 if (bsiz1(2) != bsiz2(1))
25 gripe_nonconformant (bsiz1, bsiz2, "block sizes");
26 elseif (siz1(2) != siz2(1))
27 gripe_nonconformant (bsiz1.*siz1, bsiz2.*siz2);
31 s = blksparse ([s1.i; s2.i], [s1.j; s2.j], cat (3, s1.sv, s2.sv), siz1(1), siz1(2));
33 error ("blksparse: only blksparse + blksparse implemented");
37 function gripe_nonconformant (s1, s2, what = "arguments")
38 error ("Octave:nonconformant-args", ...
39 "nonconformant %s (op1 is %dx%d, op2 is %dx%d)", what, s1, s2);