Mercurial > hg > octave-nkf
comparison liboctave/Array-util.cc @ 11717:e5510f2d482a release-3-0-x
refactor Array::assignN dimensioning code for empty initial matrices
author | David Bateman <dbateman@free.fr> |
---|---|
date | Wed, 26 Mar 2008 15:41:59 -0400 |
parents | da540e715d05 |
children | 935be827eaf8 72830070a17b |
comparison
equal
deleted
inserted
replaced
11716:017e13f0d056 | 11717:e5510f2d482a |
---|---|
130 break; | 130 break; |
131 } | 131 } |
132 } | 132 } |
133 } | 133 } |
134 return retval; | 134 return retval; |
135 } | |
136 | |
137 bool | |
138 is_vector (const dim_vector& dim) | |
139 { | |
140 int m = 0; | |
141 int n = dim.length (); | |
142 bool retval = true; | |
143 | |
144 if (n == 0) | |
145 m = 2; | |
146 else | |
147 { | |
148 for (int i = 0; i < n; i ++) | |
149 if (dim (i) > 1) | |
150 m++; | |
151 else if (dim(i) < 1) | |
152 m += 2; | |
153 } | |
154 return (m < 2); | |
135 } | 155 } |
136 | 156 |
137 bool | 157 bool |
138 any_ones (const Array<octave_idx_type>& arr) | 158 any_ones (const Array<octave_idx_type>& arr) |
139 { | 159 { |