Mercurial > hg > octave-nkf
comparison liboctave/Array-util.cc @ 4635:f2cd320cbf6e
[project @ 2003-11-20 01:48:23 by jwe]
author | jwe |
---|---|
date | Thu, 20 Nov 2003 01:48:23 +0000 |
parents | 77566be8b9e9 |
children | bf7272f8ba8c |
comparison
equal
deleted
inserted
replaced
4634:79fe96966ca0 | 4635:f2cd320cbf6e |
---|---|
92 } | 92 } |
93 | 93 |
94 int | 94 int |
95 num_ones (const Array<int>& ra_idx) | 95 num_ones (const Array<int>& ra_idx) |
96 { | 96 { |
97 int retval (0); | 97 int retval = 0; |
98 | |
98 for (int i = 0; i < ra_idx.length (); i++) | 99 for (int i = 0; i < ra_idx.length (); i++) |
99 { | 100 { |
100 if (ra_idx (i) == 1) | 101 if (ra_idx (i) == 1) |
101 retval++; | 102 retval++; |
102 } | 103 } |
104 | |
103 return retval; | 105 return retval; |
104 } | 106 } |
105 | 107 |
106 bool | 108 bool |
107 is_scalar (const dim_vector& dim) | 109 is_scalar (const dim_vector& dim) |