# HG changeset patch # User John W. Eaton # Date 1285711932 14400 # Node ID e7864673c31fa552612150d4ce1c28afef04ae87 # Parent 169f59f626d34426369d0c175c7e34cb66a1c863 new Cell (std::list&) constructor diff -r 169f59f626d3 -r e7864673c31f src/Cell.cc --- a/src/Cell.cc Tue Sep 28 17:24:49 2010 -0400 +++ b/src/Cell.cc Tue Sep 28 18:12:12 2010 -0400 @@ -63,6 +63,25 @@ } } +Cell::Cell (const std::list& lst) + : Array () +{ + size_t n = lst.size (); + + if (n > 0) + { + resize (dim_vector (n, 1)); + + octave_idx_type i = 0; + + for (std::list::const_iterator it = lst.begin (); + it != lst.end (); it++) + { + elem(i++,0) = *it; + } + } +} + Cell::Cell (const Array& sa) : Array (sa.dims ()) { diff -r 169f59f626d3 -r e7864673c31f src/Cell.h --- a/src/Cell.h Tue Sep 28 17:24:49 2010 -0400 +++ b/src/Cell.h Tue Sep 28 18:12:12 2010 -0400 @@ -63,6 +63,8 @@ Cell (const string_vector& sv, bool trim = false); + Cell (const std::list& lst); + Cell (const Array& sa); Cell (const dim_vector& dv, const string_vector& sv, bool trim = false); diff -r 169f59f626d3 -r e7864673c31f src/ChangeLog --- a/src/ChangeLog Tue Sep 28 17:24:49 2010 -0400 +++ b/src/ChangeLog Tue Sep 28 18:12:12 2010 -0400 @@ -1,3 +1,8 @@ +2010-09-28 John W. Eaton + + * Cell.h, Cell.cc (Cell::Cell (const std::list&)): + New constructor. + 2010-09-28 John P. Swensen * DLD-FUNCTIONS/__magick_read__.cc (maybe_initialize_magick):