Mercurial > hgweb > octave
changeset 34642:954358d9ce6f
maint: Rename "lo-mappers.[h|cc]" to "mappers.[h|cc]"
Add new files with old name that issue cpp warning during compilation if used
that points to new files. Update .cc files to use new names and
sort #includes.
* mappers.cc, mappers.h: New files in Mercurial without "lo-" prefix.
* liboctave/numeric/module.mk: Add new files names to build system.
* lo-mappers.h: Old file is now shell with #warning for compilation and
#include of relevant header file.
* lo-mappers.cc: Deleted.
* make_int.cc, bsxfun.cc, cellfun.cc, colloc.cc, dasrt.cc, fft.cc, fft2.cc,
fftn.cc, gcd.cc, gl-render.cc, gl2ps-print.cc, load-save.cc, ls-hdf5.cc,
ls-mat-ascii.cc, ls-mat4.cc, ls-mat5.cc, ls-oct-binary.cc, ls-oct-text.cc,
lsode.cc, mappers.cc, max.cc, oct-hist.cc, oct-procbuf.cc, oct-stream.cc,
pr-output.cc, quad.cc, rand.cc, sqrtm.cc, sysdep.cc, url-handle-manager.h,
utils.cc, ov-base-scalar.h, ov-base.cc, ov-class.cc, ov-complex.cc,
ov-cx-mat.cc, ov-cx-sparse.cc, ov-float.cc, ov-float.h, ov-flt-complex.cc,
ov-flt-cx-mat.cc, ov-flt-re-mat.cc, ov-legacy-range.h, ov-magic-int.cc,
ov-range.h, ov-re-mat.cc, ov-re-sparse.cc, ov-scalar.cc, ov-scalar.h, lex.ll,
Array-C.cc, Array-base.cc, Array-d.cc, Array-f.cc, Array-fC.cc, CMatrix.cc,
CNDArray.cc, CSparse.cc, Range.cc, Sparse-C.cc, Sparse-d.cc, boolSparse.cc,
chNDArray.cc, dMatrix.cc, dNDArray.cc, dSparse.cc, fCMatrix.cc, fCNDArray.cc,
fMatrix.cc, fNDArray.cc, idx-vector.cc, CollocWt.cc, DET.h, lo-specfun.cc,
oct-norm.cc, oct-rand.cc, randgamma.cc, randpoisson.cc, sparse-lu.cc,
lo-utils.cc, oct-inttypes.h, oct-sort.cc, oct-string.cc: Alphabetize list of
#includes.
line wrap: on
line diff
--- a/examples/code/make_int.cc +++ b/examples/code/make_int.cc @@ -6,8 +6,8 @@ #include <ostream> #include <string> -#include <octave/lo-mappers.h> #include <octave/lo-utils.h> +#include <octave/mappers.h> #include <octave/mx-base.h> #include <octave/str-vec.h>
--- a/libinterp/corefcn/bsxfun.cc +++ b/libinterp/corefcn/bsxfun.cc @@ -31,7 +31,7 @@ #include <string> #include <vector> -#include "lo-mappers.h" +#include "mappers.h" #include "defun.h" #include "interpreter.h"
--- a/libinterp/corefcn/cellfun.cc +++ b/libinterp/corefcn/cellfun.cc @@ -27,12 +27,12 @@ # include "config.h" #endif +#include <list> +#include <memory> #include <string> #include <vector> -#include <list> -#include <memory> - -#include "lo-mappers.h" + +#include "mappers.h" #include "oct-locbuf.h" #include "oct-string.h"
--- a/libinterp/corefcn/colloc.cc +++ b/libinterp/corefcn/colloc.cc @@ -31,7 +31,7 @@ #include <string> #include "CollocWt.h" -#include "lo-mappers.h" +#include "mappers.h" #include "defun.h" #include "error.h"
--- a/libinterp/corefcn/dasrt.cc +++ b/libinterp/corefcn/dasrt.cc @@ -31,7 +31,7 @@ #include <string> #include "DASRT.h" -#include "lo-mappers.h" +#include "mappers.h" #include "defun.h" #include "error.h"
--- a/libinterp/corefcn/fft.cc +++ b/libinterp/corefcn/fft.cc @@ -27,7 +27,7 @@ # include "config.h" #endif -#include "lo-mappers.h" +#include "mappers.h" #include "defun.h" #include "error.h"
--- a/libinterp/corefcn/fft2.cc +++ b/libinterp/corefcn/fft2.cc @@ -27,7 +27,7 @@ # include "config.h" #endif -#include "lo-mappers.h" +#include "mappers.h" #include "defun.h" #include "error.h"
--- a/libinterp/corefcn/fftn.cc +++ b/libinterp/corefcn/fftn.cc @@ -27,7 +27,7 @@ # include "config.h" #endif -#include "lo-mappers.h" +#include "mappers.h" #include "defun.h" #include "error.h"
--- a/libinterp/corefcn/gcd.cc +++ b/libinterp/corefcn/gcd.cc @@ -27,11 +27,11 @@ # include "config.h" #endif +#include "CNDArray.h" #include "dNDArray.h" -#include "CNDArray.h" +#include "fCNDArray.h" #include "fNDArray.h" -#include "fCNDArray.h" -#include "lo-mappers.h" +#include "mappers.h" #include "oct-binmap.h" #include "defun.h"
--- a/libinterp/corefcn/gl-render.cc +++ b/libinterp/corefcn/gl-render.cc @@ -36,7 +36,7 @@ # include <windows.h> #endif -#include "lo-mappers.h" +#include "mappers.h" #include "oct-locbuf.h" #include "errwarn.h"
--- a/libinterp/corefcn/gl2ps-print.cc +++ b/libinterp/corefcn/gl2ps-print.cc @@ -41,9 +41,9 @@ #include "file-ops.h" #include "filepos-wrappers.h" -#include "lo-mappers.h" +#include "mappers.h" +#include "oct-env.h" #include "oct-locbuf.h" -#include "oct-env.h" #include "unistd-wrappers.h" #include "unistr-wrappers.h" #include "unwind-prot.h"
--- a/libinterp/corefcn/load-save.cc +++ b/libinterp/corefcn/load-save.cc @@ -42,8 +42,8 @@ #include "file-ops.h" #include "file-stat.h" #include "glob-match.h" -#include "lo-mappers.h" #include "mach-info.h" +#include "mappers.h" #include "oct-env.h" #include "oct-locbuf.h" #include "oct-sysdep.h"
--- a/libinterp/corefcn/ls-hdf5.cc +++ b/libinterp/corefcn/ls-hdf5.cc @@ -42,13 +42,13 @@ #include "data-conv.h" #include "file-ops.h" #include "glob-match.h" -#include "lo-mappers.h" #include "mach-info.h" +#include "mappers.h" #include "oct-env.h" +#include "oct-locbuf.h" #include "oct-time.h" #include "quit.h" #include "str-vec.h" -#include "oct-locbuf.h" #include "Cell.h" #include "defun.h"
--- a/libinterp/corefcn/ls-mat-ascii.cc +++ b/libinterp/corefcn/ls-mat-ascii.cc @@ -40,8 +40,8 @@ #include "data-conv.h" #include "file-ops.h" #include "glob-match.h" -#include "lo-mappers.h" #include "mach-info.h" +#include "mappers.h" #include "oct-env.h" #include "oct-time.h" #include "quit.h"
--- a/libinterp/corefcn/ls-mat4.cc +++ b/libinterp/corefcn/ls-mat4.cc @@ -38,8 +38,8 @@ #include "data-conv.h" #include "file-ops.h" #include "glob-match.h" -#include "lo-mappers.h" #include "mach-info.h" +#include "mappers.h" #include "oct-env.h" #include "oct-locbuf.h" #include "oct-time.h"
--- a/libinterp/corefcn/ls-mat5.cc +++ b/libinterp/corefcn/ls-mat5.cc @@ -43,8 +43,8 @@ #include "file-ops.h" #include "file-stat.h" #include "glob-match.h" -#include "lo-mappers.h" #include "mach-info.h" +#include "mappers.h" #include "oct-env.h" #include "oct-locbuf.h" #include "oct-sysdep.h"
--- a/libinterp/corefcn/ls-oct-binary.cc +++ b/libinterp/corefcn/ls-oct-binary.cc @@ -35,8 +35,8 @@ #include "data-conv.h" #include "file-ops.h" #include "glob-match.h" -#include "lo-mappers.h" #include "mach-info.h" +#include "mappers.h" #include "oct-env.h" #include "oct-locbuf.h" #include "oct-time.h"
--- a/libinterp/corefcn/ls-oct-text.cc +++ b/libinterp/corefcn/ls-oct-text.cc @@ -41,8 +41,8 @@ #include "data-conv.h" #include "file-ops.h" #include "glob-match.h" -#include "lo-mappers.h" #include "mach-info.h" +#include "mappers.h" #include "oct-env.h" #include "oct-time.h" #include "quit.h"
--- a/libinterp/corefcn/lsode.cc +++ b/libinterp/corefcn/lsode.cc @@ -31,16 +31,16 @@ #include <string> #include "LSODE.h" -#include "lo-mappers.h" +#include "mappers.h" #include "defun.h" #include "error.h" #include "errwarn.h" #include "interpreter-private.h" #include "interpreter.h" +#include "ov-cell.h" +#include "ov-fcn.h" #include "ovl.h" -#include "ov-fcn.h" -#include "ov-cell.h" #include "pager.h" #include "pr-output.h" #include "unwind-prot.h"
--- a/libinterp/corefcn/mappers.cc +++ b/libinterp/corefcn/mappers.cc @@ -30,7 +30,7 @@ #include <cctype> #include "lo-ieee.h" -#include "lo-mappers.h" +#include "mappers.h" #include "oct-specfun.h" #include "defun.h"
--- a/libinterp/corefcn/max.cc +++ b/libinterp/corefcn/max.cc @@ -30,7 +30,7 @@ #include <cmath> #include "lo-ieee.h" -#include "lo-mappers.h" +#include "mappers.h" #include "dNDArray.h" #include "CNDArray.h" #include "quit.h"
--- a/libinterp/corefcn/oct-hist.cc +++ b/libinterp/corefcn/oct-hist.cc @@ -46,7 +46,7 @@ #include "cmd-hist.h" #include "file-ops.h" -#include "lo-mappers.h" +#include "mappers.h" #include "oct-env.h" #include "oct-sysdep.h" #include "oct-time.h"
--- a/libinterp/corefcn/oct-procbuf.cc +++ b/libinterp/corefcn/oct-procbuf.cc @@ -43,8 +43,8 @@ # include <unistd.h> #endif -#include "lo-mappers.h" #include "lo-utils.h" +#include "mappers.h" #include "oct-procbuf.h" #include "oct-syscalls.h" #include "sysdep.h"
--- a/libinterp/corefcn/oct-stream.cc +++ b/libinterp/corefcn/oct-stream.cc @@ -44,8 +44,8 @@ #include "Cell.h" #include "byte-swap.h" #include "lo-ieee.h" -#include "lo-mappers.h" #include "lo-utils.h" +#include "mappers.h" #include "oct-locbuf.h" #include "octave-preserve-stream-state.h" #include "quit.h"
--- a/libinterp/corefcn/pr-output.cc +++ b/libinterp/corefcn/pr-output.cc @@ -40,8 +40,8 @@ #include "Range.h" #include "cmd-edit.h" #include "dMatrix.h" -#include "lo-mappers.h" #include "mach-info.h" +#include "mappers.h" #include "oct-cmplx.h" #include "oct-string.h" #include "quit.h"
--- a/libinterp/corefcn/quad.cc +++ b/libinterp/corefcn/quad.cc @@ -30,16 +30,16 @@ #include <string> #include "Quad.h" -#include "lo-mappers.h" +#include "mappers.h" #include "defun.h" #include "error.h" #include "errwarn.h" #include "interpreter-private.h" #include "interpreter.h" -#include "pager.h" #include "ov.h" #include "ovl.h" +#include "pager.h" #include "unwind-prot.h" #include "utils.h" #include "variables.h"
--- a/libinterp/corefcn/rand.cc +++ b/libinterp/corefcn/rand.cc @@ -31,7 +31,7 @@ #include <string> #include "f77-fcn.h" -#include "lo-mappers.h" +#include "mappers.h" #include "oct-rand.h" #include "quit.h"
--- a/libinterp/corefcn/sqrtm.cc +++ b/libinterp/corefcn/sqrtm.cc @@ -27,10 +27,10 @@ # include "config.h" #endif +#include "lo-ieee.h" +#include "mappers.h" +#include "oct-norm.h" #include "schur.h" -#include "lo-ieee.h" -#include "lo-mappers.h" -#include "oct-norm.h" #include "defun.h" #include "error.h"
--- a/libinterp/corefcn/sysdep.cc +++ b/libinterp/corefcn/sysdep.cc @@ -63,8 +63,8 @@ #include "cmd-edit.h" #include "file-ops.h" -#include "lo-mappers.h" #include "mach-info.h" +#include "mappers.h" #include "oct-env.h" #include "oct-sysinfo.h" #include "uniconv-wrappers.h"
--- a/libinterp/corefcn/url-handle-manager.h +++ b/libinterp/corefcn/url-handle-manager.h @@ -35,7 +35,7 @@ #include <map> #include <set> -#include "lo-mappers.h" +#include "mappers.h" #include "oct-handle.h" #include "url-transfer.h"
--- a/libinterp/corefcn/utils.cc +++ b/libinterp/corefcn/utils.cc @@ -38,8 +38,8 @@ #include "dir-ops.h" #include "file-ops.h" #include "file-stat.h" -#include "lo-mappers.h" #include "lo-utils.h" +#include "mappers.h" #include "nanosleep-wrapper.h" #include "oct-cmplx.h" #include "oct-env.h"
--- a/libinterp/octave-value/ov-base-scalar.h +++ b/libinterp/octave-value/ov-base-scalar.h @@ -33,10 +33,10 @@ #include <iosfwd> #include <string> -#include "lo-mappers.h" +#include "MatrixType.h" #include "lo-utils.h" +#include "mappers.h" #include "str-vec.h" -#include "MatrixType.h" #include "ov-base.h" #include "ov-typeinfo.h"
--- a/libinterp/octave-value/ov-base.cc +++ b/libinterp/octave-value/ov-base.cc @@ -32,7 +32,7 @@ #include <ostream> #include "lo-ieee.h" -#include "lo-mappers.h" +#include "mappers.h" #include "defun.h" #include "errwarn.h"
--- a/libinterp/octave-value/ov-class.cc +++ b/libinterp/octave-value/ov-class.cc @@ -33,8 +33,8 @@ #include "Array-util.h" #include "byte-swap.h" +#include "mappers.h" #include "oct-locbuf.h" -#include "lo-mappers.h" #include "Cell.h" #include "defun.h"
--- a/libinterp/octave-value/ov-complex.cc +++ b/libinterp/octave-value/ov-complex.cc @@ -32,7 +32,7 @@ #include <sstream> #include "lo-ieee.h" -#include "lo-mappers.h" +#include "mappers.h" #include "oct-specfun.h" #include "mxarray.h"
--- a/libinterp/octave-value/ov-cx-mat.cc +++ b/libinterp/octave-value/ov-cx-mat.cc @@ -37,8 +37,8 @@ #include "data-conv.h" #include "lo-ieee.h" -#include "lo-mappers.h" #include "mach-info.h" +#include "mappers.h" #include "mx-base.h" #include "oct-locbuf.h" #include "oct-specfun.h"
--- a/libinterp/octave-value/ov-cx-sparse.cc +++ b/libinterp/octave-value/ov-cx-sparse.cc @@ -31,7 +31,7 @@ #include <ostream> #include <vector> -#include "lo-mappers.h" +#include "mappers.h" #include "oct-locbuf.h" #include "oct-specfun.h"
--- a/libinterp/octave-value/ov-float.cc +++ b/libinterp/octave-value/ov-float.cc @@ -33,8 +33,8 @@ #include "oct-inttypes-fwd.h" #include "data-conv.h" -#include "lo-mappers.h" #include "mach-info.h" +#include "mappers.h" #include "oct-specfun.h" #include "defun.h"
--- a/libinterp/octave-value/ov-float.h +++ b/libinterp/octave-value/ov-float.h @@ -33,7 +33,7 @@ #include <iosfwd> #include <string> -#include "lo-mappers.h" +#include "mappers.h" #include "lo-utils.h" #include "mx-base.h" #include "str-vec.h"
--- a/libinterp/octave-value/ov-flt-complex.cc +++ b/libinterp/octave-value/ov-flt-complex.cc @@ -31,7 +31,7 @@ #include <ostream> #include "lo-ieee.h" -#include "lo-mappers.h" +#include "mappers.h" #include "oct-specfun.h" #include "mxarray.h"
--- a/libinterp/octave-value/ov-flt-cx-mat.cc +++ b/libinterp/octave-value/ov-flt-cx-mat.cc @@ -37,7 +37,7 @@ #include "data-conv.h" #include "lo-ieee.h" -#include "lo-mappers.h" +#include "mappers.h" #include "mach-info.h" #include "mx-base.h" #include "oct-locbuf.h"
--- a/libinterp/octave-value/ov-flt-re-mat.cc +++ b/libinterp/octave-value/ov-flt-re-mat.cc @@ -46,7 +46,7 @@ #include "data-conv.h" #include "lo-ieee.h" -#include "lo-mappers.h" +#include "mappers.h" #include "lo-utils.h" #include "mach-info.h" #include "mx-base.h"
--- a/libinterp/octave-value/ov-legacy-range.h +++ b/libinterp/octave-value/ov-legacy-range.h @@ -34,7 +34,7 @@ #include <memory> #include <string> -#include "lo-mappers.h" +#include "mappers.h" #include "lo-utils.h" #include "mx-base.h"
--- a/libinterp/octave-value/ov-magic-int.cc +++ b/libinterp/octave-value/ov-magic-int.cc @@ -33,7 +33,7 @@ #include "oct-inttypes-fwd.h" #include "data-conv.h" -#include "lo-mappers.h" +#include "mappers.h" #include "mach-info.h" #include "oct-specfun.h"
--- a/libinterp/octave-value/ov-range.h +++ b/libinterp/octave-value/ov-range.h @@ -37,7 +37,7 @@ #include "Array.h" #include "Range.h" -#include "lo-mappers.h" +#include "mappers.h" #include "lo-utils.h" #include "mx-base.h" #include "str-vec.h"
--- a/libinterp/octave-value/ov-re-mat.cc +++ b/libinterp/octave-value/ov-re-mat.cc @@ -35,20 +35,20 @@ #include "dNDArray.h" #include "fNDArray.h" -#include "int8NDArray.h" #include "int16NDArray.h" #include "int32NDArray.h" #include "int64NDArray.h" -#include "uint8NDArray.h" +#include "int8NDArray.h" #include "uint16NDArray.h" #include "uint32NDArray.h" #include "uint64NDArray.h" +#include "uint8NDArray.h" #include "data-conv.h" #include "lo-ieee.h" -#include "lo-mappers.h" #include "lo-utils.h" #include "mach-info.h" +#include "mappers.h" #include "mx-base.h" #include "oct-locbuf.h" #include "oct-specfun.h"
--- a/libinterp/octave-value/ov-re-sparse.cc +++ b/libinterp/octave-value/ov-re-sparse.cc @@ -32,7 +32,7 @@ #include <ostream> #include <vector> -#include "lo-mappers.h" +#include "mappers.h" #include "oct-locbuf.h" #include "oct-specfun.h"
--- a/libinterp/octave-value/ov-scalar.cc +++ b/libinterp/octave-value/ov-scalar.cc @@ -33,8 +33,8 @@ #include "oct-inttypes-fwd.h" #include "data-conv.h" -#include "lo-mappers.h" #include "mach-info.h" +#include "mappers.h" #include "oct-specfun.h" #include "defun.h"
--- a/libinterp/octave-value/ov-scalar.h +++ b/libinterp/octave-value/ov-scalar.h @@ -33,8 +33,8 @@ #include <iosfwd> #include <string> -#include "lo-mappers.h" #include "lo-utils.h" +#include "mappers.h" #include "mx-base.h" #include "str-vec.h"
--- a/libinterp/parse-tree/lex.ll +++ b/libinterp/parse-tree/lex.ll @@ -100,7 +100,7 @@ #include <stack> #include "cmd-edit.h" -#include "lo-mappers.h" +#include "mappers.h" #include "quit.h" #include "unistd-wrappers.h"
--- a/liboctave/array/Array-C.cc +++ b/liboctave/array/Array-C.cc @@ -29,8 +29,8 @@ // Instantiate Arrays of Complex values. +#include "mappers.h" #include "oct-cmplx.h" -#include "lo-mappers.h" #define OCTAVE_EXTERN_TEMPLATE_ARRAY #include "Array-oct.h"
--- a/liboctave/array/Array-base.cc +++ b/liboctave/array/Array-base.cc @@ -35,7 +35,7 @@ #include "Array-oct.h" #include "Array-util.h" -#include "lo-mappers.h" +#include "mappers.h" #include "oct-error.h" #include "oct-locbuf.h"
--- a/liboctave/array/Array-d.cc +++ b/liboctave/array/Array-d.cc @@ -29,7 +29,7 @@ // Instantiate Arrays of double values. -#include "lo-mappers.h" +#include "mappers.h" #define OCTAVE_EXTERN_TEMPLATE_ARRAY #include "Array-oct.h"
--- a/liboctave/array/Array-f.cc +++ b/liboctave/array/Array-f.cc @@ -29,7 +29,7 @@ // Instantiate Arrays of float values. -#include "lo-mappers.h" +#include "mappers.h" #define OCTAVE_EXTERN_TEMPLATE_ARRAY #include "Array-oct.h"
--- a/liboctave/array/Array-fC.cc +++ b/liboctave/array/Array-fC.cc @@ -29,8 +29,8 @@ // Instantiate Arrays of FloatComplex values. +#include "mappers.h" #include "oct-cmplx.h" -#include "lo-mappers.h" #define OCTAVE_EXTERN_TEMPLATE_ARRAY #include "Array-oct.h"
--- a/liboctave/array/CMatrix.cc +++ b/liboctave/array/CMatrix.cc @@ -49,8 +49,8 @@ #include "dRowVector.h" #include "lapack-proto.h" #include "lo-ieee.h" -#include "lo-mappers.h" #include "lo-utils.h" +#include "mappers.h" #include "mx-cm-dm.h" #include "mx-cm-s.h" #include "mx-dm-cm.h"
--- a/liboctave/array/CNDArray.cc +++ b/liboctave/array/CNDArray.cc @@ -35,7 +35,7 @@ #include "CNDArray.h" #include "f77-fcn.h" #include "lo-ieee.h" -#include "lo-mappers.h" +#include "mappers.h" #include "mx-base.h" #include "mx-cnda-s.h" #include "mx-op-defs.h"
--- a/liboctave/array/CSparse.cc +++ b/liboctave/array/CSparse.cc @@ -37,7 +37,7 @@ #include "f77-fcn.h" #include "lapack-proto.h" #include "lo-ieee.h" -#include "lo-mappers.h" +#include "mappers.h" #include "mx-cm-s.h" #include "mx-cs-m.h" #include "mx-fcm-fs.h"
--- a/liboctave/array/Range.cc +++ b/liboctave/array/Range.cc @@ -35,8 +35,8 @@ #include "Array-util.h" #include "Range.h" -#include "lo-mappers.h" #include "lo-utils.h" +#include "mappers.h" #include "oct-error.h" OCTAVE_BEGIN_NAMESPACE(octave)
--- a/liboctave/array/Sparse-C.cc +++ b/liboctave/array/Sparse-C.cc @@ -29,12 +29,12 @@ // Instantiate Sparse matrix of complex values. +#include "Array-oct.h" +#include "Sparse.cc" +#include "Sparse.h" +#include "lo-ieee.h" +#include "mappers.h" #include "oct-cmplx.h" -#include "lo-mappers.h" -#include "lo-ieee.h" -#include "Array-oct.h" -#include "Sparse.h" -#include "Sparse.cc" static double
--- a/liboctave/array/Sparse-d.cc +++ b/liboctave/array/Sparse-d.cc @@ -29,10 +29,10 @@ // Instantiate Sparse matrix of double values. -#include "lo-mappers.h" #include "Array-oct.h" +#include "Sparse.cc" #include "Sparse.h" -#include "Sparse.cc" +#include "mappers.h" template <> OCTAVE_API
--- a/liboctave/array/boolSparse.cc +++ b/liboctave/array/boolSparse.cc @@ -31,9 +31,9 @@ #include <ostream> #include <vector> +#include "lo-ieee.h" +#include "mappers.h" #include "quit.h" -#include "lo-ieee.h" -#include "lo-mappers.h" #include "boolSparse.h" #include "dSparse.h"
--- a/liboctave/array/chNDArray.cc +++ b/liboctave/array/chNDArray.cc @@ -31,9 +31,9 @@ #include "Array-util.h" #include "chNDArray.h" +#include "lo-ieee.h" +#include "mappers.h" #include "mx-base.h" -#include "lo-ieee.h" -#include "lo-mappers.h" #include "mx-op-defs.h" #include "str-vec.h"
--- a/liboctave/array/dMatrix.cc +++ b/liboctave/array/dMatrix.cc @@ -49,8 +49,8 @@ #include "dRowVector.h" #include "lapack-proto.h" #include "lo-ieee.h" -#include "lo-mappers.h" #include "lo-utils.h" +#include "mappers.h" #include "mx-dm-m.h" #include "mx-inlines.cc" #include "mx-m-dm.h"
--- a/liboctave/array/dNDArray.cc +++ b/liboctave/array/dNDArray.cc @@ -35,7 +35,7 @@ #include "dNDArray.h" #include "f77-fcn.h" #include "lo-ieee.h" -#include "lo-mappers.h" +#include "mappers.h" #include "mx-base.h" #include "mx-op-defs.h" #include "oct-error.h"
--- a/liboctave/array/dSparse.cc +++ b/liboctave/array/dSparse.cc @@ -35,7 +35,7 @@ #include "dRowVector.h" #include "lapack-proto.h" #include "lo-ieee.h" -#include "lo-mappers.h" +#include "mappers.h" #include "oct-locbuf.h" #include "quit.h"
--- a/liboctave/array/fCMatrix.cc +++ b/liboctave/array/fCMatrix.cc @@ -47,8 +47,8 @@ #include "fCRowVector.h" #include "lapack-proto.h" #include "lo-ieee.h" -#include "lo-mappers.h" #include "lo-utils.h" +#include "mappers.h" #include "mx-fcm-fdm.h" #include "mx-fcm-fs.h" #include "mx-fdm-fcm.h"
--- a/liboctave/array/fCNDArray.cc +++ b/liboctave/array/fCNDArray.cc @@ -35,10 +35,10 @@ #include "f77-fcn.h" #include "fCNDArray.h" #include "lo-ieee.h" -#include "lo-mappers.h" +#include "mappers.h" #include "mx-base.h" +#include "mx-fcnda-fs.h" #include "mx-op-defs.h" -#include "mx-fcnda-fs.h" #include "oct-fftw.h" #include "oct-locbuf.h"
--- a/liboctave/array/fMatrix.cc +++ b/liboctave/array/fMatrix.cc @@ -51,8 +51,8 @@ #include "fRowVector.h" #include "lapack-proto.h" #include "lo-ieee.h" -#include "lo-mappers.h" #include "lo-utils.h" +#include "mappers.h" #include "mx-fdm-fm.h" #include "mx-fm-fdm.h" #include "mx-inlines.cc"
--- a/liboctave/array/fNDArray.cc +++ b/liboctave/array/fNDArray.cc @@ -35,7 +35,7 @@ #include "f77-fcn.h" #include "fNDArray.h" #include "lo-ieee.h" -#include "lo-mappers.h" +#include "mappers.h" #include "mx-base.h" #include "mx-op-defs.h" #include "oct-error.h"
--- a/liboctave/array/idx-vector.cc +++ b/liboctave/array/idx-vector.cc @@ -32,13 +32,13 @@ #include <ostream> -#include "idx-vector.h" #include "Array-oct.h" #include "Array-util.h" +#include "Range.h" #include "Sparse.h" -#include "Range.h" +#include "idx-vector.h" -#include "lo-mappers.h" +#include "mappers.h" #include "oct-error.h" #include "oct-locbuf.h"
--- a/liboctave/numeric/CollocWt.cc +++ b/liboctave/numeric/CollocWt.cc @@ -34,7 +34,7 @@ #include "Array-oct.h" #include "CollocWt.h" -#include "lo-mappers.h" +#include "mappers.h" #include "oct-error.h" // The following routines jcobi, dif, and dfopr are based on the code
--- a/liboctave/numeric/DET.h +++ b/liboctave/numeric/DET.h @@ -30,7 +30,7 @@ #include <cmath> -#include "lo-mappers.h" +#include "mappers.h" #include "oct-cmplx.h" template <typename T>
--- a/liboctave/numeric/lo-mappers.h +++ b/liboctave/numeric/lo-mappers.h @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////// // -// Copyright (C) 1996-2025 The Octave Project Developers +// Copyright (C) 2025 The Octave Project Developers // // See the file COPYRIGHT.md in the top-level directory of this // distribution or <https://octave.org/copyright/>. @@ -26,443 +26,8 @@ #if ! defined (octave_lo_mappers_h) #define octave_lo_mappers_h 1 -#include "octave-config.h" +#warning 'header file "lo-mappers.h" is deprecated, use "mappers.h" instead' -#include <cmath> - -#include <limits> - -#include "lo-ieee.h" -#include "oct-cmplx.h" -#include "oct-inttypes-fwd.h" - -OCTAVE_BEGIN_NAMESPACE(octave) - -OCTAVE_BEGIN_NAMESPACE(math) - -extern OCTAVE_API bool isna (double x); -extern OCTAVE_API bool isna (float x); -extern OCTAVE_API bool isna (const Complex& x); -extern OCTAVE_API bool isna (const FloatComplex& x); - -extern OCTAVE_API bool is_NaN_or_NA (const Complex& x); -extern OCTAVE_API bool is_NaN_or_NA (const FloatComplex& x); - -inline double copysign (double x, double y) { return std::copysign (x, y); } -inline float copysign (float x, float y) { return std::copysignf (x, y); } - -inline double signbit (double x) { return std::signbit (x); } -inline float signbit (float x) { return std::signbit (x); } - -// Test for negative sign. -extern OCTAVE_API bool negative_sign (double x); -extern OCTAVE_API bool negative_sign (float x); - -// Test for positive sign. -inline bool positive_sign (double x) { return ! negative_sign (x); } -inline bool positive_sign (float x) { return ! negative_sign (x); } - -extern OCTAVE_API Complex acos (const Complex& x); -extern OCTAVE_API FloatComplex acos (const FloatComplex& x); - -extern OCTAVE_API Complex asin (const Complex& x); -extern OCTAVE_API FloatComplex asin (const FloatComplex& x); - -inline Complex atan (const Complex& x) { return std::atan (x); } -inline FloatComplex atan (const FloatComplex& x) { return std::atan (x); } - -// The C++ standard would normally return a std::complex value for conj -// even when the input is fully real. Octave overrides this. -inline double conj (double x) { return x; } -inline float conj (float x) { return x; } - -template <typename T> -std::complex<T> -conj (const std::complex<T>& x) -{ - return std::conj (x); -} - -inline double log2 (double x) { return std::log2 (x); } -inline float log2 (float x) { return std::log2f (x); } - -extern OCTAVE_API Complex log2 (const Complex& x); -extern OCTAVE_API FloatComplex log2 (const FloatComplex& x); - -extern OCTAVE_API double log2 (double x, int& exp); -extern OCTAVE_API float log2 (float x, int& exp); - -extern OCTAVE_API Complex log2 (const Complex& x, int& exp); -extern OCTAVE_API FloatComplex log2 (const FloatComplex& x, int& exp); - -inline double exp2 (double x) { return std::exp2 (x); } -inline float exp2 (float x) { return std::exp2f (x); } - -template <typename T> -std::complex<T> -ceil (const std::complex<T>& x) -{ - return std::complex<T> (std::ceil (std::real (x)), - std::ceil (std::imag (x))); -} - -template <typename T> -std::complex<T> -trunc (const std::complex<T>& x) -{ - return std::complex<T> (std::trunc (std::real (x)), - std::trunc (std::imag (x))); -} - -// Provide alias for trunc under the more familiar name of fix. -inline double fix (double x) { return std::trunc (x); } -inline float fix (float x) { return std::trunc (x); } - -template <typename T> -std::complex<T> -fix (const std::complex<T>& x) -{ - return trunc (x); -} - -template <typename T> -std::complex<T> -floor (const std::complex<T>& x) -{ - return std::complex<T> (std::floor (std::real (x)), - std::floor (std::imag (x))); -} - -inline double round (double x) { return std::round (x); } -inline float round (float x) { return std::roundf (x); } - -template <typename T> -std::complex<T> -round (const std::complex<T>& x) -{ - return std::complex<T> (round (std::real (x)), round (std::imag (x))); -} - -inline double -roundb (double x) -{ - double t = round (x); - - if (fabs (x - t) == 0.5) - t = 2 * std::trunc (0.5 * t); - - return t; -} - -inline float -roundb (float x) -{ - float t = round (x); - - if (fabsf (x - t) == 0.5f) - t = 2 * std::trunc (0.5f * t); - - return t; -} - -template <typename T> -std::complex<T> -roundb (const std::complex<T>& x) -{ - return std::complex<T> (roundb (std::real (x)), roundb (std::imag (x))); -} - -extern OCTAVE_API double frexp (double x, int *expptr); -extern OCTAVE_API float frexp (float x, int *expptr); - -inline bool isnan (bool) { return false; } -inline bool isnan (char) { return false; } - -inline bool isnan (double x) { return std::isnan (x); } -inline bool isnan (float x) { return std::isnan (x); } - -// FIXME: Do we need the isnan overload for complex? -template <typename T> -bool -isnan (const std::complex<T>& x) -{ - return (isnan (std::real (x)) || isnan (std::imag (x))); -} - -inline bool isfinite (double x) { return std::isfinite (x); } -inline bool isfinite (float x) { return std::isfinite (x); } - -// FIXME: Do we need isfinite overload for complex? -template <typename T> -bool -isfinite (const std::complex<T>& x) -{ - return (isfinite (std::real (x)) && isfinite (std::imag (x))); -} - -inline bool isinf (double x) { return std::isinf (x); } -inline bool isinf (float x) { return std::isinf (x); } - -template <typename T> -bool -isinf (const octave_int<T>&) -{ - return false; -} - -// FIXME: Do we need isinf overload for complex? -template <typename T> -bool -isinf (const std::complex<T>& x) -{ - return (isinf (std::real (x)) || isinf (std::imag (x))); -} - -// Some useful tests, that are commonly repeated. -// Test for a finite integer. - -// FIXME: Benchmark whether trunc might be faster than round here. -inline bool isinteger (double x) { return isfinite (x) && x == round (x); } -inline bool isinteger (float x) { return isfinite (x) && x == round (x); } - -inline double -signum (double x) -{ - double tmp = 0.0; - - if (x < 0.0) - tmp = -1.0; - else if (x > 0.0) - tmp = 1.0; - - return isnan (x) ? numeric_limits<double>::NaN () : tmp; -} - -inline float -signum (float x) -{ - float tmp = 0.0f; - - if (x < 0.0f) - tmp = -1.0f; - else if (x > 0.0f) - tmp = 1.0f; - - return isnan (x) ? numeric_limits<float>::NaN () : tmp; -} - -template <typename T> -std::complex<T> -signum (const std::complex<T>& x) -{ - T tmp = abs (x); - - return tmp == 0 ? 0.0 : x / tmp; -} - -// Convert X to the nearest integer value. Should not pass NaN to -// this function. - -// For integer types? Hmm. Need to be sure T is an integer type... -template <typename T> -T -x_nint (T x) -{ - return x; -} - -template <> -inline double x_nint (double x) -{ - return (isfinite (x) ? std::floor (x + 0.5) : x); -} - -template <> -inline float x_nint (float x) -{ - return (isfinite (x) ? std::floor (x + 0.5f) : x); -} - -extern OCTAVE_API octave_idx_type nint_big (double x); -extern OCTAVE_API octave_idx_type nint_big (float x); - -extern OCTAVE_API int nint (double x); -extern OCTAVE_API int nint (float x); - -template <typename T> -T -mod (T x, T y) -{ - T retval; - - if (y == 0) - retval = x; - else - { - T q = x / y; - - if (x_nint (y) != y - && (std::abs ((q - x_nint (q)) / x_nint (q)) - < std::numeric_limits<T>::epsilon ())) - retval = 0; - else - { - T n = std::floor (q); - - // Prevent use of extra precision. - T tmp = y * n; - - retval = x - tmp; - } - } - - if (x != y && y != 0) - retval = copysign (retval, y); - - return retval; -} - -template <typename T> -T -rem (T x, T y) -{ - T retval; - - if (y == 0) - retval = numeric_limits<T>::NaN (); - else - { - T q = x / y; - - if (x_nint (y) != y - && (std::abs ((q - x_nint (q)) / x_nint (q)) - < std::numeric_limits<T>::epsilon ())) - retval = 0; - else - { - T n = std::trunc (q); - - // Prevent use of extra precision. - T tmp = y * n; - - retval = x - tmp; - } - } - - if (x != y && y != 0) - retval = copysign (retval, x); - - return retval; -} - -// Generic min, max definitions -template <typename T> -T -min (T x, T y) -{ - return x <= y ? x : y; -} - -template <typename T> -T -max (T x, T y) -{ - return x >= y ? x : y; -} - -// This form is favorable. GCC will translate (x <= y ? x : y) without a -// jump, hence the only conditional jump involved will be the first -// (isnan), infrequent and hence friendly to branch prediction. - -inline double -min (double x, double y) -{ - return isnan (y) ? x : (x <= y ? x : y); -} - -inline double -max (double x, double y) -{ - return isnan (y) ? x : (x >= y ? x : y); -} - -inline float -min (float x, float y) -{ - return isnan (y) ? x : (x <= y ? x : y); -} - -inline float -max (float x, float y) -{ - return isnan (y) ? x : (x >= y ? x : y); -} - -inline std::complex<double> -min (const std::complex<double>& x, const std::complex<double>& y) -{ - return abs (x) <= abs (y) ? x : (isnan (x) ? x : y); -} - -inline std::complex<float> -min (const std::complex<float>& x, const std::complex<float>& y) -{ - return abs (x) <= abs (y) ? x : (isnan (x) ? x : y); -} - -inline std::complex<double> -max (const std::complex<double>& x, const std::complex<double>& y) -{ - return abs (x) >= abs (y) ? x : (isnan (x) ? x : y); -} - -inline std::complex<float> -max (const std::complex<float>& x, const std::complex<float>& y) -{ - return abs (x) >= abs (y) ? x : (isnan (x) ? x : y); -} - -template <typename T> -inline octave_int<T> -min (const octave_int<T>& x, const octave_int<T>& y) -{ - return xmin (x, y); -} - -template <typename T> -inline octave_int<T> -max (const octave_int<T>& x, const octave_int<T>& y) -{ - return xmax (x, y); -} - -// These map reals to Complex. - -extern OCTAVE_API Complex rc_acos (double); -extern OCTAVE_API FloatComplex rc_acos (float); - -extern OCTAVE_API Complex rc_acosh (double); -extern OCTAVE_API FloatComplex rc_acosh (float); - -extern OCTAVE_API Complex rc_asin (double); -extern OCTAVE_API FloatComplex rc_asin (float); - -extern OCTAVE_API Complex rc_atanh (double); -extern OCTAVE_API FloatComplex rc_atanh (float); - -extern OCTAVE_API Complex rc_log (double); -extern OCTAVE_API FloatComplex rc_log (float); - -extern OCTAVE_API Complex rc_log2 (double); -extern OCTAVE_API FloatComplex rc_log2 (float); - -extern OCTAVE_API Complex rc_log10 (double); -extern OCTAVE_API FloatComplex rc_log10 (float); - -extern OCTAVE_API Complex rc_sqrt (double); -extern OCTAVE_API FloatComplex rc_sqrt (float); - -OCTAVE_END_NAMESPACE(math) -OCTAVE_END_NAMESPACE(octave) +#include "mappers.h" #endif
--- a/liboctave/numeric/lo-specfun.cc +++ b/liboctave/numeric/lo-specfun.cc @@ -49,7 +49,7 @@ #include "fNDArray.h" #include "fRowVector.h" #include "lo-ieee.h" -#include "lo-mappers.h" +#include "mappers.h" #include "mx-inlines.cc" #include "oct-error.h" #include "oct-specfun.h"
rename from liboctave/numeric/lo-mappers.cc rename to liboctave/numeric/mappers.cc --- a/liboctave/numeric/lo-mappers.cc +++ b/liboctave/numeric/mappers.cc @@ -27,14 +27,14 @@ # include "config.h" #endif -#include "lo-mappers.h" +#include "mappers.h" #include "math-wrappers.h" #include "oct-specfun.h" // FIXME: We used to have this situation: // // Functions that forward to gnulib belong here so we can keep -// gnulib:: out of lo-mappers.h. +// gnulib:: out of mappers.h. // // but now we just use std:: and explicit wrappers in C++ code so maybe // some of the forwarding functions can be defined inline here.
copy from liboctave/numeric/lo-mappers.h copy to liboctave/numeric/mappers.h --- a/liboctave/numeric/lo-mappers.h +++ b/liboctave/numeric/mappers.h @@ -23,8 +23,8 @@ // //////////////////////////////////////////////////////////////////////// -#if ! defined (octave_lo_mappers_h) -#define octave_lo_mappers_h 1 +#if ! defined (octave_oct_mappers_h) +#define octave_oct_mappers_h 1 #include "octave-config.h"
--- a/liboctave/numeric/module.mk +++ b/liboctave/numeric/module.mk @@ -49,6 +49,7 @@ %reldir%/lo-slatec-proto.h \ %reldir%/lo-specfun.h \ %reldir%/lu.h \ + %reldir%/mappers.h \ %reldir%/oct-convn.h \ %reldir%/oct-fftw.h \ %reldir%/oct-norm.h \ @@ -86,9 +87,9 @@ %reldir%/fEIG.cc \ %reldir%/gepbalance.cc \ %reldir%/hess.cc \ - %reldir%/lo-mappers.cc \ %reldir%/lo-specfun.cc \ %reldir%/lu.cc \ + %reldir%/mappers.cc \ %reldir%/oct-convn.cc \ %reldir%/oct-fftw.cc \ %reldir%/oct-norm.cc \
--- a/liboctave/numeric/oct-norm.cc +++ b/liboctave/numeric/oct-norm.cc @@ -52,7 +52,7 @@ #include "fMatrix.h" #include "fRowVector.h" #include "lo-ieee.h" -#include "lo-mappers.h" +#include "mappers.h" #include "mx-cm-s.h" #include "mx-fcm-fs.h" #include "mx-fs-fcm.h"
--- a/liboctave/numeric/oct-rand.cc +++ b/liboctave/numeric/oct-rand.cc @@ -32,8 +32,8 @@ #include <limits> #include "lo-ieee.h" -#include "lo-mappers.h" #include "mach-info.h" +#include "mappers.h" #include "oct-error.h" #include "oct-locbuf.h" #include "oct-rand.h"
--- a/liboctave/numeric/randgamma.cc +++ b/liboctave/numeric/randgamma.cc @@ -87,7 +87,7 @@ #include <cmath> #include "lo-ieee.h" -#include "lo-mappers.h" +#include "mappers.h" #include "randgamma.h" #include "randmtzig.h"
--- a/liboctave/numeric/randpoisson.cc +++ b/liboctave/numeric/randpoisson.cc @@ -35,7 +35,7 @@ #include "f77-fcn.h" #include "lo-ieee.h" -#include "lo-mappers.h" +#include "mappers.h" #include "oct-error.h" #include "randmtzig.h" #include "randpoisson.h"
--- a/liboctave/numeric/sparse-lu.cc +++ b/liboctave/numeric/sparse-lu.cc @@ -30,7 +30,7 @@ #include "CSparse.h" #include "PermMatrix.h" #include "dSparse.h" -#include "lo-mappers.h" +#include "mappers.h" #include "oct-error.h" #include "oct-locbuf.h" #include "oct-sparse.h"
--- a/liboctave/util/lo-utils.cc +++ b/liboctave/util/lo-utils.cc @@ -40,8 +40,8 @@ #include "intprops-wrappers.h" #include "lo-ieee.h" -#include "lo-mappers.h" #include "lo-utils.h" +#include "mappers.h" #include "oct-error.h" #include "oct-inttypes.h"
--- a/liboctave/util/oct-inttypes.h +++ b/liboctave/util/oct-inttypes.h @@ -34,7 +34,7 @@ #include <iosfwd> #include <limits> -#include "lo-mappers.h" +#include "mappers.h" #include "oct-inttypes-fwd.h" #include "oct-traits.h"