comparison liboctave/idx-vector.cc @ 11503:b3f511c48b14

idx-vector.h, idx-vector.cc: data member initialization and constructor fixes
author John W. Eaton <jwe@octave.org>
date Thu, 13 Jan 2011 03:27:29 -0500
parents c49911ab7ac7
children fd0a3ac60b0e
comparison
equal deleted inserted replaced
11502:4638800cd660 11503:b3f511c48b14
262 262
263 DEFINE_OCTAVE_ALLOCATOR(idx_vector::idx_scalar_rep); 263 DEFINE_OCTAVE_ALLOCATOR(idx_vector::idx_scalar_rep);
264 264
265 template <class T> 265 template <class T>
266 idx_vector::idx_scalar_rep::idx_scalar_rep (T x) 266 idx_vector::idx_scalar_rep::idx_scalar_rep (T x)
267 : data (0)
267 { 268 {
268 octave_idx_type dummy = 0; 269 octave_idx_type dummy = 0;
269 270
270 data = convert_index (x, err, dummy); 271 data = convert_index (x, err, dummy);
271 272
338 339
339 // Note that this makes a shallow copy of the index array. 340 // Note that this makes a shallow copy of the index array.
340 341
341 idx_vector::idx_vector_rep::idx_vector_rep (const Array<octave_idx_type>& inda) 342 idx_vector::idx_vector_rep::idx_vector_rep (const Array<octave_idx_type>& inda)
342 : data (inda.data ()), len (inda.numel ()), ext (0), 343 : data (inda.data ()), len (inda.numel ()), ext (0),
343 aowner (new Array<octave_idx_type> (inda)), orig_dims (inda.dims ()) 344 aowner (new Array<octave_idx_type> (inda)), orig_dims (inda.dims ())
344 { 345 {
345 if (len != 0) 346 if (len != 0)
346 { 347 {
347 octave_idx_type max = -1; 348 octave_idx_type max = -1;
348 for (octave_idx_type i = 0; i < len; i++) 349 for (octave_idx_type i = 0; i < len; i++)