# HG changeset patch # User jwe # Date 1145373502 0 # Node ID f3be83cff1531a34a098c157279245652dd0a8a3 # Parent 7ba9ad1fec11d72a8d72472c866819f068441ffb [project @ 2006-04-18 15:17:34 by jwe] diff --git a/liboctave/ChangeLog b/liboctave/ChangeLog --- a/liboctave/ChangeLog +++ b/liboctave/ChangeLog @@ -1,3 +1,11 @@ +2006-04-18 John W. Eaton + + * randmtzig.c (randmt, randi53, randi54, randi64, randu32, randu53): + Omit inline from decl. + + * Sparse.cc (Sparse::index): Use std::vector to avoid + local array with variable dimension. + 2006-04-16 John W. Eaton * lo-sstream.h: Delete. diff --git a/liboctave/Sparse.cc b/liboctave/Sparse.cc --- a/liboctave/Sparse.cc +++ b/liboctave/Sparse.cc @@ -1894,9 +1894,7 @@ retval = Sparse (n, m, nnz ()); octave_idx_type *ri = retval.xridx (); - // Can't use OCTAVE_LOCAL_BUFFER with bool, and so - // can't with T either - T X [n]; + std::vector X (n); for (octave_idx_type i = 0; i < nr; i++) itmp [i] = -1; for (octave_idx_type i = 0; i < n; i++) diff --git a/liboctave/randmtzig.c b/liboctave/randmtzig.c --- a/liboctave/randmtzig.c +++ b/liboctave/randmtzig.c @@ -98,15 +98,15 @@ void oct_init_by_entropy(void) random initial state void oct_get_state(uint32_t save[MT_N+1]) saves state in array void oct_set_state(uint32_t save[MT_N+1]) restores state from array - static inline uint32_t randmt(void) returns 32-bit unsigned int + static uint32_t randmt(void) returns 32-bit unsigned int === inline generators === - static inline uint32_t randi32(void) returns 32-bit unsigned int - static inline uint64_t randi53(void) returns 53-bit unsigned int - static inline uint64_t randi54(void) returns 54-bit unsigned int - static inline uint64_t randi64(void) returns 64-bit unsigned int - static inline double randu32(void) returns 32-bit uniform in (0,1) - static inline double randu53(void) returns 53-bit uniform in (0,1) + static uint32_t randi32(void) returns 32-bit unsigned int + static uint64_t randi53(void) returns 53-bit unsigned int + static uint64_t randi54(void) returns 54-bit unsigned int + static uint64_t randi64(void) returns 64-bit unsigned int + static double randu32(void) returns 32-bit uniform in (0,1) + static double randu53(void) returns 53-bit uniform in (0,1) double oct_randu(void) returns M-bit uniform in (0,1) double oct_randn(void) returns M-bit standard normal @@ -303,7 +303,7 @@ } /* generates a random number on [0,0xffffffff]-interval */ -static inline uint32_t +static uint32_t randmt (void) { register uint32_t y; @@ -324,7 +324,7 @@ /* Select which 32 bit generator to use */ #define randi32 randmt -static inline uint64_t +static uint64_t randi53 (void) { const uint32_t lo = randi32(); @@ -340,7 +340,7 @@ #endif } -static inline uint64_t +static uint64_t randi54 (void) { const uint32_t lo = randi32(); @@ -356,7 +356,7 @@ #endif } -static inline uint64_t +static uint64_t randi64 (void) { const uint32_t lo = randi32(); @@ -373,7 +373,7 @@ } /* generates a random number on (0,1)-real-interval */ -static inline double +static double randu32 (void) { return ((double)randi32() + 0.5) * (1.0/4294967296.0); @@ -381,7 +381,7 @@ } /* generates a random number on (0,1) with 53-bit resolution */ -static inline double +static double randu53 (void) { const uint32_t a=randi32()>>5;