Update dseries submodule

time-shift
Sébastien Villemot 2019-01-22 18:10:16 +01:00
parent c711d34d1d
commit f484942154
No known key found for this signature in database
GPG Key ID: 2CECE9350ECEBE4A
5 changed files with 16 additions and 13 deletions

View File

@ -110,8 +110,8 @@ extern "C" {
dr(pol, PartitionY(nstat, npred, nboth, nforw),
nexog, ConstVector{ysteady});
// form the shock realization
TwoDMatrix shocks_mat(nexog, nper, ConstVector{shocks});
TwoDMatrix vcov_mat(nexog, nexog, ConstVector{vcov});
ConstTwoDMatrix shocks_mat(nexog, nper, ConstVector{shocks});
ConstTwoDMatrix vcov_mat(nexog, nexog, ConstVector{vcov});
GenShockRealization sr(vcov_mat, shocks_mat, seed);
// simulate and copy the results
TwoDMatrix *res_mat

View File

@ -560,7 +560,7 @@ RTSimulationWorker::operator()()
not work for semidefinite matrices. */
void
RandomShockRealization::choleskyFactor(const TwoDMatrix &v)
RandomShockRealization::choleskyFactor(const ConstTwoDMatrix &v)
{
factor = v;
lapack_int rows = factor.nrows();
@ -578,7 +578,7 @@ RandomShockRealization::choleskyFactor(const TwoDMatrix &v)
decomposition. It works for semidifinite matrices. */
void
RandomShockRealization::schurFactor(const TwoDMatrix &v)
RandomShockRealization::schurFactor(const ConstTwoDMatrix &v)
{
SymSchurDecomp ssd(v);
ssd.getFactor(factor);

View File

@ -990,7 +990,7 @@ protected:
MersenneTwister mtwister;
TwoDMatrix factor;
public:
RandomShockRealization(const TwoDMatrix &v, unsigned int iseed)
RandomShockRealization(const ConstTwoDMatrix &v, unsigned int iseed)
: mtwister(iseed), factor(v.nrows(), v.nrows())
{
schurFactor(v);
@ -1008,8 +1008,8 @@ public:
return factor.nrows();
}
protected:
void choleskyFactor(const TwoDMatrix &v);
void schurFactor(const TwoDMatrix &v);
void choleskyFactor(const ConstTwoDMatrix &v);
void schurFactor(const ConstTwoDMatrix &v);
};
/* This is just a matrix of finite numbers. It can be constructed from
@ -1019,10 +1019,6 @@ class ExplicitShockRealization : virtual public ShockRealization
{
TwoDMatrix shocks;
public:
ExplicitShockRealization(const TwoDMatrix &sh)
: shocks(sh)
{
}
ExplicitShockRealization(const ConstTwoDMatrix &sh)
: shocks(sh)
{
@ -1063,7 +1059,7 @@ public:
class GenShockRealization : public RandomShockRealization, public ExplicitShockRealization
{
public:
GenShockRealization(const TwoDMatrix &v, const TwoDMatrix &sh, int seed)
GenShockRealization(const ConstTwoDMatrix &v, const ConstTwoDMatrix &sh, int seed)
: RandomShockRealization(v, seed), ExplicitShockRealization(sh)
{
KORD_RAISE_IF(sh.nrows() != v.nrows() || v.nrows() != v.ncols(),

View File

@ -54,6 +54,13 @@ ConstTwoDMatrix::writeMat(mat_t *fd, const char *vname) const
delete[] data;
}
TwoDMatrix &
TwoDMatrix::operator=(const ConstTwoDMatrix &m)
{
GeneralMatrix::operator=(m);
return *this;
}
void
TwoDMatrix::copyRow(int from, int to)
{

@ -1 +1 @@
Subproject commit c51cfe6d2c6ecefcef63c1fe880062d9dcd959af
Subproject commit f19b093104ad25d76e1d089afabf4b4de1563478