]> www.ginac.de Git - ginac.git/commitdiff
Make ample use of the contextual keyword 'override'.
authorRichard Kreckel <kreckel@ginac.de>
Thu, 26 Nov 2015 11:20:20 +0000 (12:20 +0100)
committerRichard Kreckel <kreckel@ginac.de>
Thu, 26 Nov 2015 11:20:20 +0000 (12:20 +0100)
This patch adds the C++11 contextual keyword 'override' to every overridden
virtual function declaration except where that would incur macro duplications.
Along the way, it fixes some comments about member functions 'virtuality'.

35 files changed:
check/time_antipode.cpp
check/time_uvar_gcd.cpp
doc/examples/mystring.cpp
ginac/add.h
ginac/basic.cpp
ginac/clifford.h
ginac/color.h
ginac/constant.h
ginac/container.h
ginac/ex.h
ginac/expairseq.h
ginac/factor.cpp
ginac/fail.h
ginac/fderivative.h
ginac/function.hppy
ginac/idx.h
ginac/indexed.h
ginac/inifcns_nstdsums.cpp
ginac/integral.h
ginac/matrix.h
ginac/mul.h
ginac/ncmul.h
ginac/normal.cpp
ginac/numeric.h
ginac/power.h
ginac/print.h
ginac/pseries.h
ginac/registrar.h
ginac/relational.h
ginac/structure.h
ginac/symbol.h
ginac/symmetry.h
ginac/tensor.h
ginac/wildcard.h
ginsh/ginsh_parser.ypp

index 02ebaf1b38fe991dc2b511fa8d552134a448a906..9c64fbc219ce40c11a9b0cf92c7d1ce250266c43 100644 (file)
@@ -105,9 +105,9 @@ protected:
 class Sigma : public vertex {
 public:
        Sigma(ijpair ij = ijpair(0,0)) : vertex(ij) { }
-       vertex* copy() const { return new Sigma(*this); }
-       ijpair get_increment() const { return ijpair(indices.first+indices.second+1, 0); }
-       const ex evaluate(const symbol &x, const unsigned grad) const;
+       vertex* copy() const override { return new Sigma(*this); }
+       ijpair get_increment() const override { return ijpair(indices.first+indices.second+1, 0); }
+       const ex evaluate(const symbol &x, const unsigned grad) const override;
 private:
 };
 
@@ -137,9 +137,9 @@ const ex Sigma::evaluate(const symbol &x, const unsigned grad) const
 class Sigma_flipped : public Sigma {
 public:
        Sigma_flipped(ijpair ij = ijpair(0,0)) : Sigma(ij) { }
-       vertex* copy() const { return new Sigma_flipped(*this); }
-       ijpair get_increment() const { return ijpair(0, indices.first+indices.second+1); }
-       const ex evaluate(const symbol &x, const unsigned grad) const { return Sigma::evaluate(x, grad); }
+       vertex* copy() const override { return new Sigma_flipped(*this); }
+       ijpair get_increment() const override { return ijpair(0, indices.first+indices.second+1); }
+       const ex evaluate(const symbol &x, const unsigned grad) const override { return Sigma::evaluate(x, grad); }
 private:
 };
 
@@ -150,9 +150,9 @@ private:
 class Gamma : public vertex {
 public:
        Gamma(ijpair ij = ijpair(0,0)) : vertex(ij) { }
-       vertex* copy() const { return new Gamma(*this); }
-       ijpair get_increment() const { return ijpair(indices.first+indices.second+1, 0); }
-       const ex evaluate(const symbol &x, const unsigned grad) const;
+       vertex* copy() const override { return new Gamma(*this); }
+       ijpair get_increment() const override { return ijpair(indices.first+indices.second+1, 0); }
+       const ex evaluate(const symbol &x, const unsigned grad) const override;
 private:
 };
 
@@ -184,9 +184,9 @@ const ex Gamma::evaluate(const symbol &x, const unsigned grad) const
 class Vacuum : public vertex {
 public:
        Vacuum(ijpair ij = ijpair(0,0)) : vertex(ij) { }
-       vertex* copy() const { return new Vacuum(*this); }
-       ijpair get_increment() const { return ijpair(0, indices.first+indices.second+1); }
-       const ex evaluate(const symbol &x, const unsigned grad) const;
+       vertex* copy() const override { return new Vacuum(*this); }
+       ijpair get_increment() const override { return ijpair(0, indices.first+indices.second+1); }
+       const ex evaluate(const symbol &x, const unsigned grad) const override;
 private:
 };
 
index 11fbe1ec1ce9602c6d9ba1324ac3114c7d5d76ea..405e8207fe65736f576c8f3da8ae388f2b35e087 100644 (file)
@@ -1616,7 +1616,7 @@ static const std::string r2_srep_3("\
 class sym_finder : public visitor, public symbol::visitor
 {
 protected:
-       inline void visit(const symbol& s)
+       inline void visit(const symbol& s) override
        {
                found.insert(s);
        }
index b86f18b90da571a75a646829e26e92a64547fd93..bcbf96a889c84e748bce606bae5b18f48ad1a3d5 100644 (file)
@@ -14,7 +14,7 @@ class mystring : public basic
        GINAC_DECLARE_REGISTERED_CLASS(mystring, basic)
 public:
        mystring(const string &s);
-       ex eval(int level) const;
+       ex eval(int level) const override;
 private:
        string str;
 
index db9bda9da938046dc0d7f7ccf9bd89437e1d4457..659692b9c8402c092b00a1e5c411ac8ed1bbf4bd 100644 (file)
@@ -45,37 +45,37 @@ public:
        
        // functions overriding virtual functions from base classes
 public:
-       unsigned precedence() const {return 40;}
-       bool info(unsigned inf) const;
-       bool is_polynomial(const ex & var) const;
-       int degree(const ex & s) const;
-       int ldegree(const ex & s) const;
-       ex coeff(const ex & s, int n=1) const;
-       ex eval(int level=0) const;
-       ex evalm() const;
-       ex series(const relational & r, int order, unsigned options = 0) const;
-       ex normal(exmap & repl, exmap & rev_lookup, int level=0) const;
-       numeric integer_content() const;
-       ex smod(const numeric &xi) const;
-       numeric max_coefficient() const;
-       ex conjugate() const;
-       ex real_part() const;
-       ex imag_part() const;
-       exvector get_free_indices() const;
-       ex eval_ncmul(const exvector & v) const;
+       unsigned precedence() const override {return 40;}
+       bool info(unsigned inf) const override;
+       bool is_polynomial(const ex & var) const override;
+       int degree(const ex & s) const override;
+       int ldegree(const ex & s) const override;
+       ex coeff(const ex & s, int n=1) const override;
+       ex eval(int level=0) const override;
+       ex evalm() const override;
+       ex series(const relational & r, int order, unsigned options = 0) const override;
+       ex normal(exmap & repl, exmap & rev_lookup, int level=0) const override;
+       numeric integer_content() const override;
+       ex smod(const numeric &xi) const override;
+       numeric max_coefficient() const override;
+       ex conjugate() const override;
+       ex real_part() const override;
+       ex imag_part() const override;
+       exvector get_free_indices() const override;
+       ex eval_ncmul(const exvector & v) const override;
 protected:
-       ex derivative(const symbol & s) const;
-       unsigned return_type() const;
-       return_type_t return_type_tinfo() const;
-       ex thisexpairseq(const epvector & v, const ex & oc, bool do_index_renaming = false) const;
-       ex thisexpairseq(epvector && vp, const ex & oc, bool do_index_renaming = false) const;
-       expair split_ex_to_pair(const ex & e) const;
+       ex derivative(const symbol & s) const override;
+       unsigned return_type() const override;
+       return_type_t return_type_tinfo() const override;
+       ex thisexpairseq(const epvector & v, const ex & oc, bool do_index_renaming = false) const override;
+       ex thisexpairseq(epvector && vp, const ex & oc, bool do_index_renaming = false) const override;
+       expair split_ex_to_pair(const ex & e) const override;
        expair combine_ex_with_coeff_to_pair(const ex & e,
-                                            const ex & c) const;
+                                            const ex & c) const override;
        expair combine_pair_with_coeff_to_pair(const expair & p,
-                                              const ex & c) const;
-       ex recombine_pair_to_ex(const expair & p) const;
-       ex expand(unsigned options=0) const;
+                                              const ex & c) const override;
+       ex recombine_pair_to_ex(const expair & p) const override;
+       ex expand(unsigned options=0) const override;
 
        // non-virtual functions in this class
 protected:
index 59cd08f3b230fd045056c8cdefa003b797999cca..01d369716f30870d2bf8e0eeab2441278647e97c 100644 (file)
@@ -421,7 +421,7 @@ ex basic::eval(int level) const
 struct evalf_map_function : public map_function {
        int level;
        evalf_map_function(int l) : level(l) {}
-       ex operator()(const ex & e) { return evalf(e, level); }
+       ex operator()(const ex & e) override { return evalf(e, level); }
 };
 
 /** Evaluate object numerically. */
@@ -443,7 +443,7 @@ ex basic::evalf(int level) const
 
 /** Function object to be applied by basic::evalm(). */
 struct evalm_map_function : public map_function {
-       ex operator()(const ex & e) { return evalm(e); }
+       ex operator()(const ex & e) override { return evalm(e); }
 } map_evalm;
 
 /** Evaluate sums, products and integer powers of matrices. */
@@ -457,7 +457,7 @@ ex basic::evalm() const
 
 /** Function object to be applied by basic::eval_integ(). */
 struct eval_integ_map_function : public map_function {
-       ex operator()(const ex & e) { return eval_integ(e); }
+       ex operator()(const ex & e) override { return eval_integ(e); }
 } map_eval_integ;
 
 /** Evaluate integrals, if result is known. */
@@ -703,7 +703,7 @@ ex basic::eval_ncmul(const exvector & v) const
 struct derivative_map_function : public map_function {
        const symbol &s;
        derivative_map_function(const symbol &sym) : s(sym) {}
-       ex operator()(const ex & e) { return diff(e, s); }
+       ex operator()(const ex & e) override { return diff(e, s); }
 };
 
 /** Default implementation of ex::diff(). It maps the operation on the
@@ -797,7 +797,7 @@ unsigned basic::calchash() const
 struct expand_map_function : public map_function {
        unsigned options;
        expand_map_function(unsigned o) : options(o) {}
-       ex operator()(const ex & e) { return e.expand(options); }
+       ex operator()(const ex & e) override { return e.expand(options); }
 };
 
 /** Expand expression, i.e. multiply it out and return the result as a new
index 6af79dbc42142ede07120fca1381cefa2db21650..0193fdaf59a0958c7e6612845d8e6cba8bb567de 100644 (file)
@@ -51,16 +51,16 @@ public:
 
        // functions overriding virtual functions from base classes
 public:
-       unsigned precedence() const { return 65; }
-       void archive(archive_node& n) const;
-       void read_archive(const archive_node& n, lst& sym_lst);
+       unsigned precedence() const override { return 65; }
+       void archive(archive_node& n) const override;
+       void read_archive(const archive_node& n, lst& sym_lst) override;
 protected:
-       ex eval_ncmul(const exvector & v) const;
-       bool match_same_type(const basic & other) const;
-       ex thiscontainer(const exvector & v) const;
-       ex thiscontainer(exvector && v) const;
-       unsigned return_type() const { return return_types::noncommutative; }
-       return_type_t return_type_tinfo() const;
+       ex eval_ncmul(const exvector & v) const override;
+       bool match_same_type(const basic & other) const override;
+       ex thiscontainer(const exvector & v) const override;
+       ex thiscontainer(exvector && v) const override;
+       unsigned return_type() const override { return return_types::noncommutative; }
+       return_type_t return_type_tinfo() const override;
        // non-virtual functions in this class
 public:
        unsigned char get_representation_label() const { return representation_label; }
@@ -69,10 +69,10 @@ public:
        bool same_metric(const ex & other) const;
        int get_commutator_sign() const { return commutator_sign; } //**< See the member variable commutator_sign */
 
-       inline size_t nops() const {return inherited::nops() + 1; }
-       ex op(size_t i) const;
-       ex & let_op(size_t i);
-       ex subs(const exmap & m, unsigned options = 0) const;
+       inline size_t nops() const override {return inherited::nops() + 1; }
+       ex op(size_t i) const override;
+       ex & let_op(size_t i) override;
+       ex subs(const exmap & m, unsigned options = 0) const override;
 
 protected:
        void do_print_dflt(const print_dflt & c, unsigned level) const;
@@ -106,7 +106,7 @@ class cliffordunit : public tensor
 
        // functions overriding virtual functions from base classes
 public:
-       bool contract_with(exvector::iterator self, exvector::iterator other, exvector & v) const;
+       bool contract_with(exvector::iterator self, exvector::iterator other, exvector & v) const override;
 
        // non-virtual functions in this class
 protected:
@@ -123,7 +123,7 @@ class diracgamma : public cliffordunit
 
        // functions overriding virtual functions from base classes
 public:
-       bool contract_with(exvector::iterator self, exvector::iterator other, exvector & v) const;
+       bool contract_with(exvector::iterator self, exvector::iterator other, exvector & v) const override;
 
        // non-virtual functions in this class
 protected:
@@ -140,7 +140,7 @@ class diracgamma5 : public tensor
        GINAC_DECLARE_REGISTERED_CLASS(diracgamma5, tensor)
 
        // functions overriding virtual functions from base classes
-       ex conjugate() const;
+       ex conjugate() const override;
 
        // non-virtual functions in this class
 protected:
@@ -157,7 +157,7 @@ class diracgammaL : public tensor
        GINAC_DECLARE_REGISTERED_CLASS(diracgammaL, tensor)
 
        // functions overriding virtual functions from base classes
-       ex conjugate() const;
+       ex conjugate() const override;
 
        // non-virtual functions in this class
 protected:
@@ -174,7 +174,7 @@ class diracgammaR : public tensor
        GINAC_DECLARE_REGISTERED_CLASS(diracgammaR, tensor)
 
        // functions overriding virtual functions from base classes
-       ex conjugate() const;
+       ex conjugate() const override;
 
        // non-virtual functions in this class
 protected:
index 460e7a9ddaded2be8117e3a302caeb428ea3a22f..448a81edcd7b30bfeb8aed37b0cb2f7fdba419a8 100644 (file)
@@ -48,17 +48,17 @@ public:
        // internal constructors
        color(unsigned char rl, const exvector & v);
        color(unsigned char rl, exvector && v);
-       void archive(archive_node& n) const;
-       void read_archive(const archive_node& n, lst& sym_lst);
+       void archive(archive_node& n) const override;
+       void read_archive(const archive_node& n, lst& sym_lst) override;
 
        // functions overriding virtual functions from base classes
 protected:
-       ex eval_ncmul(const exvector & v) const;
-       bool match_same_type(const basic & other) const;
-       ex thiscontainer(const exvector & v) const;
-       ex thiscontainer(exvector && v) const;
-       unsigned return_type() const { return return_types::noncommutative; }
-       return_type_t return_type_tinfo() const;
+       ex eval_ncmul(const exvector & v) const override;
+       bool match_same_type(const basic & other) const override;
+       ex thiscontainer(const exvector & v) const override;
+       ex thiscontainer(exvector && v) const override;
+       unsigned return_type() const override { return return_types::noncommutative; }
+       return_type_t return_type_tinfo() const override;
 
        // non-virtual functions in this class
 public:
@@ -90,7 +90,7 @@ class su3t : public tensor
 
        // functions overriding virtual functions from base classes
 public:
-       bool contract_with(exvector::iterator self, exvector::iterator other, exvector & v) const;
+       bool contract_with(exvector::iterator self, exvector::iterator other, exvector & v) const override;
 
        // non-virtual functions in this class
 protected:
@@ -107,12 +107,13 @@ class su3f : public tensor
 
        // functions overriding virtual functions from base classes
 public:
-       ex eval_indexed(const basic & i) const;
-       bool contract_with(exvector::iterator self, exvector::iterator other, exvector & v) const;
+       ex eval_indexed(const basic & i) const override;
+       bool contract_with(exvector::iterator self, exvector::iterator other, exvector & v) const override;
+protected:
+       unsigned return_type() const override { return return_types::commutative; }
 
        // non-virtual functions in this class
 protected:
-       unsigned return_type() const { return return_types::commutative; }
        void do_print(const print_context & c, unsigned level) const;
        void do_print_latex(const print_latex & c, unsigned level) const;
 };
@@ -125,12 +126,13 @@ class su3d : public tensor
 
        // functions overriding virtual functions from base classes
 public:
-       ex eval_indexed(const basic & i) const;
-       bool contract_with(exvector::iterator self, exvector::iterator other, exvector & v) const;
+       ex eval_indexed(const basic & i) const override;
+       bool contract_with(exvector::iterator self, exvector::iterator other, exvector & v) const override;
+protected:
+       unsigned return_type() const override { return return_types::commutative; }
 
        // non-virtual functions in this class
 protected:
-       unsigned return_type() const { return return_types::commutative; }
        void do_print(const print_context & c, unsigned level) const;
        void do_print_latex(const print_latex & c, unsigned level) const;
 };
index f75a629f27d27ee3ce3c6e36418caf308f424e75..430c87ff4476b662af3ae936fc3b87d26849cb71 100644 (file)
@@ -47,18 +47,18 @@ public:
        
        // functions overriding virtual functions from base classes
 public:
-       bool info(unsigned inf) const;
-       ex evalf(int level = 0) const;
-       bool is_polynomial(const ex & var) const;
-       ex conjugate() const;
-       ex real_part() const;
-       ex imag_part() const;
-       void archive(archive_node& n) const;
-       void read_archive(const archive_node& n, lst& syms);
+       bool info(unsigned inf) const override;
+       ex evalf(int level = 0) const override;
+       bool is_polynomial(const ex & var) const override;
+       ex conjugate() const override;
+       ex real_part() const override;
+       ex imag_part() const override;
+       void archive(archive_node& n) const override;
+       void read_archive(const archive_node& n, lst& syms) override;
 protected:
-       ex derivative(const symbol & s) const;
-       bool is_equal_same_type(const basic & other) const;
-       unsigned calchash() const;
+       ex derivative(const symbol & s) const override;
+       bool is_equal_same_type(const basic & other) const override;
+       unsigned calchash() const override;
        
        // non-virtual functions in this class
 protected:
index 5ba094349486656e1024b6b07de6ed74a6869537..dd8be1312a92621f4f2f03747539d920b41e3e21 100644 (file)
@@ -352,15 +352,15 @@ public:
 
        // functions overriding virtual functions from base classes
 public:
-       bool info(unsigned inf) const { return inherited::info(inf); }
-       unsigned precedence() const { return 10; }
-       size_t nops() const { return this->seq.size(); }
-       ex op(size_t i) const;
-       ex & let_op(size_t i);
-       ex eval(int level = 0) const;
-       ex subs(const exmap & m, unsigned options = 0) const;
+       bool info(unsigned inf) const override { return inherited::info(inf); }
+       unsigned precedence() const override { return 10; }
+       size_t nops() const override { return this->seq.size(); }
+       ex op(size_t i) const override;
+       ex & let_op(size_t i) override;
+       ex eval(int level = 0) const override;
+       ex subs(const exmap & m, unsigned options = 0) const override;
 
-       void read_archive(const archive_node &n, lst &sym_lst) 
+       void read_archive(const archive_node &n, lst &sym_lst) override
        {
                inherited::read_archive(n, sym_lst);
                setflag(get_default_flags());
@@ -377,7 +377,7 @@ public:
        }
 
        /** Archive the object. */
-       void archive(archive_node &n) const
+       void archive(archive_node &n) const override
        {
                inherited::archive(n);
                for (auto & i : this->seq) {
@@ -386,7 +386,7 @@ public:
        }
 
 protected:
-       ex conjugate() const
+       ex conjugate() const override
        {
                STLT *newcont = nullptr;
                for (const_iterator i=this->seq.begin(); i!=this->seq.end(); ++i) {
@@ -413,7 +413,7 @@ protected:
                return *this;
        }
 
-       ex real_part() const
+       ex real_part() const override
        {
                STLT cont;
                this->reserve(cont, nops());
@@ -424,7 +424,7 @@ protected:
                return thiscontainer(cont);
        }
 
-       ex imag_part() const
+       ex imag_part() const override
        {
                STLT cont;
                this->reserve(cont, nops());
@@ -435,7 +435,7 @@ protected:
                return thiscontainer(cont);
        }
 
-       bool is_equal_same_type(const basic & other) const;
+       bool is_equal_same_type(const basic & other) const override;
 
        // new virtual functions which can be overridden by derived classes
 protected:
index 0e4d3754f063890dcf078eaec1c9cff2c0977152..343fa367c8614bba081b4535639b8652b953e322 100644 (file)
@@ -836,7 +836,7 @@ protected:
        ex (*ptr)(const ex &);
 public:
        explicit pointer_to_map_function(ex x(const ex &)) : ptr(x) {}
-       ex operator()(const ex & e) { return ptr(e); }
+       ex operator()(const ex & e) override { return ptr(e); }
 };
 
 template<class T1>
@@ -846,7 +846,7 @@ protected:
        T1 arg1;
 public:
        explicit pointer_to_map_function_1arg(ex x(const ex &, T1), T1 a1) : ptr(x), arg1(a1) {}
-       ex operator()(const ex & e) { return ptr(e, arg1); }
+       ex operator()(const ex & e) override { return ptr(e, arg1); }
 };
 
 template<class T1, class T2>
@@ -857,7 +857,7 @@ protected:
        T2 arg2;
 public:
        explicit pointer_to_map_function_2args(ex x(const ex &, T1, T2), T1 a1, T2 a2) : ptr(x), arg1(a1), arg2(a2) {}
-       ex operator()(const ex & e) { return ptr(e, arg1, arg2); }
+       ex operator()(const ex & e) override { return ptr(e, arg1, arg2); }
 };
 
 template<class T1, class T2, class T3>
@@ -869,7 +869,7 @@ protected:
        T3 arg3;
 public:
        explicit pointer_to_map_function_3args(ex x(const ex &, T1, T2, T3), T1 a1, T2 a2, T3 a3) : ptr(x), arg1(a1), arg2(a2), arg3(a3) {}
-       ex operator()(const ex & e) { return ptr(e, arg1, arg2, arg3); }
+       ex operator()(const ex & e) override { return ptr(e, arg1, arg2, arg3); }
 };
 
 template<class C>
@@ -879,7 +879,7 @@ protected:
        C &c;
 public:
        explicit pointer_to_member_to_map_function(ex (C::*member)(const ex &), C &obj) : ptr(member), c(obj) {}
-       ex operator()(const ex & e) { return (c.*ptr)(e); }
+       ex operator()(const ex & e) override { return (c.*ptr)(e); }
 };
 
 template<class C, class T1>
@@ -890,7 +890,7 @@ protected:
        T1 arg1;
 public:
        explicit pointer_to_member_to_map_function_1arg(ex (C::*member)(const ex &, T1), C &obj, T1 a1) : ptr(member), c(obj), arg1(a1) {}
-       ex operator()(const ex & e) { return (c.*ptr)(e, arg1); }
+       ex operator()(const ex & e) override { return (c.*ptr)(e, arg1); }
 };
 
 template<class C, class T1, class T2>
@@ -902,7 +902,7 @@ protected:
        T2 arg2;
 public:
        explicit pointer_to_member_to_map_function_2args(ex (C::*member)(const ex&, T1, T2), C &obj, T1 a1, T2 a2) : ptr(member), c(obj), arg1(a1), arg2(a2) {}
-       ex operator()(const ex & e) { return (c.*ptr)(e, arg1, arg2); }
+       ex operator()(const ex & e) override { return (c.*ptr)(e, arg1, arg2); }
 };
 
 template<class C, class T1, class T2, class T3>
@@ -915,7 +915,7 @@ protected:
        T3 arg3;
 public:
        explicit pointer_to_member_to_map_function_3args(ex (C::*member)(const ex &, T1, T2, T3), C &obj, T1 a1, T2 a2, T3 a3) : ptr(member), c(obj), arg1(a1), arg2(a2), arg3(a3) {}
-       ex operator()(const ex & e) { return (c.*ptr)(e, arg1, arg2, arg3); }
+       ex operator()(const ex & e) override { return (c.*ptr)(e, arg1, arg2, arg3); }
 };
 
 inline ex ex::map(ex f(const ex &)) const
index 9f16572618718a1b9819d9b8b7889db928bc6096..d33ff332ef59f2a9bed880a90fa3d15b84454b1a 100644 (file)
@@ -59,25 +59,25 @@ public:
        
        // functions overriding virtual functions from base classes
 public:
-       unsigned precedence() const {return 10;}
-       bool info(unsigned inf) const;
-       size_t nops() const;
-       ex op(size_t i) const;
-       ex map(map_function & f) const;
-       ex eval(int level=0) const;
-       ex to_rational(exmap & repl) const;
-       ex to_polynomial(exmap & repl) const;
-       bool match(const ex & pattern, exmap& repl_lst) const;
-       ex subs(const exmap & m, unsigned options = 0) const;
-       ex conjugate() const;
+       unsigned precedence() const override {return 10;}
+       bool info(unsigned inf) const override;
+       size_t nops() const override;
+       ex op(size_t i) const override;
+       ex map(map_function & f) const override;
+       ex eval(int level=0) const override;
+       ex to_rational(exmap & repl) const override;
+       ex to_polynomial(exmap & repl) const override;
+       bool match(const ex & pattern, exmap& repl_lst) const override;
+       ex subs(const exmap & m, unsigned options = 0) const override;
+       ex conjugate() const override;
 
-       void archive(archive_node& n) const;
-       void read_archive(const archive_node& n, lst& syms);
+       void archive(archive_node& n) const override;
+       void read_archive(const archive_node& n, lst& syms) override;
 protected:
-       bool is_equal_same_type(const basic & other) const;
-       unsigned return_type() const;
-       unsigned calchash() const;
-       ex expand(unsigned options=0) const;
+       bool is_equal_same_type(const basic & other) const override;
+       unsigned return_type() const override;
+       unsigned calchash() const override;
+       ex expand(unsigned options=0) const override;
        
        // new virtual functions which can be overridden by derived classes
 protected:
index e9b2569b57f6f654d7e1f48819d9c2c28f09cbf1..34095e319ac474e354a740e47b62e011fc37d521 100644 (file)
@@ -1831,7 +1831,7 @@ static upvec univar_diophant(const upvec& a, const ex& x, unsigned int m, unsign
 struct make_modular_map : public map_function {
        cl_modint_ring R;
        make_modular_map(const cl_modint_ring& R_) : R(R_) { }
-       ex operator()(const ex& e)
+       ex operator()(const ex& e) override
        {
                if ( is_a<add>(e) || is_a<mul>(e) ) {
                        return e.map(*this);
@@ -2456,7 +2456,7 @@ static ex factor_multivariate(const ex& poly, const exset& syms)
  */
 struct find_symbols_map : public map_function {
        exset syms;
-       ex operator()(const ex& e)
+       ex operator()(const ex& e) override
        {
                if ( is_a<symbol>(e) ) {
                        syms.insert(e);
@@ -2504,7 +2504,7 @@ static ex factor_sqrfree(const ex& poly)
 struct apply_factor_map : public map_function {
        unsigned options;
        apply_factor_map(unsigned options_) : options(options_) { }
-       ex operator()(const ex& e)
+       ex operator()(const ex& e) override
        {
                if ( e.info(info_flags::polynomial) ) {
                        return factor(e, options);
index 882f7406933b3c1b92688f72f71e8be4c93f8ca6..cda726f7e4100367e5bb9a8ff0cc6de32217db63 100644 (file)
@@ -35,7 +35,7 @@ class fail : public basic
        
        // functions overriding virtual functions from base classes
 protected:
-       unsigned return_type() const { return return_types::noncommutative_composite; };
+       unsigned return_type() const override { return return_types::noncommutative_composite; };
 
        // non-virtual functions in this class
 protected:
index 09d8644bc94613707e9129f6bcfabcdcba3cfe7c..a646eacfcb8d8b3753ac919ca66456c5cea22be2 100644 (file)
@@ -59,18 +59,18 @@ public:
 
        // functions overriding virtual functions from base classes
 public:
-       void print(const print_context & c, unsigned level = 0) const;
-       ex eval(int level = 0) const;
-       ex evalf(int level = 0) const;
-       ex series(const relational & r, int order, unsigned options = 0) const;
-       ex thiscontainer(const exvector & v) const;
-       ex thiscontainer(exvector && v) const;
-       void archive(archive_node& n) const;
-       void read_archive(const archive_node& n, lst& syms);
+       void print(const print_context & c, unsigned level = 0) const override;
+       ex eval(int level = 0) const override;
+       ex evalf(int level = 0) const override;
+       ex series(const relational & r, int order, unsigned options = 0) const override;
+       ex thiscontainer(const exvector & v) const override;
+       ex thiscontainer(exvector && v) const override;
+       void archive(archive_node& n) const override;
+       void read_archive(const archive_node& n, lst& syms) override;
 protected:
-       ex derivative(const symbol & s) const;
-       bool is_equal_same_type(const basic & other) const;
-       bool match_same_type(const basic & other) const;
+       ex derivative(const symbol & s) const override;
+       bool is_equal_same_type(const basic & other) const override;
+       bool match_same_type(const basic & other) const override;
 
        // non-virtual functions in this class
 protected:
index 03def530b367831683493d6ced3b592501aa6057..b54f41f3f4af2f8b56862b9faae172296ac26ac7 100644 (file)
@@ -225,28 +225,28 @@ public:
        
        // functions overriding virtual functions from base classes
 public:
-       void print(const print_context & c, unsigned level = 0) const;
-       unsigned precedence() const {return 70;}
-       ex expand(unsigned options=0) const;
-       ex eval(int level=0) const;
-       ex evalf(int level=0) const;
-       ex eval_ncmul(const exvector & v) const;
-       unsigned calchash() const;
-       ex series(const relational & r, int order, unsigned options = 0) const;
-       ex thiscontainer(const exvector & v) const;
-       ex thiscontainer(exvector && v) const;
-       ex conjugate() const;
-       ex real_part() const;
-       ex imag_part() const;
-       void archive(archive_node& n) const;
-       void read_archive(const archive_node& n, lst& syms);
-       bool info(unsigned inf) const;
+       void print(const print_context & c, unsigned level = 0) const override;
+       unsigned precedence() const override {return 70;}
+       ex expand(unsigned options=0) const override;
+       ex eval(int level=0) const override;
+       ex evalf(int level=0) const override;
+       ex eval_ncmul(const exvector & v) const override;
+       unsigned calchash() const override;
+       ex series(const relational & r, int order, unsigned options = 0) const override;
+       ex thiscontainer(const exvector & v) const override;
+       ex thiscontainer(exvector && v) const override;
+       ex conjugate() const override;
+       ex real_part() const override;
+       ex imag_part() const override;
+       void archive(archive_node& n) const override;
+       void read_archive(const archive_node& n, lst& syms) override;
+       bool info(unsigned inf) const override;
 protected:
-       ex derivative(const symbol & s) const;
-       bool is_equal_same_type(const basic & other) const;
-       bool match_same_type(const basic & other) const;
-       unsigned return_type() const;
-       return_type_t return_type_tinfo() const;
+       ex derivative(const symbol & s) const override;
+       bool is_equal_same_type(const basic & other) const override;
+       bool match_same_type(const basic & other) const override;
+       unsigned return_type() const override;
+       return_type_t return_type_tinfo() const override;
        
        // new virtual functions which can be overridden by derived classes
        // none
index 57988250c0a2943cde02804b142217aa626cbd06..1e0ad9c78033813caa25761c380c14b583557abf 100644 (file)
@@ -47,18 +47,18 @@ public:
 
        // functions overriding virtual functions from base classes
 public:
-       bool info(unsigned inf) const;
-       size_t nops() const;
-       ex op(size_t i) const;
-       ex map(map_function & f) const;
-       ex evalf(int level = 0) const;
-       ex subs(const exmap & m, unsigned options = 0) const;
-       void archive(archive_node& n) const;
-       void read_archive(const archive_node& n, lst& syms);
+       bool info(unsigned inf) const override;
+       size_t nops() const override;
+       ex op(size_t i) const override;
+       ex map(map_function & f) const override;
+       ex evalf(int level = 0) const override;
+       ex subs(const exmap & m, unsigned options = 0) const override;
+       void archive(archive_node& n) const override;
+       void read_archive(const archive_node& n, lst& syms) override;
 protected:
-       ex derivative(const symbol & s) const;
-       bool match_same_type(const basic & other) const;
-       unsigned calchash() const;
+       ex derivative(const symbol & s) const override;
+       bool match_same_type(const basic & other) const override;
+       unsigned calchash() const override;
 
        // new virtual functions in this class
 public:
@@ -125,11 +125,11 @@ public:
 
        // functions overriding virtual functions from base classes
 public:
-       bool is_dummy_pair_same_type(const basic & other) const;
-       void archive(archive_node& n) const;
-       void read_archive(const archive_node& n, lst& syms);
+       bool is_dummy_pair_same_type(const basic & other) const override;
+       void archive(archive_node& n) const override;
+       void read_archive(const archive_node& n, lst& syms) override;
 protected:
-       bool match_same_type(const basic & other) const;
+       bool match_same_type(const basic & other) const override;
 
        // non-virtual functions in this class
 public:
@@ -175,13 +175,13 @@ public:
 
        // functions overriding virtual functions from base classes
 public:
-       bool is_dummy_pair_same_type(const basic & other) const;
+       bool is_dummy_pair_same_type(const basic & other) const override;
        // complex conjugation
-       ex conjugate() const { return toggle_dot(); }
-       void archive(archive_node& n) const;
-       void read_archive(const archive_node& n, lst& syms);
+       ex conjugate() const override { return toggle_dot(); }
+       void archive(archive_node& n) const override;
+       void read_archive(const archive_node& n, lst& syms) override;
 protected:
-       bool match_same_type(const basic & other) const;
+       bool match_same_type(const basic & other) const override;
 
        // non-virtual functions in this class
 public:
index 2c4f551106c7cf66d1e62eb9d70c883afb169f6a..a04b74256dec063174d0988b0b21ac8ab61e5f8f 100644 (file)
@@ -143,24 +143,24 @@ public:
 
        // functions overriding virtual functions from base classes
 public:
-       unsigned precedence() const {return 55;}
-       bool info(unsigned inf) const;
-       ex eval(int level = 0) const;
-       ex real_part() const;
-       ex imag_part() const;
-       exvector get_free_indices() const;
+       unsigned precedence() const override {return 55;}
+       bool info(unsigned inf) const override;
+       ex eval(int level = 0) const override;
+       ex real_part() const override;
+       ex imag_part() const override;
+       exvector get_free_indices() const override;
 
        /** Save (a.k.a. serialize) indexed object into archive. */
-       void archive(archive_node& n) const;
+       void archive(archive_node& n) const override;
        /** Read (a.k.a. deserialize) indexed object from archive. */
-       void read_archive(const archive_node& n, lst& syms);
+       void read_archive(const archive_node& n, lst& syms) override;
 protected:
-       ex derivative(const symbol & s) const;
-       ex thiscontainer(const exvector & v) const;
-       ex thiscontainer(exvector && v) const;
-       unsigned return_type() const;
-       return_type_t return_type_tinfo() const { return op(0).return_type_tinfo(); }
-       ex expand(unsigned options = 0) const;
+       ex derivative(const symbol & s) const override;
+       ex thiscontainer(const exvector & v) const override;
+       ex thiscontainer(exvector && v) const override;
+       unsigned return_type() const override;
+       return_type_t return_type_tinfo() const override { return op(0).return_type_tinfo(); }
+       ex expand(unsigned options = 0) const override;
 
        // new virtual functions which can be overridden by derived classes
        // none
index 54d12c9b511060c2b53b6d28ca332200dd56c0ca..7fbc774a5ef903fb4c79bc51e1336a8995d13ee5 100644 (file)
@@ -2360,7 +2360,7 @@ bool convert_parameter_H_to_Li(const lst& l, lst& m, lst& s, ex& pf)
 // recursivly transforms H to corresponding multiple polylogarithms
 struct map_trafo_H_convert_to_Li : public map_function
 {
-       ex operator()(const ex& e)
+       ex operator()(const ex& e) override
        {
                if (is_a<add>(e) || is_a<mul>(e)) {
                        return e.map(*this);
@@ -2399,7 +2399,7 @@ struct map_trafo_H_convert_to_Li : public map_function
 // recursivly transforms H to corresponding zetas
 struct map_trafo_H_convert_to_zeta : public map_function
 {
-       ex operator()(const ex& e)
+       ex operator()(const ex& e) override
        {
                if (is_a<add>(e) || is_a<mul>(e)) {
                        return e.map(*this);
@@ -2432,7 +2432,7 @@ struct map_trafo_H_convert_to_zeta : public map_function
 // remove trailing zeros from H-parameters
 struct map_trafo_H_reduce_trailing_zeros : public map_function
 {
-       ex operator()(const ex& e)
+       ex operator()(const ex& e) override
        {
                if (is_a<add>(e) || is_a<mul>(e)) {
                        return e.map(*this);
@@ -2578,7 +2578,7 @@ ex trafo_H_mult(const ex& h1, const ex& h2)
 // applies trafo_H_mult recursively on expressions
 struct map_trafo_H_mult : public map_function
 {
-       ex operator()(const ex& e)
+       ex operator()(const ex& e) override
        {
                if (is_a<add>(e)) {
                        return e.map(*this);
@@ -2800,7 +2800,7 @@ ex trafo_H_1mxt1px_prepend_one(const ex& e, const ex& arg)
 // do x -> 1-x transformation
 struct map_trafo_H_1mx : public map_function
 {
-       ex operator()(const ex& e)
+       ex operator()(const ex& e) override
        {
                if (is_a<add>(e) || is_a<mul>(e)) {
                        return e.map(*this);
@@ -2901,7 +2901,7 @@ struct map_trafo_H_1mx : public map_function
 // do x -> 1/x transformation
 struct map_trafo_H_1overx : public map_function
 {
-       ex operator()(const ex& e)
+       ex operator()(const ex& e) override
        {
                if (is_a<add>(e) || is_a<mul>(e)) {
                        return e.map(*this);
@@ -3022,7 +3022,7 @@ struct map_trafo_H_1overx : public map_function
 // do x -> (1-x)/(1+x) transformation
 struct map_trafo_H_1mxt1px : public map_function
 {
-       ex operator()(const ex& e)
+       ex operator()(const ex& e) override
        {
                if (is_a<add>(e) || is_a<mul>(e)) {
                        return e.map(*this);
index 2c57222c32b0e304d215640083dd7c227222f28d..f76ac7fc35b893f2429e9bee57cf7e712d975f6a 100644 (file)
@@ -40,28 +40,28 @@ public:
        
        // functions overriding virtual functions from base classes
 public:
-       unsigned precedence() const {return 45;}
-       ex eval(int level=0) const;
-       ex evalf(int level=0) const;
-       int degree(const ex & s) const;
-       int ldegree(const ex & s) const;
-       ex eval_ncmul(const exvector & v) const;
-       size_t nops() const;
-       ex op(size_t i) const;
-       ex & let_op(size_t i);
-       ex expand(unsigned options = 0) const;
-       exvector get_free_indices() const;
-       unsigned return_type() const;
-       return_type_t return_type_tinfo() const;
-       ex conjugate() const;
-       ex eval_integ() const;
+       unsigned precedence() const override {return 45;}
+       ex eval(int level=0) const override;
+       ex evalf(int level=0) const override;
+       int degree(const ex & s) const override;
+       int ldegree(const ex & s) const override;
+       ex eval_ncmul(const exvector & v) const override;
+       size_t nops() const override;
+       ex op(size_t i) const override;
+       ex & let_op(size_t i) override;
+       ex expand(unsigned options = 0) const override;
+       exvector get_free_indices() const override;
+       unsigned return_type() const override;
+       return_type_t return_type_tinfo() const override;
+       ex conjugate() const override;
+       ex eval_integ() const override;
        /** Save (a.k.a. serialize) object into archive. */
-       void archive(archive_node& n) const;
+       void archive(archive_node& n) const override;
        /** Read (a.k.a. deserialize) object from archive. */
-       void read_archive(const archive_node& n, lst& syms);
+       void read_archive(const archive_node& n, lst& syms) override;
 protected:
-       ex derivative(const symbol & s) const;
-       ex series(const relational & r, int order, unsigned options = 0) const;
+       ex derivative(const symbol & s) const override;
+       ex series(const relational & r, int order, unsigned options = 0) const override;
 
        // new virtual functions which can be overridden by derived classes
        // none
index 725ea2bb99b0e26a6fe61b6e5865ed823ca1df34..6081e900257131db359b0f40fc89e0b9a9e6b19e 100644 (file)
@@ -113,27 +113,27 @@ protected:
        matrix(unsigned r, unsigned c, exvector && m2);
        // functions overriding virtual functions from base classes
 public:
-       size_t nops() const;
-       ex op(size_t i) const;
-       ex & let_op(size_t i);
-       ex eval(int level=0) const;
-       ex evalm() const {return *this;}
-       ex subs(const exmap & m, unsigned options = 0) const;
-       ex eval_indexed(const basic & i) const;
-       ex add_indexed(const ex & self, const ex & other) const;
-       ex scalar_mul_indexed(const ex & self, const numeric & other) const;
-       bool contract_with(exvector::iterator self, exvector::iterator other, exvector & v) const;
-       ex conjugate() const;
-       ex real_part() const;
-       ex imag_part() const;
+       size_t nops() const override;
+       ex op(size_t i) const override;
+       ex & let_op(size_t i) override;
+       ex eval(int level=0) const override;
+       ex evalm() const override {return *this;}
+       ex subs(const exmap & m, unsigned options = 0) const override;
+       ex eval_indexed(const basic & i) const override;
+       ex add_indexed(const ex & self, const ex & other) const override;
+       ex scalar_mul_indexed(const ex & self, const numeric & other) const override;
+       bool contract_with(exvector::iterator self, exvector::iterator other, exvector & v) const override;
+       ex conjugate() const override;
+       ex real_part() const override;
+       ex imag_part() const override;
 
        /** Save (a.k.a. serialize) object into archive. */
-       void archive(archive_node& n) const;
+       void archive(archive_node& n) const override;
        /** Read (a.k.a. deserialize) object from archive. */
-       void read_archive(const archive_node& n, lst& syms);
+       void read_archive(const archive_node& n, lst& syms) override;
 protected:
-       bool match_same_type(const basic & other) const;
-       unsigned return_type() const { return return_types::noncommutative; };
+       bool match_same_type(const basic & other) const override;
+       unsigned return_type() const override { return return_types::noncommutative; };
        
        // non-virtual functions in this class
 public:
index fb3dd9cad1d4fe065eacfa107660fd1c834bd707..95eba3dc1bf9b8d7b1c2f17c3c9f48d18262ef8f 100644 (file)
@@ -47,43 +47,42 @@ public:
        
        // functions overriding virtual functions from base classes
 public:
-       unsigned precedence() const {return 50;}
-       bool info(unsigned inf) const;
-       bool is_polynomial(const ex & var) const;
-       int degree(const ex & s) const;
-       int ldegree(const ex & s) const;
-       ex coeff(const ex & s, int n = 1) const;
-       bool has(const ex & other, unsigned options = 0) const;
-       ex eval(int level=0) const;
-       ex evalf(int level=0) const;
-       ex real_part() const;
-       ex imag_part() const;
-       ex evalm() const;
-       ex series(const relational & s, int order, unsigned options = 0) const;
-       ex normal(exmap & repl, exmap & rev_lookup, int level = 0) const;
-       numeric integer_content() const;
-       ex smod(const numeric &xi) const;
-       numeric max_coefficient() const;
-       exvector get_free_indices() const;
-       ex conjugate() const;
+       unsigned precedence() const override {return 50;}
+       bool info(unsigned inf) const override;
+       bool is_polynomial(const ex & var) const override;
+       int degree(const ex & s) const override;
+       int ldegree(const ex & s) const override;
+       ex coeff(const ex & s, int n = 1) const override;
+       bool has(const ex & other, unsigned options = 0) const override;
+       ex eval(int level=0) const override;
+       ex evalf(int level=0) const override;
+       ex real_part() const override;
+       ex imag_part() const override;
+       ex evalm() const override;
+       ex series(const relational & s, int order, unsigned options = 0) const override;
+       ex normal(exmap & repl, exmap & rev_lookup, int level = 0) const override;
+       numeric integer_content() const override;
+       ex smod(const numeric &xi) const override;
+       numeric max_coefficient() const override;
+       exvector get_free_indices() const override;
+       ex conjugate() const override;
 protected:
-       ex derivative(const symbol & s) const;
-       ex eval_ncmul(const exvector & v) const;
-       unsigned return_type() const;
-       return_type_t return_type_tinfo() const;
-       ex thisexpairseq(const epvector & v, const ex & oc, bool do_index_renaming = false) const;
-       ex thisexpairseq(epvector && vp, const ex & oc, bool do_index_renaming = false) const;
-       expair split_ex_to_pair(const ex & e) const;
-       expair combine_ex_with_coeff_to_pair(const ex & e, const ex & c) const;
-       expair combine_pair_with_coeff_to_pair(const expair & p, const ex & c) const;
-       ex recombine_pair_to_ex(const expair & p) const;
-       bool expair_needs_further_processing(epp it);
-       ex default_overall_coeff() const;
-       void combine_overall_coeff(const ex & c);
-       void combine_overall_coeff(const ex & c1, const ex & c2);
-       bool can_make_flat(const expair & p) const;
-       ex expand(unsigned options=0) const;
-       void find_real_imag(ex&, ex&) const;
+       ex derivative(const symbol & s) const override;
+       ex eval_ncmul(const exvector & v) const override;
+       unsigned return_type() const override;
+       return_type_t return_type_tinfo() const override;
+       ex thisexpairseq(const epvector & v, const ex & oc, bool do_index_renaming = false) const override;
+       ex thisexpairseq(epvector && vp, const ex & oc, bool do_index_renaming = false) const override;
+       expair split_ex_to_pair(const ex & e) const override;
+       expair combine_ex_with_coeff_to_pair(const ex & e, const ex & c) const override;
+       expair combine_pair_with_coeff_to_pair(const expair & p, const ex & c) const override;
+       ex recombine_pair_to_ex(const expair & p) const override;
+       bool expair_needs_further_processing(epp it) override;
+       ex default_overall_coeff() const override;
+       void combine_overall_coeff(const ex & c) override;
+       void combine_overall_coeff(const ex & c1, const ex & c2) override;
+       bool can_make_flat(const expair & p) const override;
+       ex expand(unsigned options=0) const override;
        
        // new virtual functions which can be overridden by derived classes
        // none
@@ -92,6 +91,7 @@ protected:
 public:
        ex algebraic_subs_mul(const exmap & m, unsigned options) const;
 protected:
+       void find_real_imag(ex&, ex&) const;
        void print_overall_coeff(const print_context & c, const char *mul_sym) const;
        void do_print(const print_context & c, unsigned level) const;
        void do_print_latex(const print_latex & c, unsigned level) const;
index 92bdbe88c0de943a6c28e62657af750c53eb515c..2233b8d7b3905aa1d998f3a365c1192bb2d9f30d 100644 (file)
@@ -54,25 +54,25 @@ public:
 
        // functions overriding virtual functions from base classes
 public:
-       unsigned precedence() const {return 50;}
-       bool info(unsigned inf) const;
-       int degree(const ex & s) const;
-       int ldegree(const ex & s) const;
-       ex expand(unsigned options=0) const;
-       ex coeff(const ex & s, int n=1) const;
-       ex eval(int level=0) const;
-       ex evalm() const;
-       exvector get_free_indices() const;
-       ex thiscontainer(const exvector & v) const;
-       ex thiscontainer(exvector && v) const;
-       ex conjugate() const;
-       ex real_part() const;
-       ex imag_part() const;
+       unsigned precedence() const override {return 50;}
+       bool info(unsigned inf) const override;
+       int degree(const ex & s) const override;
+       int ldegree(const ex & s) const override;
+       ex expand(unsigned options=0) const override;
+       ex coeff(const ex & s, int n=1) const override;
+       ex eval(int level=0) const override;
+       ex evalm() const override;
+       exvector get_free_indices() const override;
+       ex thiscontainer(const exvector & v) const override;
+       ex thiscontainer(exvector && v) const override;
+       ex conjugate() const override;
+       ex real_part() const override;
+       ex imag_part() const override;
 
 protected:
-       ex derivative(const symbol & s) const;
-       unsigned return_type() const;
-       return_type_t return_type_tinfo() const;
+       ex derivative(const symbol & s) const override;
+       unsigned return_type() const override;
+       return_type_t return_type_tinfo() const override;
        
        // new virtual functions which can be overridden by derived classes
        // none
index e30afda6b941b90b4f1ee97aa59595d2e4bb9c0a..bcb2a398bd8d57b8b8a983c2350963270e3ef3f5 100644 (file)
@@ -2026,7 +2026,7 @@ static ex replace_with_symbol(const ex & e, exmap & repl)
 struct normal_map_function : public map_function {
        int level;
        normal_map_function(int l) : level(l) {}
-       ex operator()(const ex & e) { return normal(e, level); }
+       ex operator()(const ex & e) override { return normal(e, level); }
 };
 
 /** Default implementation of ex::normal(). It normalizes the children and
index aa17d8010d8ac119e7877dc8e066e3c430d469ff..4d3135d51ccd1eb355b06e0e39aa8570c4d58384 100644 (file)
@@ -96,35 +96,35 @@ public:
        
        // functions overriding virtual functions from base classes
 public:
-       unsigned precedence() const {return 30;}
-       bool info(unsigned inf) const;
-       bool is_polynomial(const ex & var) const;
-       int degree(const ex & s) const;
-       int ldegree(const ex & s) const;
-       ex coeff(const ex & s, int n = 1) const;
-       bool has(const ex &other, unsigned options = 0) const;
-       ex eval(int level = 0) const;
-       ex evalf(int level = 0) const;
-       ex subs(const exmap & m, unsigned options = 0) const { return subs_one_level(m, options); } // overwrites basic::subs() for performance reasons
-       ex normal(exmap & repl, exmap & rev_lookup, int level = 0) const;
-       ex to_rational(exmap & repl) const;
-       ex to_polynomial(exmap & repl) const;
-       numeric integer_content() const;
-       ex smod(const numeric &xi) const;
-       numeric max_coefficient() const;
-       ex conjugate() const;
-       ex real_part() const;
-       ex imag_part() const;
+       unsigned precedence() const override {return 30;}
+       bool info(unsigned inf) const override;
+       bool is_polynomial(const ex & var) const override;
+       int degree(const ex & s) const override;
+       int ldegree(const ex & s) const override;
+       ex coeff(const ex & s, int n = 1) const override;
+       bool has(const ex &other, unsigned options = 0) const override;
+       ex eval(int level = 0) const override;
+       ex evalf(int level = 0) const override;
+       ex subs(const exmap & m, unsigned options = 0) const override { return subs_one_level(m, options); } // overwrites basic::subs() for performance reasons
+       ex normal(exmap & repl, exmap & rev_lookup, int level = 0) const override;
+       ex to_rational(exmap & repl) const override;
+       ex to_polynomial(exmap & repl) const override;
+       numeric integer_content() const override;
+       ex smod(const numeric &xi) const override;
+       numeric max_coefficient() const override;
+       ex conjugate() const override;
+       ex real_part() const override;
+       ex imag_part() const override;
        /** Save (a.k.a. serialize) object into archive. */
-       void archive(archive_node& n) const;
+       void archive(archive_node& n) const override;
        /** Read (a.k.a. deserialize) object from archive. */
-       void read_archive(const archive_node& n, lst& syms);
+       void read_archive(const archive_node& n, lst& syms) override;
 protected:
        /** Implementation of ex::diff for a numeric always returns 0.
         *  @see ex::diff */
-       ex derivative(const symbol &s) const { return 0; }
-       bool is_equal_same_type(const basic &other) const;
-       unsigned calchash() const;
+       ex derivative(const symbol &s) const override { return 0; }
+       bool is_equal_same_type(const basic &other) const override;
+       unsigned calchash() const override;
        
        // new virtual functions which can be overridden by derived classes
        // (none)
index 3d5f187333171c5f1ff110f4940e39de3b0dfe82..0d8eb49e3965ecff5e4ae7d9bee72d475c07701c 100644 (file)
@@ -50,37 +50,37 @@ public:
        
        // functions overriding virtual functions from base classes
 public:
-       unsigned precedence() const {return 60;}
-       bool info(unsigned inf) const;
-       size_t nops() const;
-       ex op(size_t i) const;
-       ex map(map_function & f) const;
-       bool is_polynomial(const ex & var) const;
-       int degree(const ex & s) const;
-       int ldegree(const ex & s) const;
-       ex coeff(const ex & s, int n = 1) const;
-       ex eval(int level=0) const;
-       ex evalf(int level=0) const;
-       ex evalm() const;
-       ex series(const relational & s, int order, unsigned options = 0) const;
-       ex subs(const exmap & m, unsigned options = 0) const;
-       bool has(const ex & other, unsigned options = 0) const;
-       ex normal(exmap & repl, exmap & rev_lookup, int level = 0) const;
-       ex to_rational(exmap & repl) const;
-       ex to_polynomial(exmap & repl) const;
-       ex conjugate() const;
-       ex real_part() const;
-       ex imag_part() const;
+       unsigned precedence() const override {return 60;}
+       bool info(unsigned inf) const override;
+       size_t nops() const override;
+       ex op(size_t i) const override;
+       ex map(map_function & f) const override;
+       bool is_polynomial(const ex & var) const override;
+       int degree(const ex & s) const override;
+       int ldegree(const ex & s) const override;
+       ex coeff(const ex & s, int n = 1) const override;
+       ex eval(int level=0) const override;
+       ex evalf(int level=0) const override;
+       ex evalm() const override;
+       ex series(const relational & s, int order, unsigned options = 0) const override;
+       ex subs(const exmap & m, unsigned options = 0) const override;
+       bool has(const ex & other, unsigned options = 0) const override;
+       ex normal(exmap & repl, exmap & rev_lookup, int level = 0) const override;
+       ex to_rational(exmap & repl) const override;
+       ex to_polynomial(exmap & repl) const override;
+       ex conjugate() const override;
+       ex real_part() const override;
+       ex imag_part() const override;
        /** Save (a.k.a. serialize) object into archive. */
-       void archive(archive_node& n) const;
+       void archive(archive_node& n) const override;
        /** Read (a.k.a. deserialize) object from archive. */
-       void read_archive(const archive_node& n, lst& syms);
+       void read_archive(const archive_node& n, lst& syms) override;
 protected:
-       ex derivative(const symbol & s) const;
-       ex eval_ncmul(const exvector & v) const;
-       unsigned return_type() const;
-       return_type_t return_type_tinfo() const;
-       ex expand(unsigned options = 0) const;
+       ex derivative(const symbol & s) const override;
+       ex eval_ncmul(const exvector & v) const override;
+       unsigned return_type() const override;
+       return_type_t return_type_tinfo() const override;
+       ex expand(unsigned options = 0) const override;
        
        // new virtual functions which can be overridden by derived classes
        // none
index 34456cd724b1b22bdd198b512dec8fcabd45aee3..307dc45ef0f2ddf9ea6a9863b7df5e836bcbdb36 100644 (file)
@@ -199,9 +199,9 @@ public:
        typedef void (*F)(const T &, const C &, unsigned);
 
        print_ptrfun_handler(F f_) : f(f_) {}
-       print_ptrfun_handler *duplicate() const { return new print_ptrfun_handler(*this); }
+       print_ptrfun_handler *duplicate() const override { return new print_ptrfun_handler(*this); }
 
-       void operator()(const basic & obj, const print_context & c, unsigned level) const
+       void operator()(const basic & obj, const print_context & c, unsigned level) const override
        {
                // Call the supplied function
                f(dynamic_cast<const T &>(obj), dynamic_cast<const C &>(c), level);
@@ -218,9 +218,9 @@ public:
        typedef void (T::*F)(const C & c, unsigned level) const;
 
        print_memfun_handler(F f_) : f(f_) {}
-       print_memfun_handler *duplicate() const { return new print_memfun_handler(*this); }
+       print_memfun_handler *duplicate() const override { return new print_memfun_handler(*this); }
 
-       void operator()(const basic & obj, const print_context & c, unsigned level) const
+       void operator()(const basic & obj, const print_context & c, unsigned level) const override
        {
                // Call the supplied member function
                return (dynamic_cast<const T &>(obj).*f)(dynamic_cast<const C &>(c), level);
index cdac31da1395e4e7a11c32fbcf159adde8830d1b..3a36e6d6cf05d457758caa2abe5a4b37dd56c77c 100644 (file)
@@ -43,30 +43,30 @@ public:
 
        // functions overriding virtual functions from base classes
 public:
-       unsigned precedence() const {return 38;} // for clarity just below add::precedence
-       size_t nops() const;
-       ex op(size_t i) const;
-       int degree(const ex &s) const;
-       int ldegree(const ex &s) const;
-       ex coeff(const ex &s, int n = 1) const;
-       ex collect(const ex &s, bool distributed = false) const;
-       ex eval(int level=0) const;
-       ex evalf(int level=0) const;
-       ex series(const relational & r, int order, unsigned options = 0) const;
-       ex subs(const exmap & m, unsigned options = 0) const;
-       ex normal(exmap & repl, exmap & rev_lookup, int level = 0) const;
-       ex expand(unsigned options = 0) const;
-       ex conjugate() const;
-       ex real_part() const;
-       ex imag_part() const;
-       ex eval_integ() const;
-       ex evalm() const;
+       unsigned precedence() const override {return 38;} // for clarity just below add::precedence
+       size_t nops() const override;
+       ex op(size_t i) const override;
+       int degree(const ex &s) const override;
+       int ldegree(const ex &s) const override;
+       ex coeff(const ex &s, int n = 1) const override;
+       ex collect(const ex &s, bool distributed = false) const override;
+       ex eval(int level=0) const override;
+       ex evalf(int level=0) const override;
+       ex series(const relational & r, int order, unsigned options = 0) const override;
+       ex subs(const exmap & m, unsigned options = 0) const override;
+       ex normal(exmap & repl, exmap & rev_lookup, int level = 0) const override;
+       ex expand(unsigned options = 0) const override;
+       ex conjugate() const override;
+       ex real_part() const override;
+       ex imag_part() const override;
+       ex eval_integ() const override;
+       ex evalm() const override;
        /** Save (a.k.a. serialize) object into archive. */
-       void archive(archive_node& n) const;
+       void archive(archive_node& n) const override;
        /** Read (a.k.a. deserialize) object from archive. */
-       void read_archive(const archive_node& n, lst& syms);
+       void read_archive(const archive_node& n, lst& syms) override;
 protected:
-       ex derivative(const symbol & s) const;
+       ex derivative(const symbol & s) const override;
 
        // non-virtual functions in this class
 public:
index 5c97e6d176c1c2b6f20dfa481465178879d47f53..5e2b0e49fbd18e71d658b517e1fee26321533efe 100644 (file)
@@ -151,9 +151,9 @@ public: \
        GINAC_DECLARE_REGISTERED_CLASS_NO_CTORS(classname, supername) \
 public: \
        classname(); \
-       virtual classname * duplicate() const { return new classname(*this); } \
+       classname * duplicate() const override { return new classname(*this); } \
        \
-       virtual void accept(GiNaC::visitor & v) const \
+       void accept(GiNaC::visitor & v) const override \
        { \
                if (visitor *p = dynamic_cast<visitor *>(&v)) \
                        p->visit(*this); \
@@ -161,7 +161,7 @@ public: \
                        inherited::accept(v); \
        } \
 protected: \
-       virtual int compare_same_type(const GiNaC::basic & other) const; \
+       int compare_same_type(const GiNaC::basic & other) const override; \
 private:
 
 
index 6983cbfa02f0429da6e296121656c58339413c6d..c8bf8b6d44c306a2b2f88c3126a595270e278d63 100644 (file)
@@ -52,24 +52,24 @@ public:
        
        // functions overriding virtual functions from base classes
 public:
-       unsigned precedence() const {return 20;}
-       bool info(unsigned inf) const;
-       size_t nops() const;
-       ex op(size_t i) const;
-       ex map(map_function & f) const;
-       ex subs(const exmap & m, unsigned options = 0) const;
-       ex eval(int level=0) const;
+       unsigned precedence() const override {return 20;}
+       bool info(unsigned inf) const override;
+       size_t nops() const override;
+       ex op(size_t i) const override;
+       ex map(map_function & f) const override;
+       ex subs(const exmap & m, unsigned options = 0) const override;
+       ex eval(int level=0) const override;
 
        /** Save (a.k.a. serialize) object into archive. */
-       void archive(archive_node& n) const;
+       void archive(archive_node& n) const override;
        /** Read (a.k.a. deserialize) object from archive. */
-       void read_archive(const archive_node& n, lst& syms);
+       void read_archive(const archive_node& n, lst& syms) override;
 protected:
-       ex eval_ncmul(const exvector & v) const;
-       bool match_same_type(const basic & other) const;
-       unsigned return_type() const;
-       return_type_t return_type_tinfo() const;
-       unsigned calchash() const;
+       ex eval_ncmul(const exvector & v) const override;
+       bool match_same_type(const basic & other) const override;
+       unsigned return_type() const override;
+       return_type_t return_type_tinfo() const override;
+       unsigned calchash() const override;
 
        // new virtual functions which can be overridden by derived classes
 protected:
index b664a6afcb0216e58ae6305667ff761d7c5049ac..1301ad2b25b953a61ef292d6aa25e7152d2417a1 100644 (file)
@@ -126,77 +126,77 @@ public:
        // All these are just defaults that can be specialized by the user
 public:
        // evaluation
-       ex eval(int level = 0) const { return hold(); }
-       ex evalf(int level = 0) const { return inherited::evalf(level); }
-       ex evalm() const { return inherited::evalm(); }
+       ex eval(int level = 0) const override { return hold(); }
+       ex evalf(int level = 0) const override { return inherited::evalf(level); }
+       ex evalm() const override { return inherited::evalm(); }
 protected:
-       ex eval_ncmul(const exvector & v) const { return hold_ncmul(v); }
+       ex eval_ncmul(const exvector & v) const override { return hold_ncmul(v); }
 public:
-       ex eval_indexed(const basic & i) const { return i.hold(); }
+       ex eval_indexed(const basic & i) const override { return i.hold(); }
 
        // printing
-       void print(const print_context & c, unsigned level = 0) const { inherited::print(c, level); }
-       unsigned precedence() const { return 70; }
+       void print(const print_context & c, unsigned level = 0) const override { inherited::print(c, level); }
+       unsigned precedence() const override { return 70; }
 
        // info
-       bool info(unsigned inf) const { return false; }
+       bool info(unsigned inf) const override { return false; }
 
        // operand access
-       size_t nops() const { return 0; }
-       ex op(size_t i) const { return inherited::op(i); }
-       ex operator[](const ex & index) const { return inherited::operator[](index); }
-       ex operator[](size_t i) const { return inherited::operator[](i); }
-       ex & let_op(size_t i) { return inherited::let_op(i); }
-       ex & operator[](const ex & index) { return inherited::operator[](index); }
-       ex & operator[](size_t i) { return inherited::operator[](i); }
+       size_t nops() const override { return 0; }
+       ex op(size_t i) const override { return inherited::op(i); }
+       ex operator[](const ex & index) const override { return inherited::operator[](index); }
+       ex operator[](size_t i) const override { return inherited::operator[](i); }
+       ex & let_op(size_t i) override { return inherited::let_op(i); }
+       ex & operator[](const ex & index) override { return inherited::operator[](index); }
+       ex & operator[](size_t i) override { return inherited::operator[](i); }
 
        // pattern matching
-       bool has(const ex & other, unsigned options = 0) const { return inherited::has(other, options); }
-       bool match(const ex & pattern, exmap& repl_lst) const { return inherited::match(pattern, repl_lst); }
+       bool has(const ex & other, unsigned options = 0) const override { return inherited::has(other, options); }
+       bool match(const ex & pattern, exmap& repl_lst) const override { return inherited::match(pattern, repl_lst); }
 protected:
-       bool match_same_type(const basic & other) const { return true; }
+       bool match_same_type(const basic & other) const override { return true; }
 public:
 
        // substitutions
-       ex subs(const exmap & m, unsigned options = 0) const { return inherited::subs(m, options); }
+       ex subs(const exmap & m, unsigned options = 0) const override { return inherited::subs(m, options); }
 
        // function mapping
-       ex map(map_function & f) const { return inherited::map(f); }
+       ex map(map_function & f) const override { return inherited::map(f); }
 
        // degree/coeff
-       int degree(const ex & s) const { return inherited::degree(s); }
-       int ldegree(const ex & s) const { return inherited::ldegree(s); }
-       ex coeff(const ex & s, int n = 1) const { return inherited::coeff(s, n); }
+       int degree(const ex & s) const override { return inherited::degree(s); }
+       int ldegree(const ex & s) const override { return inherited::ldegree(s); }
+       ex coeff(const ex & s, int n = 1) const override { return inherited::coeff(s, n); }
 
        // expand/collect
-       ex expand(unsigned options = 0) const { return inherited::expand(options); }
-       ex collect(const ex & s, bool distributed = false) const { return inherited::collect(s, distributed); }
+       ex expand(unsigned options = 0) const override { return inherited::expand(options); }
+       ex collect(const ex & s, bool distributed = false) const override { return inherited::collect(s, distributed); }
 
        // differentiation and series expansion
 protected:
-       ex derivative(const symbol & s) const { return inherited::derivative(s); }
+       ex derivative(const symbol & s) const override { return inherited::derivative(s); }
 public:
-       ex series(const relational & r, int order, unsigned options = 0) const { return inherited::series(r, order, options); }
+       ex series(const relational & r, int order, unsigned options = 0) const override { return inherited::series(r, order, options); }
 
        // rational functions
-       ex normal(exmap & repl, exmap & rev_lookup, int level = 0) const { return inherited::normal(repl, rev_lookup, level); }
-       ex to_rational(exmap & repl) const { return inherited::to_rational(repl); }
-       ex to_polynomial(exmap & repl) const { return inherited::to_polynomial(repl); }
+       ex normal(exmap & repl, exmap & rev_lookup, int level = 0) const override { return inherited::normal(repl, rev_lookup, level); }
+       ex to_rational(exmap & repl) const override { return inherited::to_rational(repl); }
+       ex to_polynomial(exmap & repl) const override { return inherited::to_polynomial(repl); }
 
        // polynomial algorithms
-       numeric integer_content() const { return 1; }
-       ex smod(const numeric & xi) const { return *this; }
-       numeric max_coefficient() const { return 1; }
+       numeric integer_content() const override { return 1; }
+       ex smod(const numeric & xi) const override { return *this; }
+       numeric max_coefficient() const override { return 1; }
 
        // indexed objects
-       exvector get_free_indices() const { return exvector(); }
-       ex add_indexed(const ex & self, const ex & other) const { return self + other; }
-       ex scalar_mul_indexed(const ex & self, const numeric & other) const { return self * ex(other); }
-       bool contract_with(exvector::iterator self, exvector::iterator other, exvector & v) const { return false; }
+       exvector get_free_indices() const override { return exvector(); }
+       ex add_indexed(const ex & self, const ex & other) const override { return self + other; }
+       ex scalar_mul_indexed(const ex & self, const numeric & other) const override { return self * ex(other); }
+       bool contract_with(exvector::iterator self, exvector::iterator other, exvector & v) const override { return false; }
 
        // noncommutativity
-       unsigned return_type() const { return return_types::commutative; }
-       return_type_t return_type_tinfo() const 
+       unsigned return_type() const override { return return_types::commutative; }
+       return_type_t return_type_tinfo() const override
        {
                return_type_t r;
                r.rl = 0;
@@ -205,7 +205,7 @@ public:
        }
 
 protected:
-       bool is_equal_same_type(const basic & other) const
+       bool is_equal_same_type(const basic & other) const override
        {
                GINAC_ASSERT(is_a<structure>(other));
                const structure & o = static_cast<const structure &>(other);
@@ -213,7 +213,7 @@ protected:
                return this->struct_is_equal(&obj, &o.obj);
        }
 
-       unsigned calchash() const { return inherited::calchash(); }
+       unsigned calchash() const override { return inherited::calchash(); }
 
        // non-virtual functions in this class
 public:
index 3a8505c05cbcb25756dd0c5214466bffb250d354..68b747e8abb899576607cf5179d44e15cbf52ff7 100644 (file)
@@ -45,33 +45,36 @@ public:
        
        // functions overriding virtual functions from base classes
 public:
-       bool info(unsigned inf) const;
-       ex eval(int level = 0) const { return *this; } // for performance reasons
-       ex evalf(int level = 0) const { return *this; } // overwrites basic::evalf() for performance reasons
-       ex series(const relational & s, int order, unsigned options = 0) const;
-       ex subs(const exmap & m, unsigned options = 0) const { return subs_one_level(m, options); } // overwrites basic::subs() for performance reasons
-       ex normal(exmap & repl, exmap & rev_lookup, int level = 0) const;
-       ex to_rational(exmap & repl) const;
-       ex to_polynomial(exmap & repl) const;
-       ex conjugate() const;
-       ex real_part() const;
-       ex imag_part() const;
-       bool is_polynomial(const ex & var) const;
+       bool info(unsigned inf) const override;
+       ex eval(int level = 0) const override { return *this; } // for performance reasons
+       ex evalf(int level = 0) const override { return *this; } // overwrites basic::evalf() for performance reasons
+       ex series(const relational & s, int order, unsigned options = 0) const override;
+       ex subs(const exmap & m, unsigned options = 0) const override { return subs_one_level(m, options); } // overwrites basic::subs() for performance reasons
+       ex normal(exmap & repl, exmap & rev_lookup, int level = 0) const override;
+       ex to_rational(exmap & repl) const override;
+       ex to_polynomial(exmap & repl) const override;
+       ex conjugate() const override;
+       ex real_part() const override;
+       ex imag_part() const override;
+       bool is_polynomial(const ex & var) const override;
        /** Save (a.k.a. serialize) object into archive. */
-       void archive(archive_node& n) const;
+       void archive(archive_node& n) const override;
        /** Read (a.k.a. deserialize) object from archive. */
-       void read_archive(const archive_node& n, lst& syms);
+       void read_archive(const archive_node& n, lst& syms) override;
 protected:
-       ex derivative(const symbol & s) const;
-       bool is_equal_same_type(const basic & other) const;
-       unsigned calchash() const;
+       ex derivative(const symbol & s) const override;
+       bool is_equal_same_type(const basic & other) const override;
+       unsigned calchash() const override;
+
+       // new virtual functions which can be overridden by derived classes
+public:
+       virtual unsigned get_domain() const { return domain::complex; }
        
        // non-virtual functions in this class
 public:
        void set_name(const std::string & n) { name = n; }
        void set_TeX_name(const std::string & n) { TeX_name = n; }
        std::string get_name() const;
-       virtual unsigned get_domain() const { return domain::complex; }
 protected:
        void do_print(const print_context & c, unsigned level) const;
        void do_print_latex(const print_latex & c, unsigned level) const;
@@ -98,13 +101,13 @@ public:
        explicit realsymbol(const std::string & initname);
        realsymbol(const std::string & initname, const std::string & texname);
 
-       unsigned get_domain() const { return domain::real; }
+       unsigned get_domain() const override { return domain::real; }
 
-       ex conjugate() const { return *this; }
-       ex real_part() const { return *this; }
-       ex imag_part() const { return 0; }
+       ex conjugate() const override { return *this; }
+       ex real_part() const override { return *this; }
+       ex imag_part() const override { return 0; }
 
-       realsymbol* duplicate() const { return new realsymbol(*this); }
+       realsymbol* duplicate() const override { return new realsymbol(*this); }
 };
 GINAC_DECLARE_UNARCHIVER(realsymbol);
 
@@ -117,9 +120,9 @@ public:
        explicit possymbol(const std::string & initname);
        possymbol(const std::string & initname, const std::string & texname);
 
-       unsigned get_domain() const { return domain::positive; }
+       unsigned get_domain() const override { return domain::positive; }
 
-       possymbol* duplicate() const { return new possymbol(*this); }
+       possymbol* duplicate() const override { return new possymbol(*this); }
 };
 GINAC_DECLARE_UNARCHIVER(possymbol);
 
index 6839e7562d2948bed4879298a55d861773e41eda..c369aed32636c070bdc3dd7e7343d3af3f9a43c7 100644 (file)
@@ -61,6 +61,15 @@ public:
        /** Create node with two children. */
        symmetry(symmetry_type t, const symmetry &c1, const symmetry &c2);
 
+       // functions overriding virtual functions from base classes
+public:
+       /** Save (a.k.a. serialize) object into archive. */
+       void archive(archive_node& n) const override;
+       /** Read (a.k.a. deserialize) object from archive. */
+       void read_archive(const archive_node& n, lst& syms) override;
+protected:
+       unsigned calchash() const override;
+
        // non-virtual functions in this class
 public:
        /** Get symmetry type. */
@@ -84,15 +93,9 @@ public:
        bool has_nonsymmetric() const;
        /** Check whether this node involves a cyclic symmetry. */
        bool has_cyclic() const;
-
-       /** Save (a.k.a. serialize) object into archive. */
-       void archive(archive_node& n) const;
-       /** Read (a.k.a. deserialize) object from archive. */
-       void read_archive(const archive_node& n, lst& syms);
 protected:
        void do_print(const print_context & c, unsigned level) const;
        void do_print_tree(const print_tree & c, unsigned level) const;
-       unsigned calchash() const;
 
        // member variables
 private:
index 8dd667af2202a5b137d5efa19df6703852b5dbdb..dbe0f1e956cfea71ba441d0f8cbc238fea619008 100644 (file)
@@ -37,7 +37,7 @@ class tensor : public basic
 
        // functions overriding virtual functions from base classes
 protected:
-       unsigned return_type() const { return return_types::noncommutative_composite; }
+       unsigned return_type() const override { return return_types::noncommutative_composite; }
 
        // non-virtual functions in this class
 public:
@@ -56,13 +56,14 @@ class tensdelta : public tensor
 
        // functions overriding virtual functions from base classes
 public:
-       bool info(unsigned inf) const;
-       ex eval_indexed(const basic & i) const;
-       bool contract_with(exvector::iterator self, exvector::iterator other, exvector & v) const;
+       bool info(unsigned inf) const override;
+       ex eval_indexed(const basic & i) const override;
+       bool contract_with(exvector::iterator self, exvector::iterator other, exvector & v) const override;
+protected:
+       unsigned return_type() const override { return return_types::commutative; }
 
        // non-virtual functions in this class
 protected:
-       unsigned return_type() const { return return_types::commutative; }
        void do_print(const print_context & c, unsigned level) const;
        void do_print_latex(const print_latex & c, unsigned level) const;
 };
@@ -78,13 +79,14 @@ class tensmetric : public tensor
 
        // functions overriding virtual functions from base classes
 public:
-       bool info(unsigned inf) const;
-       ex eval_indexed(const basic & i) const;
-       bool contract_with(exvector::iterator self, exvector::iterator other, exvector & v) const;
+       bool info(unsigned inf) const override;
+       ex eval_indexed(const basic & i) const override;
+       bool contract_with(exvector::iterator self, exvector::iterator other, exvector & v) const override;
+protected:
+       unsigned return_type() const override { return return_types::commutative; }
 
        // non-virtual functions in this class
 protected:
-       unsigned return_type() const { return return_types::commutative; }
        void do_print(const print_context & c, unsigned level) const;
 };
 GINAC_DECLARE_UNARCHIVER(tensmetric);
@@ -104,16 +106,18 @@ public:
 
        // functions overriding virtual functions from base classes
 public:
-       bool info(unsigned inf) const;
-       ex eval_indexed(const basic & i) const;
+       bool info(unsigned inf) const override;
+       ex eval_indexed(const basic & i) const override;
 
        /** Save (a.k.a. serialize) object into archive. */
-       void archive(archive_node& n) const;
+       void archive(archive_node& n) const override;
        /** Read (a.k.a. deserialize) object from archive. */
-       void read_archive(const archive_node& n, lst& syms);
+       void read_archive(const archive_node& n, lst& syms) override;
+protected:
+       unsigned return_type() const override { return return_types::commutative; }
+
        // non-virtual functions in this class
 protected:
-       unsigned return_type() const { return return_types::commutative; }
        void do_print(const print_context & c, unsigned level) const;
        void do_print_latex(const print_latex & c, unsigned level) const;
 
@@ -134,9 +138,9 @@ class spinmetric : public tensmetric
 
        // functions overriding virtual functions from base classes
 public:
-       bool info(unsigned inf) const;
-       ex eval_indexed(const basic & i) const;
-       bool contract_with(exvector::iterator self, exvector::iterator other, exvector & v) const;
+       bool info(unsigned inf) const override;
+       ex eval_indexed(const basic & i) const override;
+       bool contract_with(exvector::iterator self, exvector::iterator other, exvector & v) const override;
 
 protected:
        void do_print(const print_context & c, unsigned level) const;
@@ -158,17 +162,19 @@ public:
 
        // functions overriding virtual functions from base classes
 public:
-       bool info(unsigned inf) const;
-       ex eval_indexed(const basic & i) const;
-       bool contract_with(exvector::iterator self, exvector::iterator other, exvector & v) const;
+       bool info(unsigned inf) const override;
+       ex eval_indexed(const basic & i) const override;
+       bool contract_with(exvector::iterator self, exvector::iterator other, exvector & v) const override;
 
        /** Save (a.k.a. serialize) object into archive. */
-       void archive(archive_node& n) const;
+       void archive(archive_node& n) const override;
        /** Read (a.k.a. deserialize) object from archive. */
-       void read_archive(const archive_node& n, lst& syms);
+       void read_archive(const archive_node& n, lst& syms) override;
+protected:
+       unsigned return_type() const override { return return_types::commutative; }
+
        // non-virtual functions in this class
 protected:
-       unsigned return_type() const { return return_types::commutative; }
        void do_print(const print_context & c, unsigned level) const;
        void do_print_latex(const print_latex & c, unsigned level) const;
 
index d157d9b7550005bee0a25b0067d1645a7fc0b0da..6a66ae3f7a8a3d0a5ff7ad86a06a5c2b6f02a893 100644 (file)
@@ -41,14 +41,14 @@ public:
 
        // functions overriding virtual functions from base classes
 public:
-       bool match(const ex & pattern, exmap& repl_lst) const;
+       bool match(const ex & pattern, exmap& repl_lst) const override;
 
        /** Save (a.k.a. serialize) object into archive. */
-       void archive(archive_node& n) const;
+       void archive(archive_node& n) const override;
        /** Read (a.k.a. deserialize) object from archive. */
-       void read_archive(const archive_node& n, lst& syms);
+       void read_archive(const archive_node& n, lst& syms) override;
 protected:
-       unsigned calchash() const;
+       unsigned calchash() const override;
 
        // non-virtual functions in this class
 public:
index bb62ed051b9e55530d4173ee5d837ed35d7b9b1b..6210deff40f704b82104cffe75b496cd7b42bb81 100644 (file)
@@ -472,7 +472,7 @@ class apply_map_function : public map_function {
 public:
        apply_map_function(const ex & a) : apply(a) {}
        virtual ~apply_map_function() {}
-       ex operator()(const ex & e) { return apply.subs(wild() == e, true); }
+       ex operator()(const ex & e) override { return apply.subs(wild() == e, true); }
 };
 
 static ex f_map(const exprseq &e)