Mercurial > hg > octave-nkf
changeset 5000:9a7ec88c8b5e
[project @ 2004-09-15 22:03:24 by jwe]
author | jwe |
---|---|
date | Wed, 15 Sep 2004 22:03:24 +0000 |
parents | 5538e4ceb616 |
children | 6690d8cd9bee |
files | src/DLD-FUNCTIONS/sort.cc |
diffstat | 1 files changed, 16 insertions(+), 14 deletions(-) [+] |
line wrap: on
line diff
--- a/src/DLD-FUNCTIONS/sort.cc +++ b/src/DLD-FUNCTIONS/sort.cc @@ -1,4 +1,4 @@ -v/* +/* Copyright (C) 1996, 1997 John W. Eaton Copyright (C) 2004 David Bateman @@ -59,10 +59,10 @@ return retval; dim_vector dv = m.dims (); - unsigned int ns = dv (dim); + unsigned int ns = dv(dim); unsigned int iter = dv.numel () / ns; unsigned int stride = 1; - for (unsigned int i = 0; i < (unsigned int)dim; i++) + for (unsigned int i = 0; i < static_cast<unsigned int> (dim); i++) stride *= dv(i); T *v = m.fortran_vec (); @@ -120,10 +120,10 @@ return retval; dim_vector dv = m.dims (); - unsigned int ns = dv (dim); + unsigned int ns = dv(dim); unsigned int iter = dv.numel () / ns; unsigned int stride = 1; - for (unsigned int i = 0; i < (unsigned int)dim; i++) + for (unsigned int i = 0; i < static_cast<unsigned int> (dim); i++) stride *= dv(i); T *v = m.fortran_vec (); @@ -208,13 +208,14 @@ static inline unsigned EIGHT_BYTE_INT FloatFlip (unsigned EIGHT_BYTE_INT f) { - unsigned EIGHT_BYTE_INT mask = -(EIGHT_BYTE_INT)(f >> 63) | - 0x8000000000000000ULL; + unsigned EIGHT_BYTE_INT mask + = -(EIGHT_BYTE_INT)(f >> 63) | 0x8000000000000000ULL; return f ^ mask; } -inline unsigned EIGHT_BYTE_INT IFloatFlip(unsigned EIGHT_BYTE_INT f) +inline unsigned EIGHT_BYTE_INT +IFloatFlip (unsigned EIGHT_BYTE_INT f) { unsigned EIGHT_BYTE_INT mask = ((f >> 63) - 1) | 0x8000000000000000ULL; @@ -263,7 +264,7 @@ return retval; dim_vector dv = m.dims (); - unsigned int ns = dv (dim); + unsigned int ns = dv(dim); unsigned int iter = dv.numel () / ns; unsigned int stride = 1; for (unsigned int i = 0; i < (unsigned int)dim; i++) @@ -380,10 +381,10 @@ return retval; dim_vector dv = m.dims (); - unsigned int ns = dv (dim); + unsigned int ns = dv(dim); unsigned int iter = dv.numel () / ns; unsigned int stride = 1; - for (unsigned int i = 0; i < (unsigned int)dim; i++) + for (unsigned int i = 0; i < static_cast<unsigned int> (dim); i++) stride *= dv(i); double *v = m.fortran_vec (); @@ -599,7 +600,8 @@ "-*- texinfo -*-\n\ @deftypefn {Loadable Function} {[@var{s}, @var{i}] =} sort (@var{x})\n\ @deftypefnx {Loadable Function} {[@var{s}, @var{i}] =} sort (@var{x}, @var{dim})\n\ -@deftypefnx {Loadable Function} {[@var{s}, @var{i}] =} sort (@dots{}, @var{mode})\n\ +@deftypefnx {Loadable Function} {[@var{s}, @var{i}] =} sort (@var{x}, @var{mode})\n\ +@deftypefnx {Loadable Function} {[@var{s}, @var{i}] =} sort (@var{x}, @var{dim}, @var{mode})\n\ Return a copy of @var{x} with the elements elements arranged in\n\ increasing order. For matrices, @code{sort} orders the elements in each\n\ column.\n\ @@ -673,7 +675,7 @@ smode = DESCENDING; else { - error ("sort: mode must be either `ascend' or `descend'"); + error ("sort: mode must be either \"ascend\" or \"descend\""); return retval; } } @@ -701,7 +703,7 @@ smode = DESCENDING; else { - error ("sort: mode must be either `ascend' or `descend'"); + error ("sort: mode must be either \"ascend\" or \"descend\""); return retval; } }