Mercurial > octave
changeset 30898:51a3d3a69193
maint: Use "fcn" as preferred abbreviation for "function" in liboctave/.
* DAEFunc.h, DASPK.cc, DASSL.cc, LSODE.cc, ODEFunc.h, eigs-base.cc,
eigs-base.h, oct-norm.cc, mx-inlines.cc:
Replace "func", "fun" in documentation and variable names with "fcn".
author | Rik <rik@octave.org> |
---|---|
date | Tue, 05 Apr 2022 13:20:48 -0700 |
parents | 260ce8667d96 |
children | 48ef5fabe9b7 |
files | liboctave/numeric/DAEFunc.h liboctave/numeric/DASPK.cc liboctave/numeric/DASSL.cc liboctave/numeric/LSODE.cc liboctave/numeric/ODEFunc.h liboctave/numeric/eigs-base.cc liboctave/numeric/eigs-base.h liboctave/numeric/oct-norm.cc liboctave/operators/mx-inlines.cc |
diffstat | 9 files changed, 86 insertions(+), 86 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/numeric/DAEFunc.h Tue Apr 05 08:55:38 2022 -0700 +++ b/liboctave/numeric/DAEFunc.h Tue Apr 05 13:20:48 2022 -0700 @@ -48,22 +48,22 @@ double t, double cj); DAEFunc (void) - : m_fun (nullptr), m_jac (nullptr), m_reset (true) { } + : m_fcn (nullptr), m_jac (nullptr), m_reset (true) { } DAEFunc (DAERHSFunc f) - : m_fun (f), m_jac (nullptr), m_reset (true) { } + : m_fcn (f), m_jac (nullptr), m_reset (true) { } DAEFunc (DAERHSFunc f, DAEJacFunc j) - : m_fun (f), m_jac (j), m_reset (true) { } + : m_fcn (f), m_jac (j), m_reset (true) { } DAEFunc (const DAEFunc& a) - : m_fun (a.m_fun), m_jac (a.m_jac), m_reset (a.m_reset) { } + : m_fcn (a.m_fcn), m_jac (a.m_jac), m_reset (a.m_reset) { } DAEFunc& operator = (const DAEFunc& a) { if (this != &a) { - m_fun = a.m_fun; + m_fcn = a.m_fcn; m_jac = a.m_jac; m_reset = a.m_reset; } @@ -72,11 +72,11 @@ virtual ~DAEFunc (void) = default; - DAERHSFunc function (void) const { return m_fun; } + DAERHSFunc function (void) const { return m_fcn; } DAEFunc& set_function (DAERHSFunc f) { - m_fun = f; + m_fcn = f; m_reset = true; return *this; } @@ -92,7 +92,7 @@ protected: - DAERHSFunc m_fun; + DAERHSFunc m_fcn; DAEJacFunc m_jac; // This variable is TRUE when this object is constructed, and also
--- a/liboctave/numeric/DASPK.cc Tue Apr 05 08:55:38 2022 -0700 +++ b/liboctave/numeric/DASPK.cc Tue Apr 05 13:20:48 2022 -0700 @@ -61,7 +61,7 @@ daspk_jac_ptr, daspk_psol_ptr); } -static DAEFunc::DAERHSFunc user_fun; +static DAEFunc::DAERHSFunc user_fcn; static DAEFunc::DAEJacFunc user_jac; static F77_INT nn; @@ -81,7 +81,7 @@ octave_idx_type tmp_ires = ires; - tmp_delta = user_fun (tmp_state, tmp_deriv, time, tmp_ires); + tmp_delta = user_fcn (tmp_state, tmp_deriv, time, tmp_ires); ires = octave::to_f77_int (tmp_ires); @@ -172,14 +172,14 @@ // DAEFunc - user_fun = DAEFunc::function (); + user_fcn = DAEFunc::function (); user_jac = DAEFunc::jacobian_function (); - if (user_fun) + if (user_fcn) { octave_idx_type ires = 0; - ColumnVector res = (*user_fun) (m_x, m_xdot, m_t, ires); + ColumnVector res = (*user_fcn) (m_x, m_xdot, m_t, ires); if (res.numel () != m_x.numel ()) {
--- a/liboctave/numeric/DASSL.cc Tue Apr 05 08:55:38 2022 -0700 +++ b/liboctave/numeric/DASSL.cc Tue Apr 05 13:20:48 2022 -0700 @@ -55,7 +55,7 @@ dassl_jac_ptr); } -static DAEFunc::DAERHSFunc user_fun; +static DAEFunc::DAERHSFunc user_fcn; static DAEFunc::DAEJacFunc user_jac; static F77_INT nn; @@ -78,7 +78,7 @@ octave_idx_type tmp_ires = ires; - tmp_delta = user_fun (tmp_state, tmp_deriv, time, tmp_ires); + tmp_delta = user_fcn (tmp_state, tmp_deriv, time, tmp_ires); ires = octave::to_f77_int (tmp_ires); @@ -161,14 +161,14 @@ // DAEFunc - user_fun = DAEFunc::function (); + user_fcn = DAEFunc::function (); user_jac = DAEFunc::jacobian_function (); - if (user_fun) + if (user_fcn) { octave_idx_type ires = 0; - ColumnVector res = (*user_fun) (m_x, m_xdot, m_t, ires); + ColumnVector res = (*user_fcn) (m_x, m_xdot, m_t, ires); if (res.numel () != m_x.numel ()) {
--- a/liboctave/numeric/LSODE.cc Tue Apr 05 08:55:38 2022 -0700 +++ b/liboctave/numeric/LSODE.cc Tue Apr 05 13:20:48 2022 -0700 @@ -52,7 +52,7 @@ F77_INT&); } -static ODEFunc::ODERHSFunc user_fun; +static ODEFunc::ODERHSFunc user_fcn; static ODEFunc::ODEJacFunc user_jac; static ColumnVector *tmp_x; @@ -66,7 +66,7 @@ // In that case we have to create a temporary vector object // and copy. - tmp_deriv = (*user_fun) (*tmp_x, time); + tmp_deriv = (*user_fcn) (*tmp_x, time); if (tmp_deriv.isempty ()) ierr = -1; @@ -192,10 +192,10 @@ tmp_x = &m_x; - user_fun = function (); + user_fcn = function (); user_jac = jacobian_function (); - ColumnVector m_xdot = (*user_fun) (m_x, m_t); + ColumnVector m_xdot = (*user_fcn) (m_x, m_t); if (m_x.numel () != m_xdot.numel ()) {
--- a/liboctave/numeric/ODEFunc.h Tue Apr 05 08:55:38 2022 -0700 +++ b/liboctave/numeric/ODEFunc.h Tue Apr 05 13:20:48 2022 -0700 @@ -39,22 +39,22 @@ typedef Matrix (*ODEJacFunc) (const ColumnVector&, double); ODEFunc (void) - : m_fun (nullptr), m_jac (nullptr), m_reset (true) { } + : m_fcn (nullptr), m_jac (nullptr), m_reset (true) { } ODEFunc (ODERHSFunc f) - : m_fun (f), m_jac (nullptr), m_reset (true) { } + : m_fcn (f), m_jac (nullptr), m_reset (true) { } ODEFunc (ODERHSFunc f, ODEJacFunc j) - : m_fun (f), m_jac (j), m_reset (true) { } + : m_fcn (f), m_jac (j), m_reset (true) { } ODEFunc (const ODEFunc& a) - : m_fun (a.m_fun), m_jac (a.m_jac), m_reset (true) { } + : m_fcn (a.m_fcn), m_jac (a.m_jac), m_reset (true) { } ODEFunc& operator = (const ODEFunc& a) { if (this != &a) { - m_fun = a.m_fun; + m_fcn = a.m_fcn; m_jac = a.m_jac; m_reset = a.m_reset; } @@ -63,11 +63,11 @@ virtual ~ODEFunc (void) = default; - ODERHSFunc function (void) const { return m_fun; } + ODERHSFunc function (void) const { return m_fcn; } ODEFunc& set_function (ODERHSFunc f) { - m_fun = f; + m_fcn = f; m_reset = true; return *this; } @@ -83,7 +83,7 @@ protected: - ODERHSFunc m_fun; + ODERHSFunc m_fcn; ODEJacFunc m_jac; // This variable is TRUE when this object is constructed, and also
--- a/liboctave/numeric/eigs-base.cc Tue Apr 05 08:55:38 2022 -0700 +++ b/liboctave/numeric/eigs-base.cc Tue Apr 05 13:20:48 2022 -0700 @@ -1378,7 +1378,7 @@ template <typename M> octave_idx_type -EigsRealSymmetricFunc (EigsFunc fun, octave_idx_type n_arg, +EigsRealSymmetricFunc (EigsFunc fcn, octave_idx_type n_arg, const std::string& _typ, double sigma, octave_idx_type k_arg, octave_idx_type p_arg, octave_idx_type& info, Matrix& eig_vec, @@ -1592,7 +1592,7 @@ mtmp(i, 0) = workd[i + iptr(0) - 1]; mtmp = utsolve (bt, permB, mtmp); - ColumnVector y = fun (mtmp, err); + ColumnVector y = fcn (mtmp, err); if (err) return false; @@ -1615,7 +1615,7 @@ for (F77_INT i = 0; i < n; i++) x(i) = dtmp[i]; - ColumnVector y = fun (x, err); + ColumnVector y = fcn (x, err); if (err) return false; @@ -1634,7 +1634,7 @@ for (F77_INT i = 0; i < n; i++) x(i) = *ip2++; - ColumnVector y = fun (x, err); + ColumnVector y = fcn (x, err); if (err) return false; @@ -1653,7 +1653,7 @@ for (F77_INT i = 0; i < n; i++) x(i) = *ip2++; - ColumnVector y = fun (x, err); + ColumnVector y = fcn (x, err); if (err) return false; @@ -2482,7 +2482,7 @@ template <typename M> octave_idx_type -EigsRealNonSymmetricFunc (EigsFunc fun, octave_idx_type n_arg, +EigsRealNonSymmetricFunc (EigsFunc fcn, octave_idx_type n_arg, const std::string& _typ, double sigmar, octave_idx_type k_arg, octave_idx_type p_arg, octave_idx_type& info, ComplexMatrix& eig_vec, @@ -2701,7 +2701,7 @@ mtmp(i, 0) = workd[i + iptr(0) - 1]; mtmp = utsolve (bt, permB, mtmp); - ColumnVector y = fun (mtmp, err); + ColumnVector y = fcn (mtmp, err); if (err) return false; @@ -2724,7 +2724,7 @@ for (F77_INT i = 0; i < n; i++) x(i) = dtmp[i]; - ColumnVector y = fun (x, err); + ColumnVector y = fcn (x, err); if (err) return false; @@ -2743,7 +2743,7 @@ for (F77_INT i = 0; i < n; i++) x(i) = *ip2++; - ColumnVector y = fun (x, err); + ColumnVector y = fcn (x, err); if (err) return false; @@ -2762,7 +2762,7 @@ for (F77_INT i = 0; i < n; i++) x(i) = *ip2++; - ColumnVector y = fun (x, err); + ColumnVector y = fcn (x, err); if (err) return false; @@ -3550,7 +3550,7 @@ template <typename M> octave_idx_type -EigsComplexNonSymmetricFunc (EigsComplexFunc fun, octave_idx_type n_arg, +EigsComplexNonSymmetricFunc (EigsComplexFunc fcn, octave_idx_type n_arg, const std::string& _typ, Complex sigma, octave_idx_type k_arg, octave_idx_type p_arg, octave_idx_type& info, ComplexMatrix& eig_vec, @@ -3770,7 +3770,7 @@ mtmp(i, 0) = workd[i + iptr(0) - 1]; mtmp = utsolve (bt, permB, mtmp); - ComplexColumnVector y = fun (mtmp, err); + ComplexColumnVector y = fcn (mtmp, err); if (err) return false; @@ -3793,7 +3793,7 @@ for (F77_INT i = 0; i < n; i++) x(i) = ctmp[i]; - ComplexColumnVector y = fun (x, err); + ComplexColumnVector y = fcn (x, err); if (err) return false; @@ -3812,7 +3812,7 @@ for (F77_INT i = 0; i < n; i++) x(i) = *ip2++; - ComplexColumnVector y = fun (x, err); + ComplexColumnVector y = fcn (x, err); if (err) return false; @@ -3831,7 +3831,7 @@ for (F77_INT i = 0; i < n; i++) x(i) = *ip2++; - ComplexColumnVector y = fun (x, err); + ComplexColumnVector y = fcn (x, err); if (err) return false; @@ -3965,7 +3965,7 @@ template OCTAVE_API octave_idx_type EigsRealSymmetricFunc<Matrix> -(EigsFunc fun, octave_idx_type n, const std::string& _typ, double sigma, +(EigsFunc fcn, octave_idx_type n, const std::string& _typ, double sigma, octave_idx_type k, octave_idx_type p, octave_idx_type& info, Matrix& eig_vec, ColumnVector& eig_val, const Matrix& _b, ColumnVector& permB, ColumnVector& resid, std::ostream& os, double tol, @@ -3992,7 +3992,7 @@ template OCTAVE_API octave_idx_type EigsRealNonSymmetricFunc<Matrix> -(EigsFunc fun, octave_idx_type n, const std::string& _typ, double sigmar, +(EigsFunc fcn, octave_idx_type n, const std::string& _typ, double sigmar, octave_idx_type k, octave_idx_type p, octave_idx_type& info, ComplexMatrix& eig_vec, ComplexColumnVector& eig_val, const Matrix& _b, ColumnVector& permB, ColumnVector& resid, std::ostream& os, double tol, @@ -4021,7 +4021,7 @@ template OCTAVE_API octave_idx_type EigsRealSymmetricFunc<SparseMatrix> -(EigsFunc fun, octave_idx_type n, const std::string& _typ, double sigma, +(EigsFunc fcn, octave_idx_type n, const std::string& _typ, double sigma, octave_idx_type k, octave_idx_type p, octave_idx_type& info, Matrix& eig_vec, ColumnVector& eig_val, const SparseMatrix& _b, ColumnVector& permB, ColumnVector& resid, std::ostream& os, double tol, @@ -4048,7 +4048,7 @@ template OCTAVE_API octave_idx_type EigsRealNonSymmetricFunc<SparseMatrix> -(EigsFunc fun, octave_idx_type n, const std::string& _typ, double sigmar, +(EigsFunc fcn, octave_idx_type n, const std::string& _typ, double sigmar, octave_idx_type k, octave_idx_type p, octave_idx_type& info, ComplexMatrix& eig_vec, ComplexColumnVector& eig_val, const SparseMatrix& _b, ColumnVector& permB, ColumnVector& resid, @@ -4077,7 +4077,7 @@ template OCTAVE_API octave_idx_type EigsComplexNonSymmetricFunc<ComplexMatrix> -(EigsComplexFunc fun, octave_idx_type n, const std::string& _typ, Complex sigma, +(EigsComplexFunc fcn, octave_idx_type n, const std::string& _typ, Complex sigma, octave_idx_type k, octave_idx_type p, octave_idx_type& info, ComplexMatrix& eig_vec, ComplexColumnVector& eig_val, const ComplexMatrix& _b, ColumnVector& permB, ComplexColumnVector& cresid, @@ -4106,7 +4106,7 @@ template OCTAVE_API octave_idx_type EigsComplexNonSymmetricFunc<SparseComplexMatrix> -(EigsComplexFunc fun, octave_idx_type n, const std::string& _typ, Complex sigma, +(EigsComplexFunc fcn, octave_idx_type n, const std::string& _typ, Complex sigma, octave_idx_type k, octave_idx_type p, octave_idx_type& info, ComplexMatrix& eig_vec, ComplexColumnVector& eig_val, const SparseComplexMatrix& _b, ColumnVector& permB,
--- a/liboctave/numeric/eigs-base.h Tue Apr 05 08:55:38 2022 -0700 +++ b/liboctave/numeric/eigs-base.h Tue Apr 05 13:20:48 2022 -0700 @@ -64,7 +64,7 @@ template <typename M> OCTAVE_API octave_idx_type -EigsRealSymmetricFunc (EigsFunc fun, octave_idx_type n, +EigsRealSymmetricFunc (EigsFunc fcn, octave_idx_type n, const std::string& _typ, double sigma, octave_idx_type k, octave_idx_type p, octave_idx_type& info, Matrix& eig_vec, @@ -96,7 +96,7 @@ template <typename M> OCTAVE_API octave_idx_type -EigsRealNonSymmetricFunc (EigsFunc fun, octave_idx_type n, +EigsRealNonSymmetricFunc (EigsFunc fcn, octave_idx_type n, const std::string& _typ, double sigmar, octave_idx_type k, octave_idx_type p, octave_idx_type& info, ComplexMatrix& eig_vec, @@ -130,7 +130,7 @@ template <typename M> OCTAVE_API octave_idx_type -EigsComplexNonSymmetricFunc (EigsComplexFunc fun, octave_idx_type n, +EigsComplexNonSymmetricFunc (EigsComplexFunc fcn, octave_idx_type n, const std::string& _typ, Complex sigma, octave_idx_type k, octave_idx_type p, octave_idx_type& info, ComplexMatrix& eig_vec,
--- a/liboctave/numeric/oct-norm.cc Tue Apr 05 08:55:38 2022 -0700 +++ b/liboctave/numeric/oct-norm.cc Tue Apr 05 13:20:48 2022 -0700 @@ -320,28 +320,28 @@ } // now the dispatchers -#define DEFINE_DISPATCHER(FUNC_NAME, ARG_TYPE, RES_TYPE) \ +#define DEFINE_DISPATCHER(FCN_NAME, ARG_TYPE, RES_TYPE) \ template <typename T, typename R> \ - RES_TYPE FUNC_NAME (const ARG_TYPE& v, R p) \ + RES_TYPE FCN_NAME (const ARG_TYPE& v, R p) \ { \ RES_TYPE res; \ if (p == 2) \ - FUNC_NAME (v, res, norm_accumulator_2<R> ()); \ + FCN_NAME (v, res, norm_accumulator_2<R> ()); \ else if (p == 1) \ - FUNC_NAME (v, res, norm_accumulator_1<R> ()); \ + FCN_NAME (v, res, norm_accumulator_1<R> ()); \ else if (lo_ieee_isinf (p)) \ { \ if (p > 0) \ - FUNC_NAME (v, res, norm_accumulator_inf<R> ()); \ + FCN_NAME (v, res, norm_accumulator_inf<R> ()); \ else \ - FUNC_NAME (v, res, norm_accumulator_minf<R> ()); \ + FCN_NAME (v, res, norm_accumulator_minf<R> ()); \ } \ else if (p == 0) \ - FUNC_NAME (v, res, norm_accumulator_0<R> ()); \ + FCN_NAME (v, res, norm_accumulator_0<R> ()); \ else if (p > 0) \ - FUNC_NAME (v, res, norm_accumulator_p<R> (p)); \ + FCN_NAME (v, res, norm_accumulator_p<R> (p)); \ else \ - FUNC_NAME (v, res, norm_accumulator_mp<R> (p)); \ + FCN_NAME (v, res, norm_accumulator_mp<R> (p)); \ return res; \ } @@ -564,7 +564,7 @@ // and finally, here's what we've promised in the header file -#define DEFINE_XNORM_FUNCS(PREFIX, RTYPE) \ +#define DEFINE_XNORM_FCNS(PREFIX, RTYPE) \ RTYPE xnorm (const PREFIX##ColumnVector& x, RTYPE p) \ { \ return vector_norm (x, p); \ @@ -582,10 +582,10 @@ return vector_norm (x, static_cast<RTYPE> (2)); \ } - DEFINE_XNORM_FUNCS(, double) - DEFINE_XNORM_FUNCS(Complex, double) - DEFINE_XNORM_FUNCS(Float, float) - DEFINE_XNORM_FUNCS(FloatComplex, float) + DEFINE_XNORM_FCNS(, double) + DEFINE_XNORM_FCNS(Complex, double) + DEFINE_XNORM_FCNS(Float, float) + DEFINE_XNORM_FCNS(FloatComplex, float) // this is needed to avoid copying the sparse matrix for xfrobnorm template <typename T, typename R> @@ -598,7 +598,7 @@ res = acc; } -#define DEFINE_XNORM_SPARSE_FUNCS(PREFIX, RTYPE) \ +#define DEFINE_XNORM_SPARSE_FCNS(PREFIX, RTYPE) \ RTYPE xnorm (const Sparse##PREFIX##Matrix& x, RTYPE p) \ { \ return matrix_norm (x, p, PREFIX##Matrix ()); \ @@ -610,10 +610,10 @@ return res; \ } - DEFINE_XNORM_SPARSE_FUNCS(, double) - DEFINE_XNORM_SPARSE_FUNCS(Complex, double) + DEFINE_XNORM_SPARSE_FCNS(, double) + DEFINE_XNORM_SPARSE_FCNS(Complex, double) -#define DEFINE_COLROW_NORM_FUNCS(PREFIX, RPREFIX, RTYPE) \ +#define DEFINE_COLROW_NORM_FCNS(PREFIX, RPREFIX, RTYPE) \ RPREFIX##RowVector \ xcolnorms (const PREFIX##Matrix& m, RTYPE p) \ { \ @@ -625,11 +625,11 @@ return row_norms (m, p); \ } \ - DEFINE_COLROW_NORM_FUNCS(, , double) - DEFINE_COLROW_NORM_FUNCS(Complex, , double) - DEFINE_COLROW_NORM_FUNCS(Float, Float, float) - DEFINE_COLROW_NORM_FUNCS(FloatComplex, Float, float) + DEFINE_COLROW_NORM_FCNS(, , double) + DEFINE_COLROW_NORM_FCNS(Complex, , double) + DEFINE_COLROW_NORM_FCNS(Float, Float, float) + DEFINE_COLROW_NORM_FCNS(FloatComplex, Float, float) - DEFINE_COLROW_NORM_FUNCS(Sparse, , double) - DEFINE_COLROW_NORM_FUNCS(SparseComplex, , double) + DEFINE_COLROW_NORM_FCNS(Sparse, , double) + DEFINE_COLROW_NORM_FCNS(SparseComplex, , double) }
--- a/liboctave/operators/mx-inlines.cc Tue Apr 05 08:55:38 2022 -0700 +++ b/liboctave/operators/mx-inlines.cc Tue Apr 05 13:20:48 2022 -0700 @@ -441,18 +441,18 @@ // Arbitrary function appliers. // The function is a template parameter to enable inlining. -template <typename R, typename X, R fun (X x)> +template <typename R, typename X, R fcn (X x)> inline void mx_inline_map (std::size_t n, R *r, const X *x) { for (std::size_t i = 0; i < n; i++) - r[i] = fun (x[i]); + r[i] = fcn (x[i]); } -template <typename R, typename X, R fun (const X& x)> +template <typename R, typename X, R fcn (const X& x)> inline void mx_inline_map (std::size_t n, R *r, const X *x) { for (std::size_t i = 0; i < n; i++) - r[i] = fun (x[i]); + r[i] = fcn (x[i]); } // Appliers. Since these call the operation just once, we pass it as @@ -470,18 +470,18 @@ // Shortcuts for applying mx_inline_map. -template <typename R, typename X, R fun (X)> +template <typename R, typename X, R fcn (X)> inline Array<R> do_mx_unary_map (const Array<X>& x) { - return do_mx_unary_op<R, X> (x, mx_inline_map<R, X, fun>); + return do_mx_unary_op<R, X> (x, mx_inline_map<R, X, fcn>); } -template <typename R, typename X, R fun (const X&)> +template <typename R, typename X, R fcn (const X&)> inline Array<R> do_mx_unary_map (const Array<X>& x) { - return do_mx_unary_op<R, X> (x, mx_inline_map<R, X, fun>); + return do_mx_unary_op<R, X> (x, mx_inline_map<R, X, fcn>); } template <typename R>