# HG changeset patch # User jwe # Date 813194568 0 # Node ID 8f63ee44726ca8fff4d69b8c4f90276ad5e790b9 # Parent d89532de8e726713ecd4ff6523bc94edc13f8797 [project @ 1995-10-08 23:19:55 by jwe] diff --git a/liboctave/Makefile.in b/liboctave/Makefile.in --- a/liboctave/Makefile.in +++ b/liboctave/Makefile.in @@ -29,7 +29,8 @@ INCLUDES = Bounds.h CollocWt.h DAE.h DAEFunc.h FEGrid.h FSQP.h \ LinConst.h LP.h LPsolve.h NLConst.h NLEqn.h NLFunc.h NLP.h \ NPSOL.h ODE.h ODEFunc.h Objective.h QLD.h QP.h QPSOL.h \ - Quad.h Range.h base-min.h lo-error.h f77-uscore.h sun-utils.h \ + Quad.h Range.h base-min.h f77-uscore.h idx-vector.h \ + lo-error.h sun-utils.h \ $(MATRIX_INC) TEMPLATE_SRC = Array.cc MArray.cc @@ -45,7 +46,7 @@ SOURCES = Bounds.cc CollocWt.cc DAE.cc FEGrid.cc FSQP.cc LinConst.cc \ LPsolve.cc NLEqn.cc NPSOL.cc ODE.cc QLD.cc QPSOL.cc Quad.cc \ - Range.cc lo-error.cc sun-utils.cc \ + Range.cc idx-vector.cc lo-error.cc sun-utils.cc \ $(TEMPLATE_SRC) \ $(TI_SRC) \ $(MATRIX_SRC) diff --git a/liboctave/idx-vector.h b/liboctave/idx-vector.h --- a/liboctave/idx-vector.h +++ b/liboctave/idx-vector.h @@ -36,7 +36,17 @@ idx_vector { public: - idx_vector (void); + + idx_vector::idx_vector (void) + { + len = 0; + num_zeros = 0; + num_ones = 0; + one_zero = 0; + initialized = 0; + data = 0; + } + idx_vector (const idx_vector& a); idx_vector (const Matrix& m, int do_ftn_idx, @@ -44,28 +54,31 @@ idx_vector (const Range& r); - ~idx_vector (void); + idx_vector::~idx_vector (void) { delete [] data; } idx_vector& operator = (const idx_vector& a); - operator void * () const; + idx_vector::operator void * () const + { + return initialized ? (void *) 1 : (void *) 0; + } + + int idx_vector::capacity (void) const { return len; } + int idx_vector::length (void) const { return len; } - int capacity (void) const; - int length (void) const; + int idx_vector::elem (int n) const { return data[n]; } + + int idx_vector::operator () (int n) const { return checkelem (n); } - int elem (int n) const; - int checkelem (int n) const; - int operator () (int n) const; + int idx_vector::max (void) const { return max_val; } + int idx_vector::min (void) const { return min_val; } + + int idx_vector::one_zero_only (void) const { return one_zero; } + int idx_vector::zeros_count (void) const { return num_zeros; } + int idx_vector::ones_count (void) const { return num_ones; } // other stuff - int max (void) const; - int min (void) const; - - int one_zero_only (void) const; - int zeros_count (void) const; - int ones_count (void) const; - void sort (void); void sort_uniq (void); @@ -78,52 +91,18 @@ private: int len; - int one_zero; int num_zeros; int num_ones; int max_val; int min_val; - int initialized; + unsigned int one_zero : 1; + unsigned int initialized : 1; int *data; void init_state (const char *rc = 0, int z_len = 0); void convert_one_zero_to_idx (void); }; -inline idx_vector::idx_vector (void) -{ - len = 0; - data = 0; - num_zeros = 0; - num_ones = 0; - one_zero = 0; - initialized = 0; -} - -inline idx_vector::~idx_vector (void) -{ - delete [] data; -} - -inline idx_vector::operator void * () const -{ - return initialized ? (void *) 1 : (void *) 0; -} - -inline int idx_vector::capacity (void) const { return len; } -inline int idx_vector::length (void) const { return len; } - -inline int idx_vector::elem (int n) const { return data[n]; } - -inline int idx_vector::operator () (int n) const { return checkelem (n); } - -inline int idx_vector::max (void) const { return max_val; } -inline int idx_vector::min (void) const { return min_val; } - -inline int idx_vector::one_zero_only (void) const { return one_zero; } -inline int idx_vector::zeros_count (void) const { return num_zeros; } -inline int idx_vector::ones_count (void) const { return num_ones; } - #endif /* diff --git a/src/Makefile.in b/src/Makefile.in --- a/src/Makefile.in +++ b/src/Makefile.in @@ -59,11 +59,10 @@ INCLUDES := arith-ops.h builtins.h defaults.h.in defun.h defun-dld.h \ defun-int.h dirfns.h dynamic-ld.h error.h file-info.h \ - file-io.h fnmatch.h getopt.h gripes.h help.h idx-vector.h \ - input.h lex.h load-save.h mappers.h missing-math.h \ - oct-gperf.h octave.h octave-hist.h \ - oct-map.h oct-obj.h oct-str.h pager.h parse.h pathlen.h \ - pathsearch.h pr-output.h procstream.h sighandlers.h \ + file-io.h fnmatch.h getopt.h gripes.h help.h input.h lex.h \ + load-save.h mappers.h missing-math.h oct-gperf.h octave.h \ + octave-hist.h oct-map.h oct-obj.h oct-str.h pager.h parse.h \ + pathlen.h pathsearch.h pr-output.h procstream.h sighandlers.h \ statdefs.h symtab.h sysdep.h sysdir.h systime.h syswait.h \ token.h tree-base.h tree-cmd.h tree-const.h tree-expr.h \ tree-misc.h tree-plot.h tc-inlines.h tc-rep.h unwind-prot.h \ @@ -79,8 +78,7 @@ SOURCES := acosh.c arith-ops.cc asinh.c atanh.c data.cc dirfns.cc \ dynamic-ld.cc erf.c erfc.c error.cc file-info.cc file-io.cc \ - filemode.c \ - fnmatch.c getopt.c getopt1.c gripes.cc help.cc idx-vector.cc \ + filemode.c fnmatch.c getopt.c getopt1.c gripes.cc help.cc \ input.cc lex.l load-save.cc mappers.cc mkdir.c octave.cc \ octave-hist.cc oct-map.cc oct-obj.cc oct-str.cc pager.cc \ parse.y pr-output.cc procstream.cc rename.c resource.cc \