Mercurial > octave-nkf
comparison src/syl.cc @ 95:e7c8e76a3224
[project @ 1993-09-13 02:47:37 by jwe]
(syl): Call vector_of_empties() instead of empty_tree().
author | jwe |
---|---|
date | Mon, 13 Sep 1993 02:47:37 +0000 |
parents | ef73939dc2c5 |
children | 197bd6c63baa |
comparison
equal
deleted
inserted
replaced
94:c568ba9fc151 | 95:e7c8e76a3224 |
---|---|
48 const int*, const Complex*, const int*, | 48 const int*, const Complex*, const int*, |
49 const Complex*, const int*, double*, int*, | 49 const Complex*, const int*, double*, int*, |
50 long, long); | 50 long, long); |
51 } | 51 } |
52 | 52 |
53 // Local function: construct return vector of empty matrices. Return | |
54 // empty matrices and/or gripe when appropriate. Probably should make | |
55 // this available elsewhere, since tc-xxx functions do this a lot. | |
56 | |
57 tree_constant * | |
58 empty_tree (int nargout, char* fcn_name) | |
59 { | |
60 tree_constant *retval = NULL_TREE_CONST; | |
61 | |
62 // Got an empty argument, check if should gripe/return empty values. | |
63 | |
64 int flag = user_pref.propagate_empty_matrices; | |
65 if (flag != 0) | |
66 { | |
67 if (flag < 0) | |
68 gripe_empty_arg (fcn_name, 0); | |
69 | |
70 Matrix m; | |
71 retval = new tree_constant [nargout+1]; | |
72 for (int i = 0; i < nargout; i++) | |
73 retval[i] = tree_constant (m); | |
74 } | |
75 else | |
76 gripe_empty_arg (fcn_name, 1); | |
77 | |
78 return retval; | |
79 } | |
80 | |
81 // Return value of tree_constant argument as ComplexMatrix. | 53 // Return value of tree_constant argument as ComplexMatrix. |
82 | 54 |
83 ComplexMatrix | 55 ComplexMatrix |
84 ComplexMatrixLoad (tree_constant& arg) | 56 ComplexMatrixLoad (tree_constant& arg) |
85 { | 57 { |
132 tree_constant arga = args[1].make_numeric (); | 104 tree_constant arga = args[1].make_numeric (); |
133 tree_constant argb = args[2].make_numeric (); | 105 tree_constant argb = args[2].make_numeric (); |
134 tree_constant argc = args[3].make_numeric (); | 106 tree_constant argc = args[3].make_numeric (); |
135 | 107 |
136 if (arga.is_empty () || argb.is_empty () || argc.is_empty ()) | 108 if (arga.is_empty () || argb.is_empty () || argc.is_empty ()) |
137 retval = empty_tree (nargout, "syl"); | 109 retval = vector_of_empties (nargout, "syl"); |
138 else | 110 else |
139 { | 111 { |
140 | 112 |
141 // Arguments are not empty, so check for correct dimensions. | 113 // Arguments are not empty, so check for correct dimensions. |
142 | 114 |