Mercurial > hg > octave-nkf
comparison src/ov-perm.cc @ 11570:57632dea2446
attempt better backward compatibility for Array constructors
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 19 Jan 2011 17:55:56 -0500 |
parents | fd0a3ac60b0e |
children | 12df7854fa7c |
comparison
equal
deleted
inserted
replaced
11569:7e9a111cae20 | 11570:57632dea2446 |
---|---|
284 error ("load: failed to load permutation matrix constant"); | 284 error ("load: failed to load permutation matrix constant"); |
285 success = false; | 285 success = false; |
286 } | 286 } |
287 else | 287 else |
288 { | 288 { |
289 Array<octave_idx_type> pvec (n, 1); | 289 Array<octave_idx_type> pvec (dim_vector (n, 1)); |
290 for (octave_idx_type i = 0; i < n; i++) pvec(i) = tmp(i) - 1; | 290 for (octave_idx_type i = 0; i < n; i++) pvec(i) = tmp(i) - 1; |
291 matrix = PermMatrix (pvec, colp); | 291 matrix = PermMatrix (pvec, colp); |
292 | 292 |
293 // Invalidate cache. Probably not necessary, but safe. | 293 // Invalidate cache. Probably not necessary, but safe. |
294 dense_cache = octave_value (); | 294 dense_cache = octave_value (); |
324 bool colp; | 324 bool colp; |
325 if (! (is.read (reinterpret_cast<char *> (&sz), 4) | 325 if (! (is.read (reinterpret_cast<char *> (&sz), 4) |
326 && is.read (reinterpret_cast<char *> (&colp), 1))) | 326 && is.read (reinterpret_cast<char *> (&colp), 1))) |
327 return false; | 327 return false; |
328 | 328 |
329 MArray<octave_idx_type> m (sz, 1); | 329 MArray<octave_idx_type> m (dim_vector (sz, 1)); |
330 | 330 |
331 if (! is.read (reinterpret_cast<char *> (m.fortran_vec ()), m.byte_size ())) | 331 if (! is.read (reinterpret_cast<char *> (m.fortran_vec ()), m.byte_size ())) |
332 return false; | 332 return false; |
333 | 333 |
334 if (swap) | 334 if (swap) |