comparison liboctave/dim-vector.h @ 4635:f2cd320cbf6e

[project @ 2003-11-20 01:48:23 by jwe]
author jwe
date Thu, 20 Nov 2003 01:48:23 +0000
parents fc30061d01da
children c8829691db47
comparison
equal deleted inserted replaced
4634:79fe96966ca0 4635:f2cd320cbf6e
248 { 248 {
249 retval = true; 249 retval = true;
250 break; 250 break;
251 } 251 }
252 } 252 }
253
254 return retval;
255 }
256
257 int
258 num_ones (void) const
259 {
260 int retval = 0;
261
262 for (int i = 0; i < length (); i++)
263 if (elem (i) == 1)
264 retval++;
253 265
254 return retval; 266 return retval;
255 } 267 }
256 268
257 // This is the number of elements that a matrix with this dimension 269 // This is the number of elements that a matrix with this dimension