# HG changeset patch # User jwe # Date 1187112659 0 # Node ID 8c89a644df8a78b07987d1611b31b1d8f149060a # Parent 75d99621f850f867e900e284946666d605b46a79 [project @ 2007-08-14 17:30:59 by jwe] diff --git a/liboctave/ChangeLog b/liboctave/ChangeLog --- a/liboctave/ChangeLog +++ b/liboctave/ChangeLog @@ -2,6 +2,7 @@ * Sparse.cc (Sparse::permute): permutation vector is zero based. Simplify. + (Sparse::reshape): Warn about reshaping to N-d array. 2007-08-10 Michael Goffioul diff --git a/liboctave/Sparse.cc b/liboctave/Sparse.cc --- a/liboctave/Sparse.cc +++ b/liboctave/Sparse.cc @@ -734,8 +734,12 @@ if (dims2.length () > 2) { + (*current_liboctave_warning_handler) + ("reshape: sparse reshape to N-d array smashes dims"); + for (octave_idx_type i = 2; i < dims2.length(); i++) - dims2 (1) *= dims2(i); + dims2(1) *= dims2(i); + dims2.resize (2); }