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:
};
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:
};
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:
};
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:
};
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);
}
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;
// 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:
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. */
/** 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. */
/** 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. */
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
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
// 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; }
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;
// 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:
// 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:
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:
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:
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:
// 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:
// 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:
// 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;
};
// 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;
};
// 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:
// 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());
}
/** Archive the object. */
- void archive(archive_node &n) const
+ void archive(archive_node &n) const override
{
inherited::archive(n);
for (auto & i : this->seq) {
}
protected:
- ex conjugate() const
+ ex conjugate() const override
{
STLT *newcont = nullptr;
for (const_iterator i=this->seq.begin(); i!=this->seq.end(); ++i) {
return *this;
}
- ex real_part() const
+ ex real_part() const override
{
STLT cont;
this->reserve(cont, nops());
return thiscontainer(cont);
}
- ex imag_part() const
+ ex imag_part() const override
{
STLT cont;
this->reserve(cont, nops());
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:
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>
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>
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>
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>
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>
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>
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>
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
// 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:
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);
*/
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);
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);
// 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:
// 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:
// 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
// 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:
// 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:
// 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:
// 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
// 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);
// 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);
// 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);
// 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);
// 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);
// 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);
// 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);
// 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
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:
// 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
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;
// 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
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
// 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)
// 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
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);
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);
// 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:
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); \
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:
// 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:
// 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;
}
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);
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:
// 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;
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);
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);
/** 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. */
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:
// 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:
// 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;
};
// 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);
// 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;
// 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;
// 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;
// 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:
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)