[project @ 1994-05-25 21:00:20 by jwe]
author |
jwe |
date |
Wed, 25 May 1994 21:02:14 +0000 |
parents |
49eddf39e77d |
children |
5e778965b6ea |
files |
liboctave/idx-vector.cc liboctave/idx-vector.h |
diffstat |
2 files changed, 11 insertions(+), 0 deletions(-)
[+]
|
line diff
--- a/liboctave/idx-vector.cc
+++ b/liboctave/idx-vector.cc
@@ -313,6 +313,15 @@
}
}
+void
+idx_vector::shorten (int n)
+{
+ if (n > 0 && n <= len)
+ len = n;
+ else
+ panic_impossible ();
+}
+
ostream&
operator << (ostream& os, const idx_vector& a)
{
--- a/liboctave/idx-vector.h
+++ b/liboctave/idx-vector.h
@@ -64,6 +64,8 @@
void sort (void);
void sort_uniq (void);
+ void shorten (int n); // Unsafe. Avoid at all cost.
+
// i/o
friend ostream& operator << (ostream& os, const idx_vector& a);