Mercurial > hg > octave-lyh
changeset 96:36ff440553cd
[project @ 1993-09-13 02:48:39 by jwe]
(vector_of_empties): Renamed from empty_tree, moved from f-syl.cc.
author | jwe |
---|---|
date | Mon, 13 Sep 1993 02:48:39 +0000 |
parents | e7c8e76a3224 |
children | eef502bbdffa |
files | src/pt-const.cc |
diffstat | 1 files changed, 28 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/pt-const.cc +++ b/src/pt-const.cc @@ -2392,6 +2392,34 @@ #endif /* + * Construct return vector of empty matrices. Return empty matrices + * and/or gripe when appropriate. + */ +tree_constant * +vector_of_empties (int nargout, char *fcn_name) +{ + tree_constant *retval = NULL_TREE_CONST; + +// Got an empty argument, check if should gripe/return empty values. + + int flag = user_pref.propagate_empty_matrices; + if (flag != 0) + { + if (flag < 0) + gripe_empty_arg (fcn_name, 0); + + Matrix m; + retval = new tree_constant [nargout+1]; + for (int i = 0; i < nargout; i++) + retval[i] = tree_constant (m); + } + else + gripe_empty_arg (fcn_name, 1); + + return retval; +} + +/* ;;; Local Variables: *** ;;; mode: C++ *** ;;; page-delimiter: "^/\\*" ***