Mercurial > hg > octave-lyh
diff liboctave/oct-rand.cc @ 7536:4dda6fbc8ba6
oct-rand.cc: fix typo
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 26 Feb 2008 20:29:58 -0500 |
parents | bda16af4fd2f |
children | a2950622f070 72830070a17b |
line wrap: on
line diff
--- a/liboctave/oct-rand.cc +++ b/liboctave/oct-rand.cc @@ -197,10 +197,11 @@ retval = expon_dist; else if (d == "poisson" || d == "randp") retval = poisson_dist; - else if (d == "gamma" || d == "rangd") + else if (d == "gamma" || d == "randg") retval = gamma_dist; else - (*current_liboctave_error_handler) ("rand: invalid distribution"); + (*current_liboctave_error_handler) + ("rand: invalid distribution `%s'", d.c_str ()); return retval; } @@ -349,7 +350,8 @@ break; default: - (*current_liboctave_error_handler) ("rand: invalid distribution"); + (*current_liboctave_error_handler) + ("rand: invalid distribution ID = %d", current_distribution); break; } @@ -359,7 +361,9 @@ void octave_rand::distribution (const std::string& d) { - switch (get_dist_id (d)) + int id = get_dist_id (d); + + switch (id) { case uniform_dist: octave_rand::uniform_distribution (); @@ -382,7 +386,8 @@ break; default: - (*current_liboctave_error_handler) ("rand: invalid distribution"); + (*current_liboctave_error_handler) + ("rand: invalid distribution ID = %d", id); break; } } @@ -480,7 +485,8 @@ break; default: - (*current_liboctave_error_handler) ("rand: invalid distribution"); + (*current_liboctave_error_handler) + ("rand: invalid distribution ID = %d", current_distribution); break; } } @@ -509,7 +515,8 @@ break; default: - (*current_liboctave_error_handler) ("rand: invalid distribution"); + (*current_liboctave_error_handler) + ("rand: invalid distribution ID = %d", current_distribution); break; } @@ -613,7 +620,8 @@ break; default: - (*current_liboctave_error_handler) ("rand: invalid distribution"); + (*current_liboctave_error_handler) + ("rand: invalid distribution ID = %d", current_distribution); break; }