1 ## Copyright (C) 2010 VZLU Prague, a.s., Czech Republic
3 ## This program is free software; you can redistribute it and/or modify it under
4 ## the terms of the GNU General Public License as published by the Free Software
5 ## Foundation; either version 3 of the License, or (at your option) any later
8 ## This program is distributed in the hope that it will be useful, but WITHOUT
9 ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 ## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
13 ## You should have received a copy of the GNU General Public License along with
14 ## this program; if not, see <http://www.gnu.org/licenses/>.
17 ## @deftypefn{Function File} {} parcellfun_opts (args)
18 ## Undocumented internal function.
21 function [nargs, uniform_output, error_handler, ...
22 verbose_level, chunks_per_proc, vectorized] = parcellfun_opts (args)
24 uniform_output = true;
26 verbose_level = 1; # default to normal output level
27 chunks_per_proc = 0; # 0 means than size of chunk is 1
30 nargs = length (args);
43 uniform_output = logical (val);
44 if (! isscalar (uniform_output))
45 error ("parcellfun: UniformOutput must be a logical scalar");
49 if (! isa (error_handler, "function_handle"))
50 error ("parcellfun: ErrorHandler must be a function handle");
54 if (! isscalar (verbose_level))
55 error ("parcellfun: VerboseLevel must be a numeric scalar");
58 chunks_per_proc = round (val);
59 if (! isscalar (chunks_per_proc) || chunks_per_proc <= 0)
60 error ("parcellfun: ChunksPerProc must be a positive scalar");
63 vectorized = logical (val);
64 if (! isscalar (vectorized))
65 error ("parcellfun: Vectorized must be a logical scalar");
73 if (vectorized && chunks_per_proc <= 0)
74 error ("parcellfun: the ""Vectorized"" option requires also ""ChunksPerProc""");