Port to C++11 override keyword

Performed using modernize-use-override from clang-tidy.

https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-override.html
parent 9656904d
...@@ -93,10 +93,10 @@ class ProductQuadrature : public QuadratureImpl<prodpit> ...@@ -93,10 +93,10 @@ class ProductQuadrature : public QuadratureImpl<prodpit>
const OneDQuadrature &uquad; const OneDQuadrature &uquad;
public: public:
ProductQuadrature(int d, const OneDQuadrature &uq); ProductQuadrature(int d, const OneDQuadrature &uq);
virtual ~ProductQuadrature() ~ProductQuadrature()
= default; override = default;
int int
numEvals(int l) const numEvals(int l) const override
{ {
int res = 1; int res = 1;
for (int i = 0; i < dimen(); i++) for (int i = 0; i < dimen(); i++)
...@@ -105,7 +105,7 @@ public: ...@@ -105,7 +105,7 @@ public:
} }
void designLevelForEvals(int max_eval, int &lev, int &evals) const; void designLevelForEvals(int max_eval, int &lev, int &evals) const;
protected: protected:
prodpit begin(int ti, int tn, int level) const; prodpit begin(int ti, int tn, int level) const override;
}; };
#endif #endif
...@@ -120,7 +120,7 @@ public: ...@@ -120,7 +120,7 @@ public:
smarter. */ smarter. */
void void
operator()() operator()() override
{ {
_Tpit beg = quad.begin(ti, tn, level); _Tpit beg = quad.begin(ti, tn, level);
_Tpit end = quad.begin(ti+1, tn, level); _Tpit end = quad.begin(ti+1, tn, level);
...@@ -162,7 +162,7 @@ public: ...@@ -162,7 +162,7 @@ public:
/* Just fill a thread group with workes and run it. */ /* Just fill a thread group with workes and run it. */
void void
integrate(VectorFunctionSet &fs, int level, Vector &out) const integrate(VectorFunctionSet &fs, int level, Vector &out) const override
{ {
// todo: out.length()==func.outdim() // todo: out.length()==func.outdim()
// todo: dim == func.indim() // todo: dim == func.indim()
...@@ -177,7 +177,7 @@ public: ...@@ -177,7 +177,7 @@ public:
} }
void void
integrate(const VectorFunction &func, integrate(const VectorFunction &func,
int level, int tn, Vector &out) const int level, int tn, Vector &out) const override
{ {
VectorFunctionSet fs(func, tn); VectorFunctionSet fs(func, tn);
integrate(fs, level, out); integrate(fs, level, out);
...@@ -246,25 +246,25 @@ public: ...@@ -246,25 +246,25 @@ public:
{ {
calcOffsets(); calcOffsets();
} }
virtual ~OneDPrecalcQuadrature() ~OneDPrecalcQuadrature()
= default; override = default;
int int
numLevels() const numLevels() const override
{ {
return num_levels; return num_levels;
} }
int int
numPoints(int level) const numPoints(int level) const override
{ {
return num_points[level-1]; return num_points[level-1];
} }
double double
point(int level, int i) const point(int level, int i) const override
{ {
return points[offsets[level-1]+i]; return points[offsets[level-1]+i];
} }
double double
weight(int level, int i) const weight(int level, int i) const override
{ {
return weights[offsets[level-1]+i]; return weights[offsets[level-1]+i];
} }
......
...@@ -206,16 +206,16 @@ public: ...@@ -206,16 +206,16 @@ public:
: QuadratureImpl<qmcpit>(d), QMCSpecification(d, l, p) : QuadratureImpl<qmcpit>(d), QMCSpecification(d, l, p)
{ {
} }
virtual ~QMCarloCubeQuadrature() ~QMCarloCubeQuadrature()
= default; override = default;
int int
numEvals(int l) const numEvals(int l) const override
{ {
return l; return l;
} }
protected: protected:
qmcpit qmcpit
begin(int ti, int tn, int lev) const begin(int ti, int tn, int lev) const override
{ {
return qmcpit(*this, ti*level()/tn + 1); return qmcpit(*this, ti*level()/tn + 1);
} }
...@@ -280,16 +280,16 @@ public: ...@@ -280,16 +280,16 @@ public:
: QuadratureImpl<qmcnpit>(d), QMCSpecification(d, l, p) : QuadratureImpl<qmcnpit>(d), QMCSpecification(d, l, p)
{ {
} }
virtual ~QMCarloNormalQuadrature() ~QMCarloNormalQuadrature()
= default; override = default;
int int
numEvals(int l) const numEvals(int l) const override
{ {
return l; return l;
} }
protected: protected:
qmcnpit qmcnpit
begin(int ti, int tn, int lev) const begin(int ti, int tn, int lev) const override
{ {
return qmcnpit(*this, ti*level()/tn + 1); return qmcnpit(*this, ti*level()/tn + 1);
} }
...@@ -299,14 +299,14 @@ protected: ...@@ -299,14 +299,14 @@ protected:
class WarnockPerScheme : public PermutationScheme class WarnockPerScheme : public PermutationScheme
{ {
public: public:
int permute(int i, int base, int c) const; int permute(int i, int base, int c) const override;
}; };
/* Declares reverse permutation scheme. */ /* Declares reverse permutation scheme. */
class ReversePerScheme : public PermutationScheme class ReversePerScheme : public PermutationScheme
{ {
public: public:
int permute(int i, int base, int c) const; int permute(int i, int base, int c) const override;
}; };
/* Declares no permutation (identity) scheme. */ /* Declares no permutation (identity) scheme. */
...@@ -314,7 +314,7 @@ class IdentityPerScheme : public PermutationScheme ...@@ -314,7 +314,7 @@ class IdentityPerScheme : public PermutationScheme
{ {
public: public:
int int
permute(int i, int base, int c) const permute(int i, int base, int c) const override
{ {
return c; return c;
} }
......
...@@ -108,12 +108,12 @@ class SmolyakQuadrature : public QuadratureImpl<smolpit> ...@@ -108,12 +108,12 @@ class SmolyakQuadrature : public QuadratureImpl<smolpit>
PascalTriangle psc; PascalTriangle psc;
public: public:
SmolyakQuadrature(int d, int l, const OneDQuadrature &uq); SmolyakQuadrature(int d, int l, const OneDQuadrature &uq);
virtual ~SmolyakQuadrature() ~SmolyakQuadrature()
= default; override = default;
virtual int numEvals(int level) const; int numEvals(int level) const override;
void designLevelForEvals(int max_eval, int &lev, int &evals) const; void designLevelForEvals(int max_eval, int &lev, int &evals) const;
protected: protected:
smolpit begin(int ti, int tn, int level) const; smolpit begin(int ti, int tn, int level) const override;
unsigned int unsigned int
numSummands() const numSummands() const
{ {
......
...@@ -153,17 +153,17 @@ public: ...@@ -153,17 +153,17 @@ public:
GaussConverterFunction(VectorFunction &f, const GeneralMatrix &vcov); GaussConverterFunction(VectorFunction &f, const GeneralMatrix &vcov);
GaussConverterFunction(VectorFunction *f, const GeneralMatrix &vcov); GaussConverterFunction(VectorFunction *f, const GeneralMatrix &vcov);
GaussConverterFunction(const GaussConverterFunction &f); GaussConverterFunction(const GaussConverterFunction &f);
virtual ~GaussConverterFunction() ~GaussConverterFunction() override
{ {
if (delete_flag) if (delete_flag)
delete func; delete func;
} }
virtual VectorFunction * VectorFunction *
clone() const clone() const override
{ {
return new GaussConverterFunction(*this); return new GaussConverterFunction(*this);
} }
virtual void eval(const Vector &point, const ParameterSignal &sig, Vector &out); void eval(const Vector &point, const ParameterSignal &sig, Vector &out) override;
private: private:
double calcMultiplier() const; double calcMultiplier() const;
void calcCholeskyFactor(const GeneralMatrix &vcov); void calcCholeskyFactor(const GeneralMatrix &vcov);
......
...@@ -37,11 +37,11 @@ public: ...@@ -37,11 +37,11 @@ public:
= default; = default;
VectorFunction * VectorFunction *
clone() const clone() const override
{ {
return new MomentFunction(*this); return new MomentFunction(*this);
} }
void eval(const Vector &point, const ParameterSignal &sig, Vector &out); void eval(const Vector &point, const ParameterSignal &sig, Vector &out) override;
}; };
void void
...@@ -72,11 +72,11 @@ public: ...@@ -72,11 +72,11 @@ public:
= default; = default;
VectorFunction * VectorFunction *
clone() const clone() const override
{ {
return new TensorPower(*this); return new TensorPower(*this);
} }
void eval(const Vector &point, const ParameterSignal &sig, Vector &out); void eval(const Vector &point, const ParameterSignal &sig, Vector &out) override;
}; };
void void
...@@ -108,11 +108,11 @@ public: ...@@ -108,11 +108,11 @@ public:
{ {
} }
VectorFunction * VectorFunction *
clone() const clone() const override
{ {
return new Function1(*this); return new Function1(*this);
} }
virtual void eval(const Vector &point, const ParameterSignal &sig, Vector &out); void eval(const Vector &point, const ParameterSignal &sig, Vector &out) override;
}; };
void void
...@@ -144,11 +144,11 @@ public: ...@@ -144,11 +144,11 @@ public:
= default; = default;
VectorFunction * VectorFunction *
clone() const clone() const override
{ {
return new Function1Trans(*this); return new Function1Trans(*this);
} }
virtual void eval(const Vector &point, const ParameterSignal &sig, Vector &out); void eval(const Vector &point, const ParameterSignal &sig, Vector &out) override;
}; };
void void
...@@ -438,7 +438,7 @@ public: ...@@ -438,7 +438,7 @@ public:
} }
bool bool
run() const run() const override
{ {
GeneralMatrix m(2, 2); GeneralMatrix m(2, 2);
m.zeros(); m.get(0, 0) = 1; m.get(1, 1) = 1; m.zeros(); m.get(0, 0) = 1; m.get(1, 1) = 1;
...@@ -455,7 +455,7 @@ public: ...@@ -455,7 +455,7 @@ public:
} }
bool bool
run() const run() const override
{ {
GeneralMatrix m(3, 3); GeneralMatrix m(3, 3);
m.zeros(); m.zeros();
...@@ -474,7 +474,7 @@ public: ...@@ -474,7 +474,7 @@ public:
} }
bool bool
run() const run() const override
{ {
GeneralMatrix m(2, 2); GeneralMatrix m(2, 2);
m.zeros(); m.get(0, 0) = 1; m.get(1, 1) = 1; m.zeros(); m.get(0, 0) = 1; m.get(1, 1) = 1;
...@@ -491,7 +491,7 @@ public: ...@@ -491,7 +491,7 @@ public:
} }
bool bool
run() const run() const override
{ {
GeneralMatrix m(3, 3); GeneralMatrix m(3, 3);
m.zeros(); m.zeros();
...@@ -510,7 +510,7 @@ public: ...@@ -510,7 +510,7 @@ public:
} }
bool bool
run() const run() const override
{ {
GeneralMatrix m(2, 2); GeneralMatrix m(2, 2);
m.zeros(); m.get(0, 0) = 1; m.get(1, 1) = 1; m.zeros(); m.get(0, 0) = 1; m.get(1, 1) = 1;
...@@ -527,7 +527,7 @@ public: ...@@ -527,7 +527,7 @@ public:
} }
bool bool
run() const run() const override
{ {
GeneralMatrix m(3, 3); GeneralMatrix m(3, 3);
m.zeros(); m.zeros();
...@@ -547,7 +547,7 @@ public: ...@@ -547,7 +547,7 @@ public:
} }
bool bool
run() const run() const override
{ {
Function1Trans f1(6); Function1Trans f1(6);
Vector res(1); res[0] = 1.0; Vector res(1); res[0] = 1.0;
...@@ -564,7 +564,7 @@ public: ...@@ -564,7 +564,7 @@ public:
} }
bool bool
run() const run() const override
{ {
Function1 f1(6); Function1 f1(6);
return qmc_cube(f1, 1.0, 1.e-4, 1000000); return qmc_cube(f1, 1.0, 1.e-4, 1000000);
......
...@@ -73,7 +73,7 @@ public: ...@@ -73,7 +73,7 @@ public:
typedef StackContainer<FGSTensor>::_Ctype _Ctype; typedef StackContainer<FGSTensor>::_Ctype _Ctype;
typedef StackContainer<FGSTensor>::itype itype; typedef StackContainer<FGSTensor>::itype itype;
ZAuxContainer(const _Ctype *gss, int ngss, int ng, int ny, int nu); ZAuxContainer(const _Ctype *gss, int ngss, int ng, int ny, int nu);
itype getType(int i, const Symmetry &s) const; itype getType(int i, const Symmetry &s) const override;
}; };
/* This class provides an interface to approximation algorithms. The /* This class provides an interface to approximation algorithms. The
......
...@@ -126,31 +126,31 @@ public: ...@@ -126,31 +126,31 @@ public:
centralize(dr); centralize(dr);
} }
const Vector & const Vector &
getSteady() const getSteady() const override
{ {
return ysteady; return ysteady;
} }
TwoDMatrix *simulate(emethod em, int np, const Vector &ystart, TwoDMatrix *simulate(emethod em, int np, const Vector &ystart,
ShockRealization &sr) const; ShockRealization &sr) const override;
void evaluate(emethod em, Vector &out, const ConstVector &ys, void evaluate(emethod em, Vector &out, const ConstVector &ys,
const ConstVector &u) const; const ConstVector &u) const override;
DecisionRule *centralizedClone(const Vector &fixpoint) const; DecisionRule *centralizedClone(const Vector &fixpoint) const override;
void writeMat(mat_t *fd, const char *prefix) const; void writeMat(mat_t *fd, const char *prefix) const override;
int int
nexog() const nexog() const override
{ {
return nu; return nu;
} }
const PartitionY & const PartitionY &
getYPart() const getYPart() const override
{ {
return ypart; return ypart;
} }
protected: protected:
void fillTensors(const _Tg &g, double sigma); void fillTensors(const _Tg &g, double sigma);
void centralize(const DecisionRuleImpl &dr); void centralize(const DecisionRuleImpl &dr);
void eval(emethod em, Vector &out, const ConstVector &v) const; void eval(emethod em, Vector &out, const ConstVector &v) const override;
}; };
/* Here we have to fill the tensor polynomial. This involves two /* Here we have to fill the tensor polynomial. This involves two
...@@ -495,8 +495,8 @@ public: ...@@ -495,8 +495,8 @@ public:
typedef typename DecisionRule::emethod emethod; typedef typename DecisionRule::emethod emethod;
DRFixPoint(const _Tg &g, const PartitionY &yp, DRFixPoint(const _Tg &g, const PartitionY &yp,
const Vector &ys, double sigma); const Vector &ys, double sigma);
virtual
~DRFixPoint(); ~DRFixPoint() override;
bool calcFixPoint(emethod em, Vector &out); bool calcFixPoint(emethod em, Vector &out);
...@@ -925,7 +925,7 @@ public: ...@@ -925,7 +925,7 @@ public:
: res(sim_res), dr(dec_rule), em(emet), np(num_per), st(start), sr(shock_r) : res(sim_res), dr(dec_rule), em(emet), np(num_per), st(start), sr(shock_r)
{ {
} }
void operator()(); void operator()() override;
}; };
/* This worker simulates a given impulse |imp| to a given shock /* This worker simulates a given impulse |imp| to a given shock
...@@ -951,7 +951,7 @@ public: ...@@ -951,7 +951,7 @@ public:
idata(id), ishock(ishck), imp(impulse) idata(id), ishock(ishck), imp(impulse)
{ {
} }
void operator()(); void operator()() override;
}; };
/* This class does the real time simulation job for /* This class does the real time simulation job for
...@@ -977,7 +977,7 @@ public: ...@@ -977,7 +977,7 @@ public:
: res(sim_res), dr(dec_rule), em(emet), np(num_per), ystart(start), sr(shock_r) : res(sim_res), dr(dec_rule), em(emet), np(num_per), ystart(start), sr(shock_r)
{ {
} }
void operator()(); void operator()() override;
}; };
/* This class generates draws from Gaussian distribution with zero mean /* This class generates draws from Gaussian distribution with zero mean
...@@ -999,11 +999,11 @@ public: ...@@ -999,11 +999,11 @@ public:
: mtwister(sr.mtwister), factor(sr.factor) : mtwister(sr.mtwister), factor(sr.factor)
{ {
} }
virtual ~RandomShockRealization() ~RandomShockRealization()
= default; override = default;
void get(int n, Vector &out); void get(int n, Vector &out) override;
int int
numShocks() const numShocks() const override
{ {
return factor.nrows(); return factor.nrows();
} }
...@@ -1032,9 +1032,9 @@ public: ...@@ -1032,9 +1032,9 @@ public:
{ {
} }
ExplicitShockRealization(ShockRealization &sr, int num_per); ExplicitShockRealization(ShockRealization &sr, int num_per);
void get(int n, Vector &out); void get(int n, Vector &out) override;
int int
numShocks() const numShocks() const override
{ {
return shocks.nrows(); return shocks.nrows();
} }
...@@ -1069,9 +1069,9 @@ public: ...@@ -1069,9 +1069,9 @@ public:
KORD_RAISE_IF(sh.nrows() != v.nrows() || v.nrows() != v.ncols(), KORD_RAISE_IF(sh.nrows() != v.nrows() || v.nrows() != v.ncols(),
"Wrong dimension of input matrix in GenShockRealization constructor"); "Wrong dimension of input matrix in GenShockRealization constructor");
} }
void get(int n, Vector &out); void get(int n, Vector &out) override;
int int
numShocks() const numShocks() const override
{ {
return RandomShockRealization::numShocks(); return RandomShockRealization::numShocks();
} }
......
...@@ -74,14 +74,14 @@ protected: ...@@ -74,14 +74,14 @@ protected:
public: public:
ResidFunction(const Approximation &app); ResidFunction(const Approximation &app);
ResidFunction(const ResidFunction &rf); ResidFunction(const ResidFunction &rf);
virtual
~ResidFunction(); ~ResidFunction() override;
virtual VectorFunction * VectorFunction *
clone() const clone() const override
{ {
return new ResidFunction(*this); return new ResidFunction(*this);
} }
virtual void eval(const Vector &point, const ParameterSignal &sig, Vector &out); void eval(const Vector &point