Mercurial > hg > octave-lyh
comparison src/oct-map.cc @ 5781:faafc2d98b8d
[project @ 2006-05-02 19:40:19 by jwe]
author | jwe |
---|---|
date | Tue, 02 May 2006 19:40:21 +0000 |
parents | c7d5a534afa5 |
children | 84ca47e311b3 |
comparison
equal
deleted
inserted
replaced
5780:cbf717bf8150 | 5781:faafc2d98b8d |
---|---|
138 } | 138 } |
139 | 139 |
140 return retval; | 140 return retval; |
141 } | 141 } |
142 | 142 |
143 Octave_map | 143 void |
144 Octave_map::resize (const dim_vector& dv, bool fill) const | 144 Octave_map::resize (const dim_vector& dv, bool fill) |
145 { | 145 { |
146 Octave_map retval; | |
147 | |
148 if (dv != dims ()) | 146 if (dv != dims ()) |
149 { | 147 { |
150 for (const_iterator p = begin (); p != end (); p++) | 148 for (const_iterator p = begin (); p != end (); p++) |
151 { | 149 { |
152 Cell tmp = contents(p); | 150 Cell tmp = contents(p); |
151 | |
153 if (fill) | 152 if (fill) |
154 tmp.resize(dv, Cell::resize_fill_value ()); | 153 tmp.resize(dv, Cell::resize_fill_value ()); |
155 else | 154 else |
156 tmp.resize(dv); | 155 tmp.resize(dv); |
157 retval.assign (key(p), tmp); | 156 |
158 } | 157 dimensions = dv; |
159 | 158 |
160 retval.dimensions = dv; | 159 assign (key(p), tmp); |
161 } | 160 } |
162 else | 161 } |
163 retval = *this; | |
164 | |
165 | |
166 return retval; | |
167 } | 162 } |
168 | 163 |
169 Octave_map | 164 Octave_map |
170 Octave_map::concat (const Octave_map& rb, const Array<octave_idx_type>& ra_idx) | 165 Octave_map::concat (const Octave_map& rb, const Array<octave_idx_type>& ra_idx) |
171 { | 166 { |