Mercurial > hg > octave-lyh
diff src/pt-mat.cc @ 2990:35bd1b05cfbe
[project @ 1997-05-16 09:19:11 by jwe]
author | jwe |
---|---|
date | Fri, 16 May 1997 09:19:12 +0000 |
parents | 20f5cec4f11c |
children | fe2d1ae8926b |
line wrap: on
line diff
--- a/src/pt-mat.cc +++ b/src/pt-mat.cc @@ -104,38 +104,40 @@ public: - tm_row_const (void) : rep (0) { } + tm_row_const (void) + : rep (0) { } tm_row_const (const tree_argument_list& row) : rep (new tm_row_const_rep (row)) { } - tm_row_const (const tm_row_const& x) : rep (x.rep) - { - if (rep) - rep->count++; - } + tm_row_const (const tm_row_const& x) + : rep (x.rep) + { + if (rep) + rep->count++; + } tm_row_const& operator = (const tm_row_const& x) - { - if (this != &x && rep != x.rep) - { - if (rep && --rep->count == 0) - delete rep; + { + if (this != &x && rep != x.rep) + { + if (rep && --rep->count == 0) + delete rep; - rep = x.rep; + rep = x.rep; - if (rep) - rep->count++; - } + if (rep) + rep->count++; + } - return *this; - } + return *this; + } ~tm_row_const (void) - { - if (rep && --rep->count == 0) - delete rep; - } + { + if (rep && --rep->count == 0) + delete rep; + } int rows (void) { return rep->nr; } int cols (void) { return rep->nc; } @@ -153,10 +155,10 @@ void next (Pix& p) const { rep->next (p); } operator void* () const - { - return (rep && rep->ok) - ? static_cast<void *> (-1) : static_cast<void *> (0); - } + { + return (rep && rep->ok) + ? static_cast<void *> (-1) : static_cast<void *> (0); + } private: @@ -379,6 +381,15 @@ ok = ! error_state; } +tree_matrix::~tree_matrix (void) +{ + while (! empty ()) + { + tree_argument_list *t = remove_front (); + delete t; + } +} + bool tree_matrix::all_elements_are_constant (void) const {