Mercurial > hg > octave-jordi
changeset 21012:7f4c6d594e3d
Finish renaming mapper function finite to isfinite.
* mappers.cc (Fisfinite): Call isfinite() rather than finite().
* ov-base.cc (get_umap_name): Change C string representation of
enum umap_isfinite to "isfinite".
* ov-base.h (enum unary_mapper_t): Change umap_finite to umap_isfinite.
* ov-complex.cc, ov-cx-mat.cc, ov-cx-sparse.cc, ov-float.cc, ov-flt-complex.cc,
ov-flt-cx-mat.cc, ov-flt-re-mat.cc, ov-intx.h, ov-re-mat.cc, ov-re-sparse.cc,
ov-scalar.cc: Replace instances of umap_finite to umap_isfinite in macros.
* ov.h: Replace instance of umap_finite to umap_isfinite in macro.
Adjust code comments for better readability.
author | Rik <rik@octave.org> |
---|---|
date | Tue, 29 Dec 2015 11:48:45 -0800 |
parents | 91a45293b618 |
children | b9d4c3615e89 |
files | libinterp/corefcn/mappers.cc libinterp/octave-value/ov-base.cc libinterp/octave-value/ov-base.h libinterp/octave-value/ov-complex.cc libinterp/octave-value/ov-cx-mat.cc libinterp/octave-value/ov-cx-sparse.cc libinterp/octave-value/ov-float.cc libinterp/octave-value/ov-flt-complex.cc libinterp/octave-value/ov-flt-cx-mat.cc libinterp/octave-value/ov-flt-re-mat.cc libinterp/octave-value/ov-intx.h libinterp/octave-value/ov-re-mat.cc libinterp/octave-value/ov-re-sparse.cc libinterp/octave-value/ov-scalar.cc libinterp/octave-value/ov.h |
diffstat | 15 files changed, 40 insertions(+), 43 deletions(-) [+] |
line wrap: on
line diff
--- a/libinterp/corefcn/mappers.cc +++ b/libinterp/corefcn/mappers.cc @@ -917,7 +917,7 @@ if (args.length () != 1) print_usage (); - return ovl (args(0).finite ()); + return ovl (args(0).isfinite ()); } /*
--- a/libinterp/octave-value/ov-base.cc +++ b/libinterp/octave-value/ov-base.cc @@ -1201,7 +1201,7 @@ "dawson", "exp", "expm1", - "finite", + "isfinite", "fix", "floor", "gamma",
--- a/libinterp/octave-value/ov-base.h +++ b/libinterp/octave-value/ov-base.h @@ -712,7 +712,7 @@ umap_dawson, umap_exp, umap_expm1, - umap_finite, + umap_isfinite, umap_fix, umap_floor, umap_gamma,
--- a/libinterp/octave-value/ov-complex.cc +++ b/libinterp/octave-value/ov-complex.cc @@ -511,7 +511,7 @@ SCALAR_MAPPER (sqrt, std::sqrt); SCALAR_MAPPER (tan, std::tan); SCALAR_MAPPER (tanh, std::tanh); - SCALAR_MAPPER (finite, xfinite); + SCALAR_MAPPER (isfinite, xfinite); SCALAR_MAPPER (isinf, xisinf); SCALAR_MAPPER (isna, octave_is_NA); SCALAR_MAPPER (isnan, xisnan);
--- a/libinterp/octave-value/ov-cx-mat.cc +++ b/libinterp/octave-value/ov-cx-mat.cc @@ -761,7 +761,7 @@ ARRAY_METHOD_MAPPER (abs, abs); ARRAY_METHOD_MAPPER (isnan, isnan); ARRAY_METHOD_MAPPER (isinf, isinf); - ARRAY_METHOD_MAPPER (finite, isfinite); + ARRAY_METHOD_MAPPER (isfinite, isfinite); #define ARRAY_MAPPER(UMAP, TYPE, FCN) \ case umap_ ## UMAP: \
--- a/libinterp/octave-value/ov-cx-sparse.cc +++ b/libinterp/octave-value/ov-cx-sparse.cc @@ -951,7 +951,7 @@ ARRAY_MAPPER (isnan, bool, xisnan); ARRAY_MAPPER (isna, bool, octave_is_NA); ARRAY_MAPPER (isinf, bool, xisinf); - ARRAY_MAPPER (finite, bool, xfinite); + ARRAY_MAPPER (isfinite, bool, xfinite); default: // Attempt to go via dense matrix. return octave_base_sparse<SparseComplexMatrix>::map (umap);
--- a/libinterp/octave-value/ov-float.cc +++ b/libinterp/octave-value/ov-float.cc @@ -329,7 +329,7 @@ SCALAR_MAPPER (sqrt, rc_sqrt); SCALAR_MAPPER (tan, ::tanf); SCALAR_MAPPER (tanh, ::tanhf); - SCALAR_MAPPER (finite, xfinite); + SCALAR_MAPPER (isfinite, xfinite); SCALAR_MAPPER (isinf, xisinf); SCALAR_MAPPER (isna, octave_is_NA); SCALAR_MAPPER (isnan, xisnan);
--- a/libinterp/octave-value/ov-flt-complex.cc +++ b/libinterp/octave-value/ov-flt-complex.cc @@ -455,7 +455,7 @@ SCALAR_MAPPER (sqrt, std::sqrt); SCALAR_MAPPER (tan, std::tan); SCALAR_MAPPER (tanh, std::tanh); - SCALAR_MAPPER (finite, xfinite); + SCALAR_MAPPER (isfinite, xfinite); SCALAR_MAPPER (isinf, xisinf); SCALAR_MAPPER (isna, octave_is_NA); SCALAR_MAPPER (isnan, xisnan);
--- a/libinterp/octave-value/ov-flt-cx-mat.cc +++ b/libinterp/octave-value/ov-flt-cx-mat.cc @@ -712,7 +712,7 @@ ARRAY_METHOD_MAPPER (abs, abs); ARRAY_METHOD_MAPPER (isnan, isnan); ARRAY_METHOD_MAPPER (isinf, isinf); - ARRAY_METHOD_MAPPER (finite, isfinite); + ARRAY_METHOD_MAPPER (isfinite, isfinite); #define ARRAY_MAPPER(UMAP, TYPE, FCN) \ case umap_ ## UMAP: \
--- a/libinterp/octave-value/ov-flt-re-mat.cc +++ b/libinterp/octave-value/ov-flt-re-mat.cc @@ -743,7 +743,7 @@ ARRAY_METHOD_MAPPER (abs, abs); ARRAY_METHOD_MAPPER (isnan, isnan); ARRAY_METHOD_MAPPER (isinf, isinf); - ARRAY_METHOD_MAPPER (finite, isfinite); + ARRAY_METHOD_MAPPER (isfinite, isfinite); #define ARRAY_MAPPER(UMAP, TYPE, FCN) \ case umap_ ## UMAP: \
--- a/libinterp/octave-value/ov-intx.h +++ b/libinterp/octave-value/ov-intx.h @@ -354,7 +354,7 @@ case umap_isna: case umap_isinf: return boolNDArray (matrix.dims (), false); - case umap_finite: + case umap_isfinite: return boolNDArray (matrix.dims (), true); // Special cases for Matlab compatibility. @@ -660,7 +660,7 @@ case umap_isna: case umap_isinf: return false; - case umap_finite: + case umap_isfinite: return true; // Special cases for Matlab compatibility.
--- a/libinterp/octave-value/ov-re-mat.cc +++ b/libinterp/octave-value/ov-re-mat.cc @@ -866,7 +866,7 @@ ARRAY_METHOD_MAPPER (abs, abs); ARRAY_METHOD_MAPPER (isnan, isnan); ARRAY_METHOD_MAPPER (isinf, isinf); - ARRAY_METHOD_MAPPER (finite, isfinite); + ARRAY_METHOD_MAPPER (isfinite, isfinite); #define ARRAY_MAPPER(UMAP, TYPE, FCN) \ case umap_ ## UMAP: \
--- a/libinterp/octave-value/ov-re-sparse.cc +++ b/libinterp/octave-value/ov-re-sparse.cc @@ -952,7 +952,7 @@ ARRAY_MAPPER (isnan, bool, xisnan); ARRAY_MAPPER (isna, bool, octave_is_NA); ARRAY_MAPPER (isinf, bool, xisinf); - ARRAY_MAPPER (finite, bool, xfinite); + ARRAY_MAPPER (isfinite, bool, xfinite); default: // Attempt to go via dense matrix. return octave_base_sparse<SparseMatrix>::map (umap);
--- a/libinterp/octave-value/ov-scalar.cc +++ b/libinterp/octave-value/ov-scalar.cc @@ -346,7 +346,7 @@ SCALAR_MAPPER (sqrt, rc_sqrt); SCALAR_MAPPER (tan, ::tan); SCALAR_MAPPER (tanh, ::tanh); - SCALAR_MAPPER (finite, xfinite); + SCALAR_MAPPER (isfinite, xfinite); SCALAR_MAPPER (isinf, xisinf); SCALAR_MAPPER (isna, octave_is_NA); SCALAR_MAPPER (isnan, xisnan);
--- a/libinterp/octave-value/ov.h +++ b/libinterp/octave-value/ov.h @@ -182,11 +182,10 @@ octave_value (long int i); octave_value (unsigned long int i); - // FIXME: these are kluges. They turn into doubles - // internally, which will break for very large values. We just use - // them to store things like 64-bit ino_t, etc, and hope that those - // values are never actually larger than can be represented exactly - // in a double. + // FIXME: These are kluges. They turn into doubles internally, which will + // break for very large values. We just use them to store things like + // 64-bit ino_t, etc, and hope that those values are never actually larger + // than can be represented exactly in a double. #if defined (HAVE_LONG_LONG_INT) octave_value (long long int i); @@ -314,8 +313,7 @@ octave_base_value *empty_clone (void) const { return rep->empty_clone (); } - // Delete the representation of this constant if the count drops to - // zero. + // Delete the representation of this constant if the count drops to zero. ~octave_value (void) { @@ -337,7 +335,7 @@ } // This uniquifies the value if it is referenced by more than a certain - // number of shallow copies. This is useful for optimizations where we + // number of shallow copies. This is useful for optimizations where we // know a certain copy, typically within a cell array, to be obsolete. void make_unique (int obsolete_copies) { @@ -513,9 +511,8 @@ MatrixType matrix_type (const MatrixType& typ) const { return rep->matrix_type (typ); } - // Does this constant have a type? Both of these are provided since - // it is sometimes more natural to write is_undefined() instead of - // ! is_defined(). + // Does this constant have a type? Both of these are provided since it is + // sometimes more natural to write is_undefined() instead of ! is_defined(). bool is_defined (void) const { return rep->is_defined (); } @@ -997,14 +994,13 @@ float_complex_vector_value (bool frc_str_conv = false, bool frc_vec_conv = false) const; - // Extract values of specific types without any implicit type - // conversions. Throw an error if an object is the wrong type for - // the requested value extraction. + // Extract values of specific types without any implicit type conversions. + // Throw an error if an object is the wrong type for the requested value + // extraction. // - // These functions are intended to provide a simple way to extract - // values of specific types and display error messages that are more - // meaningful than the generic "error: wrong type argument 'cell'" - // message. + // These functions are intended to provide a simple way to extract values of + // specific types and display error messages that are more meaningful than + // the generic "error: wrong type argument 'cell'" message. short int xshort_value (const char *fmt, ...) const; @@ -1183,9 +1179,9 @@ void make_storable_value (void); - // Conversions. These should probably be private. If a user of this - // class wants a certain kind of constant, he should simply ask for - // it, and we should convert it if possible. + // FIXME: These should probably be private. + // Conversions. If a user of this class wants a certain kind of constant, + // he should simply ask for it, and we should convert it if possible. octave_value convert_to_str (bool pad = false, bool force = false, char type = '\'') const @@ -1351,7 +1347,7 @@ MAPPER_FORWARD (dawson) MAPPER_FORWARD (exp) MAPPER_FORWARD (expm1) - MAPPER_FORWARD (finite) + MAPPER_FORWARD (isfinite) MAPPER_FORWARD (fix) MAPPER_FORWARD (floor) MAPPER_FORWARD (gamma) @@ -1374,8 +1370,7 @@ MAPPER_FORWARD (tan) MAPPER_FORWARD (tanh) - // These functions are prefixed with X to avoid potential macro - // conflicts. + // These functions are prefixed with X to avoid potential macro conflicts. MAPPER_FORWARD (xisalnum) MAPPER_FORWARD (xisalpha) @@ -1399,14 +1394,16 @@ octave_value map (octave_base_value::unary_mapper_t umap) const { return rep->map (umap); } - // Extract the n-th element, aka val(n). Result is undefined if val is not an - // array type or n is out of range. Never error. + // Extract the n-th element, aka val(n). + // Result is undefined if val is not an array type or n is out of range. + // Never error. octave_value fast_elem_extract (octave_idx_type n) const { return rep->fast_elem_extract (n); } - // Assign the n-th element, aka val(n) = x. Returns false if val is not an - // array type, x is not a matching scalar type, or n is out of range. + // Assign the n-th element, aka val(n) = x. + // Return false if val is not an array type, x is not a matching scalar type, + // or n is out of range. // Never error. virtual bool fast_elem_insert (octave_idx_type n, const octave_value& x)