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
time-shift
Sébastien Villemot 2019-01-09 16:26:42 +01:00
parent 9656904d41
commit 60fd92ddce
No known key found for this signature in database
GPG Key ID: 2CECE9350ECEBE4A
47 changed files with 404 additions and 404 deletions

View File

@ -93,10 +93,10 @@ class ProductQuadrature : public QuadratureImpl<prodpit>
const OneDQuadrature &uquad;
public:
ProductQuadrature(int d, const OneDQuadrature &uq);
virtual ~ProductQuadrature()
= default;
~ProductQuadrature()
override = default;
int
numEvals(int l) const
numEvals(int l) const override
{
int res = 1;
for (int i = 0; i < dimen(); i++)
@ -105,7 +105,7 @@ public:
}
void designLevelForEvals(int max_eval, int &lev, int &evals) const;
protected:
prodpit begin(int ti, int tn, int level) const;
prodpit begin(int ti, int tn, int level) const override;
};
#endif

View File

@ -120,7 +120,7 @@ public:
smarter. */
void
operator()()
operator()() override
{
_Tpit beg = quad.begin(ti, tn, level);
_Tpit end = quad.begin(ti+1, tn, level);
@ -162,7 +162,7 @@ public:
/* Just fill a thread group with workes and run it. */
void
integrate(VectorFunctionSet &fs, int level, Vector &out) const
integrate(VectorFunctionSet &fs, int level, Vector &out) const override
{
// todo: out.length()==func.outdim()
// todo: dim == func.indim()
@ -177,7 +177,7 @@ public:
}
void
integrate(const VectorFunction &func,
int level, int tn, Vector &out) const
int level, int tn, Vector &out) const override
{
VectorFunctionSet fs(func, tn);
integrate(fs, level, out);
@ -246,25 +246,25 @@ public:
{
calcOffsets();
}
virtual ~OneDPrecalcQuadrature()
= default;
~OneDPrecalcQuadrature()
override = default;
int
numLevels() const
numLevels() const override
{
return num_levels;
}
int
numPoints(int level) const
numPoints(int level) const override
{
return num_points[level-1];
}
double
point(int level, int i) const
point(int level, int i) const override
{
return points[offsets[level-1]+i];
}
double
weight(int level, int i) const
weight(int level, int i) const override
{
return weights[offsets[level-1]+i];
}

View File

@ -206,16 +206,16 @@ public:
: QuadratureImpl<qmcpit>(d), QMCSpecification(d, l, p)
{
}
virtual ~QMCarloCubeQuadrature()
= default;
~QMCarloCubeQuadrature()
override = default;
int
numEvals(int l) const
numEvals(int l) const override
{
return l;
}
protected:
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);
}
@ -280,16 +280,16 @@ public:
: QuadratureImpl<qmcnpit>(d), QMCSpecification(d, l, p)
{
}
virtual ~QMCarloNormalQuadrature()
= default;
~QMCarloNormalQuadrature()
override = default;
int
numEvals(int l) const
numEvals(int l) const override
{
return l;
}
protected:
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);
}
@ -299,14 +299,14 @@ protected:
class WarnockPerScheme : public PermutationScheme
{
public:
int permute(int i, int base, int c) const;
int permute(int i, int base, int c) const override;
};
/* Declares reverse permutation scheme. */
class ReversePerScheme : public PermutationScheme
{
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. */
@ -314,7 +314,7 @@ class IdentityPerScheme : public PermutationScheme
{
public:
int
permute(int i, int base, int c) const
permute(int i, int base, int c) const override
{
return c;
}

View File

@ -108,12 +108,12 @@ class SmolyakQuadrature : public QuadratureImpl<smolpit>
PascalTriangle psc;
public:
SmolyakQuadrature(int d, int l, const OneDQuadrature &uq);
virtual ~SmolyakQuadrature()
= default;
virtual int numEvals(int level) const;
~SmolyakQuadrature()
override = default;
int numEvals(int level) const override;
void designLevelForEvals(int max_eval, int &lev, int &evals) const;
protected:
smolpit begin(int ti, int tn, int level) const;
smolpit begin(int ti, int tn, int level) const override;
unsigned int
numSummands() const
{

View File

@ -153,17 +153,17 @@ public:
GaussConverterFunction(VectorFunction &f, const GeneralMatrix &vcov);
GaussConverterFunction(VectorFunction *f, const GeneralMatrix &vcov);
GaussConverterFunction(const GaussConverterFunction &f);
virtual ~GaussConverterFunction()
~GaussConverterFunction() override
{
if (delete_flag)
delete func;
}
virtual VectorFunction *
clone() const
VectorFunction *
clone() const override
{
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:
double calcMultiplier() const;
void calcCholeskyFactor(const GeneralMatrix &vcov);

View File

@ -37,11 +37,11 @@ public:
= default;
VectorFunction *
clone() const
clone() const override
{
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
@ -72,11 +72,11 @@ public:
= default;
VectorFunction *
clone() const
clone() const override
{
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
@ -108,11 +108,11 @@ public:
{
}
VectorFunction *
clone() const
clone() const override
{
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
@ -144,11 +144,11 @@ public:
= default;
VectorFunction *
clone() const
clone() const override
{
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
@ -438,7 +438,7 @@ public:
}
bool
run() const
run() const override
{
GeneralMatrix m(2, 2);
m.zeros(); m.get(0, 0) = 1; m.get(1, 1) = 1;
@ -455,7 +455,7 @@ public:
}
bool
run() const
run() const override
{
GeneralMatrix m(3, 3);
m.zeros();
@ -474,7 +474,7 @@ public:
}
bool
run() const
run() const override
{
GeneralMatrix m(2, 2);
m.zeros(); m.get(0, 0) = 1; m.get(1, 1) = 1;
@ -491,7 +491,7 @@ public:
}
bool
run() const
run() const override
{
GeneralMatrix m(3, 3);
m.zeros();
@ -510,7 +510,7 @@ public:
}
bool
run() const
run() const override
{
GeneralMatrix m(2, 2);
m.zeros(); m.get(0, 0) = 1; m.get(1, 1) = 1;
@ -527,7 +527,7 @@ public:
}
bool
run() const
run() const override
{
GeneralMatrix m(3, 3);
m.zeros();
@ -547,7 +547,7 @@ public:
}
bool
run() const
run() const override
{
Function1Trans f1(6);
Vector res(1); res[0] = 1.0;
@ -564,7 +564,7 @@ public:
}
bool
run() const
run() const override
{
Function1 f1(6);
return qmc_cube(f1, 1.0, 1.e-4, 1000000);

View File

@ -73,7 +73,7 @@ public:
typedef StackContainer<FGSTensor>::_Ctype _Ctype;
typedef StackContainer<FGSTensor>::itype itype;
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

View File

@ -126,31 +126,31 @@ public:
centralize(dr);
}
const Vector &
getSteady() const
getSteady() const override
{
return ysteady;
}
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,
const ConstVector &u) const;
DecisionRule *centralizedClone(const Vector &fixpoint) const;
void writeMat(mat_t *fd, const char *prefix) const;
const ConstVector &u) const override;
DecisionRule *centralizedClone(const Vector &fixpoint) const override;
void writeMat(mat_t *fd, const char *prefix) const override;
int
nexog() const
nexog() const override
{
return nu;
}
const PartitionY &
getYPart() const
getYPart() const override
{
return ypart;
}
protected:
void fillTensors(const _Tg &g, double sigma);
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
@ -495,8 +495,8 @@ public:
typedef typename DecisionRule::emethod emethod;
DRFixPoint(const _Tg &g, const PartitionY &yp,
const Vector &ys, double sigma);
virtual
~DRFixPoint();
~DRFixPoint() override;
bool calcFixPoint(emethod em, Vector &out);
@ -925,7 +925,7 @@ public:
: 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
@ -951,7 +951,7 @@ public:
idata(id), ishock(ishck), imp(impulse)
{
}
void operator()();
void operator()() override;
};
/* This class does the real time simulation job for
@ -977,7 +977,7 @@ public:
: 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
@ -999,11 +999,11 @@ public:
: mtwister(sr.mtwister), factor(sr.factor)
{
}
virtual ~RandomShockRealization()
= default;
void get(int n, Vector &out);
~RandomShockRealization()
override = default;
void get(int n, Vector &out) override;
int
numShocks() const
numShocks() const override
{
return factor.nrows();
}
@ -1032,9 +1032,9 @@ public:
{
}
ExplicitShockRealization(ShockRealization &sr, int num_per);
void get(int n, Vector &out);
void get(int n, Vector &out) override;
int
numShocks() const
numShocks() const override
{
return shocks.nrows();
}
@ -1069,9 +1069,9 @@ public:
KORD_RAISE_IF(sh.nrows() != v.nrows() || v.nrows() != v.ncols(),
"Wrong dimension of input matrix in GenShockRealization constructor");
}
void get(int n, Vector &out);
void get(int n, Vector &out) override;
int
numShocks() const
numShocks() const override
{
return RandomShockRealization::numShocks();
}

View File

@ -74,14 +74,14 @@ protected:
public:
ResidFunction(const Approximation &app);
ResidFunction(const ResidFunction &rf);
virtual
~ResidFunction();
virtual VectorFunction *
clone() const
~ResidFunction() override;
VectorFunction *
clone() const override
{
return new ResidFunction(*this);
}
virtual void eval(const Vector &point, const ParameterSignal &sig, Vector &out);
void eval(const Vector &point, const ParameterSignal &sig, Vector &out) override;
void setYU(const Vector &ys, const Vector &xx);
};
@ -97,10 +97,10 @@ public:
GResidFunction(const GResidFunction &rf)
= default;
virtual ~GResidFunction()
= default;
virtual VectorFunction *
clone() const
~GResidFunction()
override = default;
VectorFunction *
clone() const override
{
return new GResidFunction(*this);
}

View File

@ -49,7 +49,7 @@ public:
{
printHeader();
}
~Journal()
~Journal() override
{
flush();
}
@ -139,7 +139,7 @@ public:
{
prefix_end[0] = '\0'; journal.incrementDepth();
}
~JournalRecordPair();
~JournalRecordPair() override;
private:
void writePrefixForEnd(const SystemResourcesFlash &f);
};

View File

@ -162,7 +162,7 @@ public:
{
}
PLUMatrix(const PLUMatrix &plu);
virtual ~PLUMatrix()
~PLUMatrix() override
{
delete [] ipiv;
}

View File

@ -254,7 +254,7 @@ public:
: GContainer<_Ttype>(gs, ngs, nu)
{
}
itype getType(int i, const Symmetry &s) const;
itype getType(int i, const Symmetry &s) const override;
};
/* This routine corresponds to this stack:
@ -298,7 +298,7 @@ public:
: ZContainer<_Ttype>(gss, ngss, g, ng, ny, nu)
{
}
itype getType(int i, const Symmetry &s) const;
itype getType(int i, const Symmetry &s) const override;
};
/* This |getType| method corresponds to this stack:

View File

@ -29,7 +29,7 @@ public:
uint32 lrand();
double drand();
double
uniform()
uniform() override
{
return drand();
}

View File

@ -21,7 +21,7 @@ public:
class SystemRandomGenerator : public RandomGenerator
{
public:
double uniform();
double uniform() override;
void initSeed(int seed);
};

View File

@ -343,7 +343,7 @@ public:
}
bool
run() const
run() const override
{
TwoDMatrix gy(8, 4, gy_data);
TwoDMatrix gu(8, 3, gu_data);
@ -366,7 +366,7 @@ public:
}
bool
run() const
run() const override
{
TwoDMatrix gy(30, 20, gy_data2);
TwoDMatrix gu(30, 10, gu_data2);
@ -390,7 +390,7 @@ public:
}
bool
run() const
run() const override
{
TwoDMatrix gy(30, 20, gy_data2);
TwoDMatrix gu(30, 10, gu_data2);

View File

@ -97,14 +97,14 @@ namespace ogp
std::vector<double>(a.expr.nformulas()), aa(a)
{
}
virtual ~AtomAsgnEvaluator()
= default;
~AtomAsgnEvaluator()
override = default;
/** This sets all initial values to NaNs, all constants and
* all values set by user by call set_value. This is called by
* FormulaEvaluator::eval() method, which is called by eval()
* method passing this argument as AtomValues. So the
* ogp::EvalTree will be always this->etree. */
void setValues(EvalTree &et) const;
void setValues(EvalTree &et) const override;
/** User setting of the values. For example in initval,
* parameters are known and should be set to their values. In
* constrast endogenous variables are set initially to NaNs by
@ -114,7 +114,7 @@ namespace ogp
* also checks whether the i-th expression is an atom. If so,
* it sets the value of the atom in ogp::EvalTree
* this->etree. */
void load(int i, double res);
void load(int i, double res) override;
/** After the user values have been set, the assignments can
* be evaluated. For this purpose we have eval() method. The
* result is that this object as std::vector<double> will

View File

@ -131,8 +131,8 @@ namespace ogp
SAtoms(const SAtoms &sa)
= default;
virtual ~SAtoms()
= default;
~SAtoms()
override = default;
/** This substitutes all lags and leads for all exogenous and
* all lags and leads greater than 1 for all endogenous
* variables. This is useful for perfect foresight problems

View File

@ -100,7 +100,7 @@ namespace ogp
void import_constants(const Constants &c, OperationTree &otree, Tintintmap &tmap);
/** Implements AtomValues interface. This sets the values to
* the evaluation tree EvalTree. */
void setValues(EvalTree &et) const;
void setValues(EvalTree &et) const override;
/** This adds a constant with the given tree index. The
* constant must be checked previously and asserted that it
* does not exist. */
@ -169,8 +169,8 @@ namespace ogp
/** Construct empty DynamicAtoms. */
DynamicAtoms();
DynamicAtoms(const DynamicAtoms &da);
virtual ~DynamicAtoms()
= default;
~DynamicAtoms()
override = default;
/** Check the nulary term identified by its string
* representation. The nulary term can be either a constant or
* a variable. If constant, -1 is returned so that it could be
@ -178,19 +178,19 @@ namespace ogp
* appeared or not. If variable, then -1 is returned only if
* the variable has not been assigned an index, otherwise the
* assigned index is returned. */
int check(const char *name) const;
int check(const char *name) const override;
/** Assign the nulary term identified by its string
* representation. This method should be called when check()
* returns -1. */
void assign(const char *name, int t);
void assign(const char *name, int t) override;
/** Return a number of all variables. */
int
nvar() const
nvar() const override
{
return nv;
}
/** Return the vector of variable indices. */
vector<int> variables() const;
vector<int> variables() const override;
/** Return max lead and min lag for a variable given by the
* index. If a variable cannot be found, the method retursn
* the smallest integer as maxlead and the largest integer as
@ -254,7 +254,7 @@ namespace ogp
* storage. */
void unassign_variable(const char *varname, int ll, int t);
/** Debug print. */
void print() const;
void print() const override;
protected:
/** Do the check for the variable. A subclass may need to
* reimplement this so that it could raise an error if the

View File

@ -33,12 +33,12 @@ namespace ogp
{
}
VarOrdering *
clone(const vector<const char *> &vnames, const DynamicAtoms &a) const
clone(const vector<const char *> &vnames, const DynamicAtoms &a) const override
{
return new EndoVarOrdering1(*this, vnames, a);
}
void
do_ordering()
do_ordering() override
{
do_pbspbfbf();
}
@ -61,12 +61,12 @@ namespace ogp
{
}
VarOrdering *
clone(const vector<const char *> &vnames, const DynamicAtoms &a) const
clone(const vector<const char *> &vnames, const DynamicAtoms &a) const override
{
return new EndoVarOrdering2(*this, vnames, a);
}
void
do_ordering()
do_ordering() override
{
do_bfspbfpb();
}
@ -88,12 +88,12 @@ namespace ogp
{
}
VarOrdering *
clone(const vector<const char *> &vnames, const DynamicAtoms &a) const
clone(const vector<const char *> &vnames, const DynamicAtoms &a) const override
{
return new ExoVarOrdering(*this, vnames, a);
}
void
do_ordering()
do_ordering() override
{
do_increasing_time();
}
@ -234,7 +234,7 @@ namespace ogp
}
FineAtoms(const FineAtoms &fa);
/** Deletes endo_order and exo_order. */
virtual ~FineAtoms()
~FineAtoms() override
{
if (endo_order)
delete endo_order;
@ -248,7 +248,7 @@ namespace ogp
* variable is declared by inserting it to
* DynamicAtoms::varnames. This is a responsibility of a
* subclass. */
int check_variable(const char *name) const;
int check_variable(const char *name) const override;
/** This calculates min lag and max lead of endogenous variables. */
void
endovarspan(int &mlead, int &mlag) const
@ -310,7 +310,7 @@ namespace ogp
/** Return the atoms with respect to which we are going to
* differentiate. This must be called after
* parsing_finished. */
vector<int> variables() const;
vector<int> variables() const override;
/** Return the number of static. */
int nstat() const;
/** Return the number of predetermined. */
@ -412,7 +412,7 @@ namespace ogp
* action. */
virtual void register_uniq_param(const char *name);
/** Debug print. */
void print() const;
void print() const override;
private:
/** This performs the common part of parsing_finished(), which
* is a construction of internal orderings. */

View File

@ -42,8 +42,8 @@ namespace ogp
import_atoms(da, otree, tmap);
}
/* Destructor. */
virtual ~StaticAtoms()
= default;
~StaticAtoms()
override = default;
/** This imports atoms from dynamic atoms inserting the new
* tree indices to the given tree (including constants). The
* mapping from old atoms to new atoms is traced in tmap. */
@ -53,17 +53,17 @@ namespace ogp
* constant is registered in Constants, it returns -1
* otherwise. If the name is not constant, it returns result
* from check_variable, which is implemented by a subclass. */
int check(const char *name) const;
int check(const char *name) const override;
/** This assigns a given tree index to the variable name. The
* name should have been checked before the call. */
void assign(const char *name, int t);
void assign(const char *name, int t) override;
int
nvar() const
nvar() const override
{
return varnames.num();
}
/** This returns a vector of all variables. */
vector<int> variables() const;
vector<int> variables() const override;
/** This returns a tree index of the given variable. */
int index(const char *name) const;
/** This returns a name from the given tree index. NULL is
@ -76,7 +76,7 @@ namespace ogp
return varorder[i];
}
/** Debug print. */
void print() const;
void print() const override;
/** This registers a variable. A subclass can reimplement
* this, for example, to ensure uniqueness of the
* name. However, this method should be always called in

View File

@ -84,8 +84,8 @@ namespace ogp
{
StaticFineAtoms::import_atoms(fa, otree, tmap, dummy);
}
virtual ~StaticFineAtoms()
= default;
~StaticFineAtoms()
override = default;
/** This adds atoms from dynamic atoms inserting new tree
* indices to the given tree and tracing the mapping from old
* atoms to new atoms in tmap. The ordering of the static
@ -102,7 +102,7 @@ namespace ogp
* variable is declared by inserting it to
* StaticAtoms::varnames, which is done with registering
* methods. This a responsibility of a subclass. */
int check_variable(const char *name) const;
int check_variable(const char *name) const override;
/** Return an (external) ordering of parameters. */
const vector<const char *> &
get_params() const
@ -128,7 +128,7 @@ namespace ogp
/** Return the atoms with respect to which we are going to
* differentiate. */
vector<int>
variables() const
variables() const override
{
return der_atoms;
}
@ -190,7 +190,7 @@ namespace ogp
* action. */
virtual void register_uniq_param(const char *name);
/** Debug print. */
void print() const;
void print() const override;
private:
/** Add endogenous variable name, which is already in the name
* storage. */

View File

@ -460,7 +460,7 @@ namespace ogp
{
}
/** Format the operation with the default syntax. */
void format(const Operation &op, int t, FILE *fd);
void format(const Operation &op, int t, FILE *fd) override;
/** This prints a string represenation of the given term, for
* example 'tmp10' for term 10. In this implementation it
* prints $10. */

View File

@ -24,12 +24,12 @@ class DynareNameList : public NameList
public:
DynareNameList(const Dynare &dynare);
int
getNum() const
getNum() const override
{
return (int) names.size();
}
const char *
getName(int i) const
getName(int i) const override
{
return names[i];
}
@ -45,12 +45,12 @@ class DynareExogNameList : public NameList
public:
DynareExogNameList(const Dynare &dynare);
int
getNum() const
getNum() const override
{
return (int) names.size();
}
const char *
getName(int i) const
getName(int i) const override
{
return names[i];
}
@ -63,12 +63,12 @@ public:
DynareStateNameList(const Dynare &dynare, const DynareNameList &dnl,
const DynareExogNameList &denl);
int
getNum() const
getNum() const override
{
return (int) names.size();
}
const char *
getName(int i) const
getName(int i) const override
{
return names[i];
}
@ -106,34 +106,34 @@ public:
/** Makes a deep copy of the object. */
Dynare(const Dynare &dyn);
DynamicModel *
clone() const
clone() const override
{
return new Dynare(*this);
}
virtual
~Dynare();
~Dynare() override;
int
nstat() const
nstat() const override
{
return model->getAtoms().nstat();
}
int
nboth() const
nboth() const override
{
return model->getAtoms().nboth();
}
int
npred() const
npred() const override
{
return model->getAtoms().npred();
}
int
nforw() const
nforw() const override
{
return model->getAtoms().nforw();
}
int
nexog() const
nexog() const override
{
return model->getAtoms().nexo();
}
@ -153,23 +153,23 @@ public:
return model->getAtoms().ny();
}
int
order() const
order() const override
{
return model->getOrder();
}
const NameList &
getAllEndoNames() const
getAllEndoNames() const override
{
return *dnl;
}
const NameList &
getStateNames() const
getStateNames() const override
{
return *dsnl;
}
const NameList &
getExogNames() const
getExogNames() const override
{
return *denl;
}
@ -180,7 +180,7 @@ public:
return model->getVcov();
}
const TwoDMatrix &
getVcov() const
getVcov() const override
{
return model->getVcov();
}
@ -201,17 +201,17 @@ public:
}
const TensorContainer<FSSparseTensor> &
getModelDerivatives() const
getModelDerivatives() const override
{
return md;
}
const Vector &
getSteady() const
getSteady() const override
{
return *ysteady;
}
Vector &
getSteady()
getSteady() override
{
return *ysteady;
}
@ -224,15 +224,15 @@ public:
// here is true public interface
void solveDeterministicSteady(Vector &steady);
void
solveDeterministicSteady()
solveDeterministicSteady() override
{
solveDeterministicSteady(*ysteady);
}
void evaluateSystem(Vector &out, const Vector &yy, const Vector &xx);
void evaluateSystem(Vector &out, const Vector &yy, const Vector &xx) override;
void evaluateSystem(Vector &out, const Vector &yym, const Vector &yy,
const Vector &yyp, const Vector &xx);
const Vector &yyp, const Vector &xx) override;
void calcDerivatives(const Vector &yy, const Vector &xx);
void calcDerivativesAtSteady();
void calcDerivativesAtSteady() override;
void writeMat(mat_t *fd, const char *prefix) const;
void writeDump(const std::string &basename) const;
@ -245,7 +245,7 @@ class DynareEvalLoader : public ogp::FormulaEvalLoader, public Vector
public:
DynareEvalLoader(const ogp::FineAtoms &a, Vector &out);
void
load(int i, double res)
load(int i, double res) override
{
operator[](i) = res;
}
@ -259,7 +259,7 @@ protected:
public:
DynareDerEvalLoader(const ogp::FineAtoms &a, TensorContainer<FSSparseTensor> &mod_ders,
int order);
void load(int i, int iord, const int *vars, double res);
void load(int i, int iord, const int *vars, double res) override;
};
class DynareJacobian : public ogu::Jacobian, public ogp::FormulaDerEvalLoader
@ -268,10 +268,10 @@ protected:
Dynare &d;
public:
DynareJacobian(Dynare &dyn);
virtual ~DynareJacobian()
= default;
void load(int i, int iord, const int *vars, double res);
void eval(const Vector &in);
~DynareJacobian()
override = default;
void load(int i, int iord, const int *vars, double res) override;
void eval(const Vector &in) override;
};
class DynareVectorFunction : public ogu::VectorFunction
@ -283,19 +283,19 @@ public:
: d(dyn)
{
}
virtual ~DynareVectorFunction()
= default;
~DynareVectorFunction()
override = default;
int
inDim() const
inDim() const override
{
return d.ny();
}
int
outDim() const
outDim() const override
{
return d.ny();
}
void eval(const ConstVector &in, Vector &out);
void eval(const ConstVector &in, Vector &out) override;
};
#endif

View File

@ -36,17 +36,17 @@ namespace ogdyn
DynareStaticAtoms(const DynareStaticAtoms &a)
= default;
virtual ~DynareStaticAtoms()
= default;
~DynareStaticAtoms()
override = default;
/** This registers a unique varname identifier. It throws an
* exception if the variable name is duplicate. It checks the
* uniqueness and then it calls StaticAtoms::register_name. */
void register_name(const char *name);
void register_name(const char *name) override;
protected:
/** This returns a tree index of the given variable, and if
* the variable has not been registered, it throws an
* exception. */
int check_variable(const char *name) const;
int check_variable(const char *name) const override;
};
class DynareDynamicAtoms : public ogp::SAtoms, public ogp::NularyStringConvertor
@ -63,24 +63,24 @@ namespace ogdyn
{
}
DynareDynamicAtoms(const DynareDynamicAtoms &dda);
virtual ~DynareDynamicAtoms()
= default;
~DynareDynamicAtoms()
override = default;
/** This parses a variable of the forms: varname(+3),
* varname(3), varname, varname(-3), varname(0), varname(+0),
* varname(-0). */
virtual void parse_variable(const char *in, std::string &out, int &ll) const;
void parse_variable(const char *in, std::string &out, int &ll) const override;
/** Registers unique name of endogenous variable. */
void register_uniq_endo(const char *name);
void register_uniq_endo(const char *name) override;
/** Registers unique name of exogenous variable. */
void register_uniq_exo(const char *name);
void register_uniq_exo(const char *name) override;
/** Registers unique name of parameter. */
void register_uniq_param(const char *name);
void register_uniq_param(const char *name) override;
/** Return true if the name is a given type. */
bool is_type(const char *name, atype tp) const;
/** Debug print. */
void print() const;
void print() const override;
/** Implement NularyStringConvertor::convert. */
std::string convert(int t) const;
std::string convert(int t) const override;
};
/** This class represents the atom values for dynare, where
@ -116,7 +116,7 @@ namespace ogdyn
: atoms(a), paramvals(pvals), yym(ym), yy(y), yyp(yp), xx(x)
{
}
void setValues(ogp::EvalTree &et) const;
void setValues(ogp::EvalTree &et) const override;
};
/** This class represents the atom values at the steady state. It
@ -144,7 +144,7 @@ namespace ogdyn
xx.zeros();
}
void
setValues(ogp::EvalTree &et) const
setValues(ogp::EvalTree &et) const override
{
av.setValues(et);
}
@ -177,7 +177,7 @@ namespace ogdyn
{
}
/** Set the values to the tree defined over the static atoms. */
void setValues(ogp::EvalTree &et) const;
void setValues(ogp::EvalTree &et) const override;
};
/** This class takes a vector of endogenous variables and a
@ -196,7 +196,7 @@ namespace ogdyn
DynareSteadySubstitutions(const ogp::FineAtoms &a, const ogp::OperationTree &tree,
const Tsubstmap &subst,
const Vector &pvals, Vector &yy);
void load(int i, double res);
void load(int i, double res) override;
protected:
Vector &y;
vector<const char *> left_hand_sides;
@ -219,7 +219,7 @@ namespace ogdyn
const ogp::OperationTree &tree,
const Tsubstmap &subst,
const Vector &pvals, Vector &yy);
void load(int i, double res);
void load(int i, double res) override;
protected:
Vector &y;
vector<const char *> left_hand_sides;

View File

@ -257,10 +257,10 @@ namespace ogdyn
* in the model file. */
DynareParser(const char *str, int len, int ord);
DynareParser(const DynareParser &p);
virtual
~DynareParser();
~DynareParser() override;
DynareModel *
clone() const
clone() const override
{
return new DynareParser(*this);
}
@ -364,9 +364,9 @@ namespace ogdyn
= default;
~DynareSPModel()
= default;
virtual DynareModel *
clone() const
override = default;
DynareModel *
clone() const override
{
return new DynareSPModel(*this);
}
@ -384,7 +384,7 @@ namespace ogdyn
NLSelector(const DynareModel &m) : model(m)
{
}
bool operator()(int t) const;
bool operator()(int t) const override;
};
/** This class writes a mathematical code evaluating the system of
@ -426,27 +426,27 @@ namespace ogdyn
char *id;
public:
MatlabSSWriter(const DynareModel &dm, const char *idd);
virtual ~MatlabSSWriter()
~MatlabSSWriter() override
{
delete [] id;
}
protected:
// from ModelSSWriter
void write_der0_preamble(FILE *fd) const;
void write_der1_preamble(FILE *fd) const;
void write_der0_preamble(FILE *fd) const override;
void write_der1_preamble(FILE *fd) const override;
/** This writes atom assignments. We have four kinds of atoms
* set here: endogenous vars coming from one parameter,
* parameter values given by the second parameter, constants,
* and the OperationTree::num_constants hardwired constants in
* ogp::OperationTree. */
void write_atom_assignment(FILE *fd) const;
void write_der0_assignment(FILE *fd) const;
void write_der1_assignment(FILE *fd) const;
void write_atom_assignment(FILE *fd) const override;
void write_der0_assignment(FILE *fd) const override;
void write_der1_assignment(FILE *fd) const override;
/** This prints t10 for t=10. */
void format_term(int t, FILE *fd) const;
void format_term(int t, FILE *fd) const override;
/** This prints a10 for t=10. The atoms a10 are supposed to be
* set by write_atom_assignments(). */
void format_nulary(int t, FILE *fd) const;
void format_nulary(int t, FILE *fd) const override;
private:
void write_common1_preamble(FILE *fd) const;
void write_common2_preamble(FILE *fd) const;
@ -465,7 +465,7 @@ namespace ogdyn
model(m)
{
}
void format_nulary(int t, FILE *fd) const;
void format_nulary(int t, FILE *fd) const override;
};
};

View File

@ -64,8 +64,8 @@ namespace ogu
: TwoDMatrix(n, n)
{
}
virtual ~Jacobian()
= default;
~Jacobian()
override = default;
virtual void eval(const Vector &in) = 0;
};
@ -88,8 +88,8 @@ namespace ogu
{
xnewton.zeros(); xcauchy.zeros(); x.zeros();
}
virtual ~NLSolver()
= default;
~NLSolver()
override = default;
/** Returns true if the problem has converged. xx as input is the
* starting value, as output it is a solution. */
bool solve(Vector &xx, int &iter);
@ -97,7 +97,7 @@ namespace ogu
* func(xx)^T*func(xx), where
* xx=x+lambda*xcauchy+(1-lambda)*xnewton. It is non-const only
* because it calls func, x, xnewton, xcauchy is not changed. */
double eval(double lambda);
double eval(double lambda) override;
};
};

View File

@ -315,7 +315,7 @@ namespace ogdyn
* builder.diff_f_save have been put the the
* ogp::FormulaCustomEvaluator. This is documented in the code
* of the constructor. */
void load(int i, double res);
void load(int i, double res) override;
};
};

View File

@ -22,7 +22,7 @@ public:
GeneralMatrix::operator=(t); return *this;
}
const BlockDiagonal &operator=(const BlockDiagonal &b);
~BlockDiagonal()
~BlockDiagonal() override
{
delete [] row_len; delete [] col_len;
}
@ -32,15 +32,15 @@ public:
int getLargestBlock() const;
void printInfo() const;
void multKron(KronVector &x) const;
void multKronTrans(KronVector &x) const;
void multKron(KronVector &x) const override;
void multKronTrans(KronVector &x) const override;
const_col_iter col_begin(const DiagonalBlock &b) const;
col_iter col_begin(const DiagonalBlock &b);
const_row_iter row_end(const DiagonalBlock &b) const;
row_iter row_end(const DiagonalBlock &b);
const_col_iter col_begin(const DiagonalBlock &b) const override;
col_iter col_begin(const DiagonalBlock &b) override;
const_row_iter row_end(const DiagonalBlock &b) const override;
row_iter row_end(const DiagonalBlock &b) override;
QuasiTriangular *
clone() const
clone() const override
{
return new BlockDiagonal(*this);
}

View File

@ -25,7 +25,7 @@ public:
: SylvesterSolver(kdecomp, fdecomp)
{
}
void solve(SylvParams &pars, KronVector &x) const;
void solve(SylvParams &pars, KronVector &x) const override;
private:
double performFirstStep(KronVector &x) const;
static double performStep(const QuasiTriangular &k, const QuasiTriangular &f,

View File

@ -332,7 +332,7 @@ public:
{
};
_Self &
operator++()
operator++() override
{
_Tparent::ptr++; row++; return *this;
}
@ -367,7 +367,7 @@ public:
{
};
_Self &
operator++()
operator++() override
{
_Tparent::ptr += _Tparent::d_size; col++; return *this;
}
@ -413,8 +413,8 @@ public:
QuasiTriangular(const SchurDecomp &decomp);
QuasiTriangular(const SchurDecompZero &decomp);
QuasiTriangular(const QuasiTriangular &t);
virtual
~QuasiTriangular();
~QuasiTriangular() override;
const Diagonal &
getDiagonal() const
{

View File

@ -20,38 +20,38 @@ public:
QuasiTriangularZero(int p, const QuasiTriangularZero &t);
QuasiTriangularZero(const QuasiTriangular &t);
QuasiTriangularZero(const SchurDecompZero &decomp);
~QuasiTriangularZero();
void solvePre(Vector &x, double &eig_min);
void solvePreTrans(Vector &x, double &eig_min);
void multVec(Vector &x, const ConstVector &b) const;
void multVecTrans(Vector &x, const ConstVector &b) const;
void multaVec(Vector &x, const ConstVector &b) const;
void multaVecTrans(Vector &x, const ConstVector &b) const;
void multKron(KronVector &x) const;
void multKronTrans(KronVector &x) const;
void multLeftOther(GeneralMatrix &a) const;
~QuasiTriangularZero() override;
void solvePre(Vector &x, double &eig_min) override;
void solvePreTrans(Vector &x, double &eig_min) override;
void multVec(Vector &x, const ConstVector &b) const override;
void multVecTrans(Vector &x, const ConstVector &b) const override;
void multaVec(Vector &x, const ConstVector &b) const override;
void multaVecTrans(Vector &x, const ConstVector &b) const override;
void multKron(KronVector &x) const override;
void multKronTrans(KronVector &x) const override;
void multLeftOther(GeneralMatrix &a) const override;
/* clone */
virtual QuasiTriangular *
clone() const
QuasiTriangular *
clone() const override
{
return new QuasiTriangularZero(*this);
}
virtual QuasiTriangular *
clone(int p, const QuasiTriangular &t) const
QuasiTriangular *
clone(int p, const QuasiTriangular &t) const override
{
return new QuasiTriangularZero(p, (const QuasiTriangularZero &) t);
}
virtual QuasiTriangular *
clone(double r) const
QuasiTriangular *
clone(double r) const override
{
return new QuasiTriangularZero(r, *this);
}
virtual QuasiTriangular *
clone(double r, double rr, const QuasiTriangular &tt) const
QuasiTriangular *
clone(double r, double rr, const QuasiTriangular &tt) const override
{
return new QuasiTriangularZero(r, *this, rr, (const QuasiTriangularZero &) tt);
}
void print() const;
void print() const override;
};
#endif /* QUASI_TRIANGULAR_ZERO_H */

View File

@ -54,7 +54,7 @@ public:
{
return ru;
}
int getDim() const;
int getDim() const override;
int
getZeroCols() const
{

View File

@ -26,7 +26,7 @@ class SylvExceptionMessage : public SylvException
char message[500];
public:
SylvExceptionMessage(const char *f, int l, const char *mes);
virtual int printMessage(char *str, int maxlen) const;
int printMessage(char *str, int maxlen) const override;
};
// define macros:

View File

@ -19,10 +19,10 @@ public:
TriangularSylvester(const QuasiTriangular &k, const QuasiTriangular &f);
TriangularSylvester(const SchurDecompZero &kdecomp, const SchurDecomp &fdecomp);
TriangularSylvester(const SchurDecompZero &kdecomp, const SimilarityDecomp &fdecomp);
virtual
~TriangularSylvester();
~TriangularSylvester() override;
void print() const;
void solve(SylvParams &pars, KronVector &d) const;
void solve(SylvParams &pars, KronVector &d) const override;
void solvi(double r, KronVector &d, double &eig_min) const;
void solvii(double alpha, double beta1, double beta2,

View File

@ -537,7 +537,7 @@ public:
PureTriangTest() : TestRunnable("pure triangular solve (5)")
{
}
bool run() const;
bool run() const override;
};
class PureTriangTransTest : public TestRunnable
@ -546,7 +546,7 @@ public:
PureTriangTransTest() : TestRunnable("pure triangular solve trans (5)")
{
}
bool run() const;
bool run() const override;
};
class PureTrLargeTest : public TestRunnable
@ -555,7 +555,7 @@ public:
PureTrLargeTest() : TestRunnable("pure triangular large solve (300)")
{
}
bool run() const;
bool run() const override;
};
class PureTrLargeTransTest : public TestRunnable
@ -564,7 +564,7 @@ public:
PureTrLargeTransTest() : TestRunnable("pure triangular large solve trans (300)")
{
}
bool run() const;
bool run() const override;
};
class QuasiTriangTest : public TestRunnable
@ -573,7 +573,7 @@ public:
QuasiTriangTest() : TestRunnable("quasi triangular solve (7)")
{
}
bool run() const;
bool run() const override;
};
class QuasiTriangTransTest : public TestRunnable
@ -582,7 +582,7 @@ public:
QuasiTriangTransTest() : TestRunnable("quasi triangular solve trans (7)")
{
}
bool run() const;
bool run() const override;
};
class QuasiTrLargeTest : public TestRunnable
@ -591,7 +591,7 @@ public:
QuasiTrLargeTest() : TestRunnable("quasi triangular solve large (250)")
{
}
bool run() const;
bool run() const override;
};
class QuasiTrLargeTransTest : public TestRunnable
@ -600,7 +600,7 @@ public:
QuasiTrLargeTransTest() : TestRunnable("quasi triangular solve large trans (250)")
{
}
bool run() const;
bool run() const override;
};
class QuasiZeroSmallTest : public TestRunnable
@ -609,7 +609,7 @@ public:
QuasiZeroSmallTest() : TestRunnable("quasi tr. zero small test (2x1)")
{
}
bool run() const;
bool run() const override;
};
class MultKronSmallTest : public TestRunnable
@ -618,7 +618,7 @@ public:
MultKronSmallTest() : TestRunnable("kronecker small mult (2=2x1)")
{
}
bool run() const;
bool run() const override;
};
class MultKronTest : public TestRunnable
@ -627,7 +627,7 @@ public:
MultKronTest() : TestRunnable("kronecker mult (245=7x7x5)")
{
}
bool run() const;
bool run() const override;
};
class MultKronSmallTransTest : public TestRunnable
@ -636,7 +636,7 @@ public:
MultKronSmallTransTest() : TestRunnable("kronecker small trans mult (2=2x1)")
{
}
bool run() const;
bool run() const override;
};
class MultKronTransTest : public TestRunnable
@ -645,7 +645,7 @@ public:
MultKronTransTest() : TestRunnable("kronecker trans mult (245=7x7x5)")
{
}
bool run() const;
bool run() const override;
};
class LevelKronTest : public TestRunnable
@ -654,7 +654,7 @@ public:
LevelKronTest() : TestRunnable("kronecker level mult (1715=7x[7]x7x5)")
{
}
bool run() const;
bool run() const override;
};
class LevelKronTransTest : public TestRunnable
@ -663,7 +663,7 @@ public:
LevelKronTransTest() : TestRunnable("kronecker level trans mult (1715=7x[7]x7x5)")
{
}
bool run() const;
bool run() const override;
};
class LevelZeroKronTest : public TestRunnable
@ -672,7 +672,7 @@ public:
LevelZeroKronTest() : TestRunnable("kronecker level mult (1715=7x7x7x[5])")
{
}
bool run() const;
bool run() const override;
};
class LevelZeroKronTransTest : public TestRunnable
@ -681,7 +681,7 @@ public:
LevelZeroKronTransTest() : TestRunnable("kronecker level trans mult (1715=7x7x7x[5])")
{
}
bool run() const;
bool run() const override;
};
class KronPowerTest : public TestRunnable
@ -690,7 +690,7 @@ public:
KronPowerTest() : TestRunnable("kronecker power mult (1715=7x7x7x5)")
{
}
bool run() const;
bool run() const override;
};
class SmallLinEvalTest : public TestRunnable
@ -699,7 +699,7 @@ public:
SmallLinEvalTest() : TestRunnable("lin eval (24=2 x 2x2x3)")
{
}
bool run() const;
bool run() const override;
};
class LinEvalTest : public TestRunnable
@ -708,7 +708,7 @@ public:
LinEvalTest() : TestRunnable("lin eval (490=2 x 7x7x5)")
{
}
bool run() const;
bool run() const override;
};
class SmallQuaEvalTest : public TestRunnable
@ -717,7 +717,7 @@ public:
SmallQuaEvalTest() : TestRunnable("qua eval (24=2 x 2x2x3)")
{
}
bool run() const;
bool run() const override;
};
class QuaEvalTest : public TestRunnable
@ -726,7 +726,7 @@ public:
QuaEvalTest() : TestRunnable("qua eval (490=2 x 7x7x5)")
{
}
bool run() const;
bool run() const override;
};
class TriSylvSmallRealTest : public TestRunnable
@ -735,7 +735,7 @@ public:
TriSylvSmallRealTest() : TestRunnable("triangular sylvester small real solve (12=2x2x3)")
{
}
bool run() const;
bool run() const override;
};
class TriSylvSmallComplexTest : public TestRunnable
@ -744,7 +744,7 @@ public:
TriSylvSmallComplexTest() : TestRunnable("triangular sylvester small complx solve (12=2x2x3)")
{
}
bool run() const;
bool run() const override;
};
class TriSylvTest : public TestRunnable
@ -753,7 +753,7 @@ public:
TriSylvTest() : TestRunnable("triangular sylvester solve (245=7x7x5)")
{
}
bool run() const;
bool run() const override;
};
class TriSylvBigTest : public TestRunnable
@ -762,7 +762,7 @@ public:
TriSylvBigTest() : TestRunnable("triangular sylvester big solve (48000=40x40x30)")
{
}
bool run() const;
bool run() const override;
};
class TriSylvLargeTest : public TestRunnable
@ -771,7 +771,7 @@ public:
TriSylvLargeTest() : TestRunnable("triangular sylvester large solve (1920000=40x40x40x30)")
{
}
bool run() const;
bool run() const override;
};
class IterSylvTest : public TestRunnable
@ -780,7 +780,7 @@ public:
IterSylvTest() : TestRunnable("iterative sylvester solve (245=7x7x5)")
{
}
bool run() const;
bool run() const override;
};
class IterSylvLargeTest : public TestRunnable
@ -789,7 +789,7 @@ public:
IterSylvLargeTest() : TestRunnable("iterative sylvester large solve (1920000=40x40x40x30)")
{
}
bool run() const;
bool run() const override;
};
class GenSylvSmallTest : public TestRunnable
@ -798,7 +798,7 @@ public:
GenSylvSmallTest() : TestRunnable("general sylvester small solve (18=3x3x2)")
{
}
bool run() const;
bool run() const override;
};
class GenSylvTest : public TestRunnable
@ -807,7 +807,7 @@ public:
GenSylvTest() : TestRunnable("general sylvester solve (12000=20x20x30)")
{
}
bool run() const;
bool run() const override;
};
class GenSylvSingTest : public TestRunnable
@ -816,7 +816,7 @@ public:
GenSylvSingTest() : TestRunnable("general sylvester solve for sing. C (2500000=50x50x50x20)")
{
}
bool run() const;
bool run() const override;
};
class GenSylvLargeTest : public TestRunnable
@ -825,7 +825,7 @@ public:
GenSylvLargeTest() : TestRunnable("general sylvester solve (2500000=50x50x50x20)")
{
}
bool run() const;
bool run() const override;
};
class EigBubFrankTest : public TestRunnable
@ -834,7 +834,7 @@ public:
EigBubFrankTest() : TestRunnable("eig. bubble frank test (12x12)")
{
}
bool run() const;
bool run() const override;
};
class EigBubSplitTest : public TestRunnable
@ -844,7 +844,7 @@ public:
EigBubSplitTest() : TestRunnable("eig. bubble complex split test (3x3)")
{
}
bool run() const;
bool run() const override;
};
class EigBubSameTest : public TestRunnable
@ -854,7 +854,7 @@ public:
EigBubSameTest() : TestRunnable("eig. bubble same test (5x5)")
{
}
bool run() const;
bool run() const override;
};
class BlockDiagSmallTest : public TestRunnable
@ -863,7 +863,7 @@ public:
BlockDiagSmallTest() : TestRunnable("block diagonalization small test (7x7)")
{
}
bool run() const;
bool run() const override;
};
class BlockDiagFrankTest : public TestRunnable
@ -872,7 +872,7 @@ public:
BlockDiagFrankTest() : TestRunnable("block diagonalization of frank (12x12)")
{
}
bool run() const;
bool run() const override;
};
class BlockDiagIllCondTest : public TestRunnable
@ -881,7 +881,7 @@ public:
BlockDiagIllCondTest() : TestRunnable("block diagonalization of ill conditioned (15x15)")
{
}
bool run() const;
bool run() const override;
};
class BlockDiagBigTest : public TestRunnable
@ -890,7 +890,7 @@ public:
BlockDiagBigTest() : TestRunnable("block diagonalization big test (50x50)")
{
}
bool run() const;
bool run() const override;
};
/**********************************************************/

View File

@ -125,14 +125,14 @@ public:
/* Here we deallocate the refined containers, and deallocate the array of
refined containers. */
virtual ~FineContainer()
~FineContainer() override
{
for (int i = 0; i < _Stype::numConts(); i++)
delete ref_conts[i];
delete [] ref_conts;
}
itype
getType(int i, const Symmetry &s) const
getType(int i, const Symmetry &s) const override
{
return stack_cont.getType(getOldIndex(i), s);
}

View File

@ -67,16 +67,16 @@ public:
{
}
void increment(IntSequence &v) const;
void decrement(IntSequence &v) const;
UTensor&unfold() const;
void increment(IntSequence &v) const override;
void decrement(IntSequence &v) const override;
UTensor&unfold() const override;
Symmetry
getSym() const
{
return Symmetry(dimen());
}
int getOffset(const IntSequence &v) const;
int getOffset(const IntSequence &v) const override;
void addSubTensor(const FGSTensor &t);
int
nvar() const
@ -111,16 +111,16 @@ public:
{
}
void increment(IntSequence &v) const;
void decrement(IntSequence &v) const;
FTensor&fold() const;
void increment(IntSequence &v) const override;
void decrement(IntSequence &v) const override;
FTensor&fold() const override;
Symmetry
getSym() const
{
return Symmetry(dimen());
}
int getOffset(const IntSequence &v) const;
int getOffset(const IntSequence &v) const override;
void addSubTensor(const UGSTensor &t);
int
nvar() const

View File

@ -169,16 +169,16 @@ public:
{
}
virtual ~FGSTensor()
= default;
~FGSTensor()
override = default;
void increment(IntSequence &v) const;
void increment(IntSequence &v) const override;
void
decrement(IntSequence &v) const
decrement(IntSequence &v) const override
{
tdims.decrement(v);
}
UTensor&unfold() const;
UTensor&unfold() const override;
const TensorDimens &
getDims() const
{
@ -193,7 +193,7 @@ public:
void contractAndAdd(int i, FGSTensor &out,
const FRSingleTensor &col) const;
int
getOffset(const IntSequence &v) const
getOffset(const IntSequence &v) const override
{
return tdims.calcFoldOffset(v);
}
@ -237,12 +237,12 @@ public:
: UTensor(0, t.nrows(), t), tdims(t.nvar(), t.dimen())
{
}
virtual ~UGSTensor()
= default;
~UGSTensor()
override = default;
void increment(IntSequence &v) const;
void decrement(IntSequence &v) const;
FTensor&fold() const;
void increment(IntSequence &v) const override;
void decrement(IntSequence &v) const override;
FTensor&fold() const override;
const TensorDimens &
getDims() const
{
@ -256,7 +256,7 @@ public:
void contractAndAdd(int i, UGSTensor &out,
const URSingleTensor &col) const;
int getOffset(const IntSequence &v) const;
int getOffset(const IntSequence &v) const override;
private:
void unfoldData();
public:

View File

@ -224,7 +224,7 @@ public:
: KronProd(dim), matlist(new const TwoDMatrix *[dim])
{
}
virtual ~KronProdAll()
~KronProdAll() override
{
delete [] matlist;
}
@ -236,7 +236,7 @@ public:
return *(matlist[i]);
}
void mult(const ConstTwoDMatrix &in, TwoDMatrix &out) const;
void mult(const ConstTwoDMatrix &in, TwoDMatrix &out) const override;
Vector *multRows(const IntSequence &irows) const;
private:
bool isUnit() const;
@ -301,7 +301,7 @@ public:
mat(kpa.getMat(kpa.dimen()-1))
{
}
void mult(const ConstTwoDMatrix &in, TwoDMatrix &out) const;
void mult(const ConstTwoDMatrix &in, TwoDMatrix &out) const override;
};
/* This class represents $A\otimes I$. We have only one reference to
@ -320,7 +320,7 @@ public:
}
KronProdAI(const KronProdIAI &kpiai);
void mult(const ConstTwoDMatrix &in, TwoDMatrix &out) const;
void mult(const ConstTwoDMatrix &in, TwoDMatrix &out) const override;
};
/* This class represents $I\otimes A\otimes I$. We have only one reference to
@ -337,7 +337,7 @@ public:
mat(kpa.getMat(i))
{
}
void mult(const ConstTwoDMatrix &in, TwoDMatrix &out) const;
void mult(const ConstTwoDMatrix &in, TwoDMatrix &out) const override;
};
#endif

View File

@ -204,11 +204,11 @@ public:
= default;
void increment(IntSequence &v) const;
void decrement(IntSequence &v) const;
FTensor&fold() const;
void increment(IntSequence &v) const override;
void decrement(IntSequence &v) const override;
FTensor&fold() const override;
int getOffset(const IntSequence &v) const;
int getOffset(const IntSequence &v) const override;
void addTo(FGSTensor &out) const;
void addTo(UGSTensor &out) const;
@ -368,11 +368,11 @@ public:
= default;
void increment(IntSequence &v) const;
void decrement(IntSequence &v) const;
UTensor&unfold() const;
void increment(IntSequence &v) const override;
void decrement(IntSequence &v) const override;
UTensor&unfold() const override;
int getOffset(const IntSequence &v) const;
int getOffset(const IntSequence &v) const override;
void addTo(FGSTensor &out) const;
};

View File

@ -135,17 +135,17 @@ public:
IrregTensor(const IrregTensorHeader &h);
void addTo(FRSingleTensor &out) const;
void
increment(IntSequence &v) const
increment(IntSequence &v) const override
{
header.increment(v);
}
void
decrement(IntSequence &v) const
decrement(IntSequence &v) const override
{
TL_RAISE("Not implemented error in IrregTensor::decrement");
}
int
getOffset(const IntSequence &v) const
getOffset(const IntSequence &v) const override
{
TL_RAISE("Not implemented error in IrregTensor::getOffset"); return 0;
}

View File

@ -57,14 +57,14 @@ public:
= default;
URTensor(const FRTensor &ft);
virtual ~URTensor()
= default;
~URTensor()
override = default;
void increment(IntSequence &v) const;
void decrement(IntSequence &v) const;
FTensor&fold() const;
void increment(IntSequence &v) const override;
void decrement(IntSequence &v) const override;
FTensor&fold() const override;
int getOffset(const IntSequence &v) const;
int getOffset(const IntSequence &v) const override;
int
nvar() const
{
@ -93,12 +93,12 @@ public:
= default;
FRTensor(const URTensor &ut);
virtual ~FRTensor()
= default;
~FRTensor()
override = default;
void increment(IntSequence &v) const;
void decrement(IntSequence &v) const;
UTensor&unfold() const;
void increment(IntSequence &v) const override;
void decrement(IntSequence &v) const override;
UTensor&unfold() const override;
int
nvar() const
@ -106,7 +106,7 @@ public:
return nv;
}
int
getOffset(const IntSequence &v) const
getOffset(const IntSequence &v) const override
{
return FTensor::getOffset(v, nv);
}
@ -136,9 +136,9 @@ public:
URSingleTensor(const URSingleTensor &ut)
= default;
virtual ~URSingleTensor()
= default;
FTensor&fold() const;
~URSingleTensor()
override = default;
FTensor&fold() const override;
};
/* This class represents one column row-oriented tensor. The only way
@ -158,8 +158,8 @@ public:
FRSingleTensor(const FRSingleTensor &ft)
= default;
virtual ~FRSingleTensor()
= default;
~FRSingleTensor()
override = default;
};
#endif

View File

@ -138,7 +138,7 @@ public:
void insert(const IntSequence &s, int r, double c);
void multColumnAndAdd(const Tensor &t, Vector &v) const;
const Symmetry &
getSym() const
getSym() const override
{
return sym;
}
@ -169,7 +169,7 @@ public:
= default;
void insert(const IntSequence &s, int r, double c);
const Symmetry &
getSym() const
getSym() const override
{
return tdims.getSym();
}

View File

@ -148,48 +148,48 @@ public:
conts(new const _Ctype *[nc])
{
}
virtual ~StackContainer()
~StackContainer() override
{
delete [] conts;
}
const IntSequence &
getStackSizes() const
getStackSizes() const override
{
return stack_sizes;
}
IntSequence &
getStackSizes()
getStackSizes() override
{
return stack_sizes;
}
const IntSequence &
getStackOffsets() const
getStackOffsets() const override
{
return stack_offsets;
}
IntSequence &
getStackOffsets()
getStackOffsets() override
{
return stack_offsets;
}
int
numConts() const
numConts() const override
{
return num_conts;
}
const _Ctype *
getCont(int i) const
getCont(int i) const override
{
return conts[i];
}
virtual itype getType(int i, const Symmetry &s) const = 0;
itype getType(int i, const Symmetry &s) const override = 0;
int
numStacks() const
numStacks() const override
{
return stack_sizes.size();
}
bool
isZero(int i, const Symmetry &s) const
isZero(int i, const Symmetry &s) const override
{
TL_RAISE_IF(i < 0 || i >= numStacks(),
"Wrong index to stack in StackContainer::isZero.");
@ -198,7 +198,7 @@ public:
}
const _Ttype *
getMatrix(int i, const Symmetry &s) const
getMatrix(int i, const Symmetry &s) const override
{
TL_RAISE_IF(isZero(i, s) || getType(i, s) == _Stype::unit,
"Matrix is not returned in StackContainer::getMatrix");
@ -206,7 +206,7 @@ public:
}
int
getLengthOfMatrixStacks(const Symmetry &s) const
getLengthOfMatrixStacks(const Symmetry &s) const override
{
int res = 0;
int i = 0;
@ -216,7 +216,7 @@ public:
}
int
getUnitPos(const Symmetry &s) const
getUnitPos(const Symmetry &s) const override
{
if (s.dimen() != 1)
return -1;
@ -228,7 +228,7 @@ public:
Vector *
createPackedColumn(const Symmetry &s,
const IntSequence &coor, int &iu) const
const IntSequence &coor, int &iu) const override
{
TL_RAISE_IF(s.dimen() != coor.size(),
"Incompatible coordinates for symmetry in StackContainer::createPackedColumn");
@ -360,7 +360,7 @@ public:
file, how $z$ looks, and code is clear. */
itype
getType(int i, const Symmetry &s) const
getType(int i, const Symmetry &s) const override
{
if (i == 0)
return _Stype::matrix;
@ -443,7 +443,7 @@ public:
information. */
itype
getType(int i, const Symmetry &s) const
getType(int i, const Symmetry &s) const override
{
if (i == 0)
if (s[2] > 0 || s == Symmetry(0, 0, 0, 1))
@ -656,7 +656,7 @@ public:
const Symmetry &s,
const FGSContainer &dcontainer,
FGSTensor &outten);
void operator()();
void operator()() override;
};
class WorkerFoldMAASparse1 : public THREAD
@ -670,7 +670,7 @@ public:
WorkerFoldMAASparse1(const FoldedStackContainer &container,
const FSSparseTensor &ten,
FGSTensor &outten, const IntSequence &c);
void operator()();
void operator()() override;
};
class WorkerFoldMAASparse2 : public THREAD
@ -683,7 +683,7 @@ public:
WorkerFoldMAASparse2(const FoldedStackContainer &container,
const FSSparseTensor &ten,
FGSTensor &outten, const IntSequence &c);
void operator()();
void operator()() override;
};
class WorkerFoldMAASparse4 : public THREAD
@ -696,7 +696,7 @@ public:
WorkerFoldMAASparse4(const FoldedStackContainer &container,
const FSSparseTensor &ten,
FGSTensor &outten, const IntSequence &c);
void operator()();
void operator()() override;
};
class WorkerUnfoldMAADense : public THREAD
@ -710,7 +710,7 @@ public:
const Symmetry &s,
const UGSContainer &dcontainer,
UGSTensor &outten);
void operator()();
void operator()() override;
};
class WorkerUnfoldMAASparse1 : public THREAD
@ -724,7 +724,7 @@ public:
WorkerUnfoldMAASparse1(const UnfoldedStackContainer &container,
const FSSparseTensor &ten,
UGSTensor &outten, const IntSequence &c);
void operator()();
void operator()() override;
};
class WorkerUnfoldMAASparse2 : public THREAD
@ -737,7 +737,7 @@ public:
WorkerUnfoldMAASparse2(const UnfoldedStackContainer &container,
const FSSparseTensor &ten,
UGSTensor &outten, const IntSequence &c);
void operator()();
void operator()() override;
};
#endif

View File

@ -197,8 +197,8 @@ public:
dim(t.dim)
{
}
virtual ~Tensor()
= default;
~Tensor()
override = default;
virtual void increment(IntSequence &v) const = 0;
virtual void decrement(IntSequence &v) const = 0;
virtual int getOffset(const IntSequence &v) const = 0;
@ -252,8 +252,8 @@ public:
: Tensor(first_row, num, t)
{
}
virtual ~UTensor()
= default;
~UTensor()
override = default;
virtual FTensor&fold() const = 0;
static void increment(IntSequence &v, int nv);
@ -287,8 +287,8 @@ public:
: Tensor(first_row, num, t)
{
}
virtual ~FTensor()
= default;
~FTensor()
override = default;
virtual UTensor&unfold() const = 0;
static void decrement(IntSequence &v, int nv);

View File

@ -42,8 +42,8 @@ public:
: ConstGeneralMatrix(m, first_row, first_col, rows, cols)
{
}
virtual ~ConstTwoDMatrix()
= default;
~ConstTwoDMatrix()
override = default;
int
nrows() const
@ -115,8 +115,8 @@ public:
: GeneralMatrix(a, b)
{
}
virtual ~TwoDMatrix()
= default;
~TwoDMatrix()
override = default;
int
nrows() const

View File

@ -600,7 +600,7 @@ public:
{
}
bool
run() const
run() const override
{
Symmetry s(2, 3);
IntSequence nvs(2); nvs[0] = 4; nvs[1] = 2;
@ -616,7 +616,7 @@ public:
{
}
bool
run() const
run() const override
{
Symmetry s(2, 3);
IntSequence nvs(2); nvs[0] = 4; nvs[1] = 2;
@ -632,7 +632,7 @@ public:
{
}
bool
run() const
run() const override
{
Symmetry s(2, 3, 2);
IntSequence nvs(3); nvs[0] = 5; nvs[1] = 2; nvs[2] = 2;
@ -648,7 +648,7 @@ public:
{
}
bool
run() const
run() const override
{
Symmetry s(2, 3, 2);
IntSequence nvs(3); nvs[0] = 5; nvs[1] = 2; nvs[2] = 2;
@ -664,7 +664,7 @@ public:
{
}
bool
run() const
run() const override
{
Symmetry s(1, 1, 3);
IntSequence nvs(3); nvs[0] = 3; nvs[1] = 3; nvs[2] = 2;
@ -680,7 +680,7 @@ public:
{
}
bool
run() const
run() const override
{
Symmetry s(2, 3, 2);
IntSequence nvs(3); nvs[0] = 4; nvs[1] = 2; nvs[2] = 4;
@ -696,7 +696,7 @@ public:
{
}
bool
run() const
run() const override
{
Symmetry s(1, 1, 3);
IntSequence nvs(3); nvs[0] = 3; nvs[1] = 3; nvs[2] = 2;
@ -712,7 +712,7 @@ public:
{
}
bool
run() const
run() const override
{
Symmetry s(2, 3, 2);
IntSequence nvs(3); nvs[0] = 4; nvs[1] = 2; nvs[2] = 4;
@ -728,7 +728,7 @@ public:
{
}
bool
run() const
run() const override
{
Symmetry s(2, 3);
IntSequence nvs(2); nvs[0] = 4; nvs[1] = 2;
@ -744,7 +744,7 @@ public:
{
}
bool
run() const
run() const override
{
Symmetry s(2, 3);
IntSequence nvs(2); nvs[0] = 4; nvs[1] = 2;
@ -760,7 +760,7 @@ public:
{
}
bool
run() const
run() const override
{
Symmetry s(2, 3, 2);
IntSequence nvs(3); nvs[0] = 5; nvs[1] = 2; nvs[2] = 2;
@ -776,7 +776,7 @@ public:
{
}
bool
run() const
run() const override
{
Symmetry s(2, 3, 2);
IntSequence nvs(3); nvs[0] = 5; nvs[1] = 2; nvs[2] = 2;
@ -792,7 +792,7 @@ public:
{
}
bool
run() const
run() const override
{
return fs_fold_unfold(5, 4, 3);
}
@ -806,7 +806,7 @@ public:
{
}
bool
run() const
run() const override
{
Symmetry s(1, 2, 2);
IntSequence nvs(3); nvs[0] = 3; nvs[1] = 3; nvs[2] = 2;
@ -822,7 +822,7 @@ public:
{
}
bool
run() const
run() const override
{
return fs_fold_unfold(5, 9, 4);
}
@ -836,7 +836,7 @@ public:
{
}
bool
run() const
run() const override
{
Symmetry s(2, 1, 2);
IntSequence nvs(3); nvs[0] = 6; nvs[1] = 2; nvs[2] = 6;
@ -852,7 +852,7 @@ public:
{
}
bool
run() const
run() const override
{
return r_fold_unfold(5, 3, 3);
}
@ -866,7 +866,7 @@ public:
{
}
bool
run() const
run() const override
{
return r_fold_unfold(5, 6, 5);
}
@ -880,7 +880,7 @@ public:
{
}
bool
run() const
run() const override
{
IntSequence bnvs(2); bnvs[0] = 3; bnvs[1] = 2;
return dense_prod(Symmetry(1, 2), bnvs, 2, 3, 2);
@ -895,7 +895,7 @@ public:
{
}
bool
run() const
run() const override
{
IntSequence bnvs(2); bnvs[0] = 10; bnvs[1] = 7;
return dense_prod(Symmetry(2, 3), bnvs, 3, 15, 10);
@ -910,7 +910,7 @@ public:
{
}
bool
run() const
run() const override
{
IntSequence bnvs(2); bnvs[0] = 13; bnvs[1] = 11;
return dense_prod(Symmetry(3, 2), bnvs, 3, 20, 20);
@ -925,7 +925,7 @@ public:
{
}
bool
run() const
run() const override
{
return folded_monomial(10, 4, 5, 3, 4);
}
@ -939,7 +939,7 @@ public:
{
}
bool
run() const
run() const override
{
return folded_monomial(20, 12, 10, 5, 4);
}
@ -953,7 +953,7 @@ public:
{
}
bool
run() const
run() const override
{
return unfolded_monomial(10, 4, 5, 3, 4);
}
@ -967,7 +967,7 @@ public:
{
}
bool
run() const
run() const override
{
return unfolded_monomial(20, 12, 10, 5, 4);
}
@ -981,7 +981,7 @@ public:
{
}
bool
run() const
run() const override
{
return folded_contraction(5, 4, 3);
}
@ -995,7 +995,7 @@ public:
{
}
bool
run() const
run() const override
{
return folded_contraction(20, 12, 5);
}
@ -1009,7 +1009,7 @@ public:
{
}
bool
run() const
run() const override
{
return unfolded_contraction(5, 4, 3);
}
@ -1023,7 +1023,7 @@ public:
{
}
bool
run() const
run() const override
{
return unfolded_contraction(20, 12, 5);
}
@ -1037,7 +1037,7 @@ public:
{
}
bool
run() const
run() const override
{
return poly_eval(4, 5, 4);
}
@ -1051,7 +1051,7 @@ public:
{
}
bool
run() const
run() const override
{
return poly_eval(244, 97, 2);
}
@ -1066,7 +1066,7 @@ public:
{
}
bool
run() const
run() const override
{
return fold_zcont(3, 2, 2, 1, 2, 2, 3);
}
@ -1081,7 +1081,7 @@ public:
{
}
bool
run() const
run() const override
{
return fold_zcont(13, 5, 7, 4, 6, 7, 4);
}
@ -1096,7 +1096,7 @@ public:
{
}
bool
run() const
run() const override
{
return unfold_zcont(3, 2, 2, 1, 2, 2, 3);
}
@ -1111,7 +1111,7 @@ public:
{
}
bool
run() const
run() const override
{
return unfold_zcont(13, 5, 7, 4, 6, 7, 4);
}