Mercurial > hg > octave-lyh
diff liboctave/dim-vector.h @ 4559:802818bfac91
[project @ 2003-10-28 19:13:43 by jwe]
author | jwe |
---|---|
date | Tue, 28 Oct 2003 19:13:43 +0000 |
parents | 820323598f4f |
children | 1db951a4fcd5 |
line wrap: on
line diff
--- a/liboctave/dim-vector.h +++ b/liboctave/dim-vector.h @@ -199,7 +199,7 @@ } - std::string str (void) const + std::string str (char sep = 'x') const { OSSTREAM buf; @@ -208,7 +208,7 @@ buf << elem (i); if (i < length () - 1) - buf << "x"; + buf << sep; } buf << OSSTREAM_ENDS; @@ -235,6 +235,22 @@ return retval; } + + bool any_zero (void) const + { + bool retval = false; + + for (int i = 0; i < length (); i++) + { + if (elem (i) == 0) + { + retval = true; + break; + } + } + + return retval; + } }; static inline bool @@ -275,4 +291,3 @@ ;;; mode: C++ *** ;;; End: *** */ -