comparison liboctave/array/Sparse.cc @ 19270:dbe9a11f5dcb

maint: Periodic merge of gui-release to default.
author John W. Eaton <jwe@octave.org>
date Wed, 10 Sep 2014 14:19:58 -0400
parents aa9ca67f09fb 9254ff4036b2
children af41e41ad28e
comparison
equal deleted inserted replaced
19268:429ed2f2e8c6 19270:dbe9a11f5dcb
843 retval.xcidx (0) = 0; 843 retval.xcidx (0) = 0;
844 for (octave_idx_type i = 0; i < old_nc; i++) 844 for (octave_idx_type i = 0; i < old_nc; i++)
845 for (octave_idx_type j = cidx (i); j < cidx (i+1); j++) 845 for (octave_idx_type j = cidx (i); j < cidx (i+1); j++)
846 { 846 {
847 octave_idx_type tmp = i * old_nr + ridx (j); 847 octave_idx_type tmp = i * old_nr + ridx (j);
848 if (tmp < 0)
849 (*current_liboctave_error_handler)
850 ("reshape: overflow in octave_idx_type prevents reshaping array");
851
848 octave_idx_type ii = tmp % new_nr; 852 octave_idx_type ii = tmp % new_nr;
849 octave_idx_type jj = (tmp - ii) / new_nr; 853 octave_idx_type jj = (tmp - ii) / new_nr;
850 for (octave_idx_type k = kk; k < jj; k++) 854 for (octave_idx_type k = kk; k < jj; k++)
851 retval.xcidx (k+1) = j; 855 retval.xcidx (k+1) = j;
852 kk = jj; 856 kk = jj;