Mercurial > hg > octave-terminal
changeset 5518:a9bd6c31751f
[project @ 2005-10-29 04:26:38 by jwe]
author | jwe |
---|---|
date | Sat, 29 Oct 2005 04:28:23 +0000 |
parents | 947aa3464e1d |
children | 20b20fd070b0 |
files | ChangeLog configure.in liboctave/ChangeLog liboctave/oct-sparse.h liboctave/sparse-base-chol.cc scripts/ChangeLog scripts/general/ind2sub.m scripts/general/shiftdim.m src/ChangeLog src/mappers.cc |
diffstat | 10 files changed, 75 insertions(+), 45 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2005-10-28 John W. Eaton <jwe@octave.org> + + * configure.in (AC_ARG_WITH(cholmod, ...)): Fix typo. + From Quentin Spencer <qspencer@ieee.org> and + Andy Adler <adler@site.uOttawa.ca>. + 2005-10-26 John W. Eaton <jwe@octave.org> * configure.in, aclocal.m4: Don't quote "yes".
--- a/configure.in +++ b/configure.in @@ -29,7 +29,7 @@ EXTERN_CXXFLAGS="$CXXFLAGS" AC_INIT -AC_REVISION($Revision: 1.491 $) +AC_REVISION($Revision: 1.492 $) AC_PREREQ(2.57) AC_CONFIG_SRCDIR([src/octave.cc]) AC_CONFIG_HEADER(config.h) @@ -836,14 +836,14 @@ with_cholmod=yes], [ AC_CHECK_LIB(cholmod_start, cholmod, [CHOLMOD_LIBS="-lcholmod -cblas -lmetis"; with_cholmod=yes], [], - AMD_LIBS $COLAMD_LIBS $CCOLAMD_LIBS $BLAS_LIBS $FLIBS -lmetis)], + $AMD_LIBS $COLAMD_LIBS $CCOLAMD_LIBS $BLAS_LIBS $FLIBS -lmetis)], $AMD_LIBS $COLAMD_LIBS $CCOLAMD_LIBS $BLAS_LIBS $FLIBS -lmetis) else AC_CHECK_LIB(cholmod, cholmod_start, [CHOLMOD_LIBS="-lcholmod"; with_cholmod=yes], [ AC_CHECK_LIB(cholmod_start, cholmod, [CHOLMOD_LIBS="-lcholmod -cblas"; with_cholmod=yes], [], - AMD_LIBS $COLAMD_LIBS $CCOLAMD_LIBS $BLAS_LIBS $FLIBS)], + $AMD_LIBS $COLAMD_LIBS $CCOLAMD_LIBS $BLAS_LIBS $FLIBS)], $AMD_LIBS $COLAMD_LIBS $CCOLAMD_LIBS $BLAS_LIBS $FLIBS) fi
--- a/liboctave/ChangeLog +++ b/liboctave/ChangeLog @@ -1,3 +1,11 @@ +2005-10-28 John W. Eaton <jwe@octave.org> + + * oct-sparse.h: Fix typo in HAVE_UFSPARSE_UMFPACK_H. + From Quentin Spencer <qspencer@ieee.org>. + + * sparse-base-chol.cc: Use C++ true/false instead of + preprocessor defined TRUE/FALSE. Use 0 instead of NULL. + 2005-10-27 John W. Eaton <jwe@octave.org> * Array.cc (assignN): Reshape to final size instead of resizing.
--- a/liboctave/oct-sparse.h +++ b/liboctave/oct-sparse.h @@ -32,7 +32,7 @@ extern "C" { #endif -#if defined (HAVE_UFSPARSE_UMFPACK_h) +#if defined (HAVE_UFSPARSE_UMFPACK_H) #include <ufsparse/umfpack.h> #elif defined (HAVE_UMFPACK_UMFPACK_H) #include <umfpack/umfpack.h>
--- a/liboctave/sparse-base-chol.cc +++ b/liboctave/sparse-base-chol.cc @@ -44,7 +44,7 @@ chol_elt *Sx; octave_idx_type pdest, k, ncol, p, pend; - if (S == NULL) + if (! S) return; Sp = static_cast<octave_idx_type *>(S->p); @@ -97,13 +97,13 @@ // Setup initial parameters CHOLMOD_NAME(start) (cm); - cm->prefer_zomplex = FALSE; + cm->prefer_zomplex = false; double spu = Voctave_sparse_controls.get_key ("spumoni"); if (spu == 0.) { cm->print = -1; - cm->print_function = NULL; + cm->print_function = 0; } else { @@ -135,12 +135,12 @@ #endif #endif - cm->final_asis = FALSE; - cm->final_super = FALSE; - cm->final_ll = TRUE; - cm->final_pack = TRUE; - cm->final_monotonic = TRUE; - cm->final_resymbol = FALSE; + cm->final_asis = false; + cm->final_super = false; + cm->final_ll = true; + cm->final_pack = true; + cm->final_monotonic = true; + cm->final_resymbol = false; cholmod_sparse A; cholmod_sparse *ac = &A; @@ -151,9 +151,9 @@ ac->p = a.cidx(); ac->i = a.ridx(); ac->nzmax = a.nonzero(); - ac->packed = TRUE; - ac->sorted = TRUE; - ac->nz = NULL; + ac->packed = true; + ac->sorted = true; + ac->nz = 0; #ifdef IDX_TYPE_LONG ac->itype = CHOLMOD_LONG; #else @@ -177,7 +177,7 @@ { cm->nmethods = 1 ; cm->method [0].ordering = CHOLMOD_NATURAL ; - cm->postorder = FALSE ; + cm->postorder = false ; } cholmod_factor *Lfactor;
--- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,10 @@ +2005-10-28 John W. Eaton <jwe@octave.org> + + * general/shiftdim.m: Compatibility fix for row vectors. + Correct check for non-scalar non-integer shift. For positive + N, shift is remainder of N and number of dims. Always return NS. + Simplify. + 2005-10-18 Keith Goodman <kwgoodman@gmail.com> * general/randperm.m: Improve compatibility by allowing input
--- a/scripts/general/ind2sub.m +++ b/scripts/general/ind2sub.m @@ -66,7 +66,7 @@ error ("ind2sub: expecting integer-valued index argument"); endif else - error ("sub2ind: expecting dims to be an integer vector"); + error ("ind2sub: expecting dims to be an integer vector"); endif else usage ("ind2sub (dims, ind)");
--- a/scripts/general/shiftdim.m +++ b/scripts/general/shiftdim.m @@ -51,34 +51,38 @@ function [y, ns] = shiftdim (x, n) + if (nargin < 1 || nargin > 2) + usage ("shiftdim (x, n) or [b, ns] = shiftdim (x)"); + endif + + nd = ndims (x); + orig_dims = size (x); + if (nargin == 1) ## Find the first singleton dimension. - nd = ndims (x); - orig_dims = size (x); - ns = 1; - while (ns < nd + 1 && orig_dims(ns) == 1) - ns = ns + 1; + n = 0; + while (n < nd && orig_dims(n+1) == 1) + n++; endwhile - if (ns > nd) - ns = 1; - endif - y = reshape (x, orig_dims(ns:end)); - ns = ns - 1; - elseif (nargin == 2) - if (! isscalar (n) && floor (n) != n) - error ("shiftdim: n must be an scalar integer"); - endif - if (n < 0) - orig_dims = size (x); - singleton_dims = ones (1, -n); - y = reshape (x, [singleton_dims, orig_dims]); - elseif (n > 0) - ndims = length (size (x)); - y = permute (x, [n+1:ndims, 1:n]); - else - y = x; - endif + endif + + if (! isscalar (n) || floor (n) != n) + error ("shiftdim: n must be a scalar integer"); + endif + + if (n >= nd) + n = rem (n, nd); + endif + + if (n < 0) + singleton_dims = ones (1, -n); + y = reshape (x, [singleton_dims, orig_dims]); + elseif (n > 0) + y = reshape (x, [orig_dims(n+1:nd), orig_dims(1:n)]); else - usage ("shiftdim (x, n) or [b, ns] = shiftdim (x)"); + y = x; endif + + ns = n; + endfunction
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2005-10-27 James R. Van Zandt <jrvz@comcast.net> + + * mappers.cc: Doc fix for lgamma. + * DLD-FUNCTIONS/gammainc.cc (Fgammainc): Doc fix. + 2005-10-27 John W. Eaton <jwe@octave.org> * DLD-FUNCTIONS/__glpk__.cc (F__glpk__): Declare mrowsA volatile.
--- a/src/mappers.cc +++ b/src/mappers.cc @@ -522,8 +522,8 @@ DEFUN_MAPPER (lgamma, 0, 0, 0, xlgamma, 0, 0, 0.0, 0.0, 0, 0, "-*- texinfo -*-\n\ -@deftypefn {Mapping Function} {} lgamma (@var{a}, @var{x})\n\ -@deftypefnx {Mapping Function} {} gammaln (@var{a}, @var{x})\n\ +@deftypefn {Mapping Function} {} lgamma (@var{x})\n\ +@deftypefnx {Mapping Function} {} gammaln (@var{x})\n\ Return the natural logarithm of the gamma function.\n\ @end deftypefn\n\ @seealso{gamma and gammai}");