Reverts changes mistakenly added to commit f484942154
.
parent
f484942154
commit
fefccd4a1b
|
@ -110,8 +110,8 @@ extern "C" {
|
|||
dr(pol, PartitionY(nstat, npred, nboth, nforw),
|
||||
nexog, ConstVector{ysteady});
|
||||
// form the shock realization
|
||||
ConstTwoDMatrix shocks_mat(nexog, nper, ConstVector{shocks});
|
||||
ConstTwoDMatrix vcov_mat(nexog, nexog, ConstVector{vcov});
|
||||
TwoDMatrix shocks_mat(nexog, nper, ConstVector{shocks});
|
||||
TwoDMatrix vcov_mat(nexog, nexog, ConstVector{vcov});
|
||||
GenShockRealization sr(vcov_mat, shocks_mat, seed);
|
||||
// simulate and copy the results
|
||||
TwoDMatrix *res_mat
|
||||
|
|
|
@ -560,7 +560,7 @@ RTSimulationWorker::operator()()
|
|||
not work for semidefinite matrices. */
|
||||
|
||||
void
|
||||
RandomShockRealization::choleskyFactor(const ConstTwoDMatrix &v)
|
||||
RandomShockRealization::choleskyFactor(const TwoDMatrix &v)
|
||||
{
|
||||
factor = v;
|
||||
lapack_int rows = factor.nrows();
|
||||
|
@ -578,7 +578,7 @@ RandomShockRealization::choleskyFactor(const ConstTwoDMatrix &v)
|
|||
decomposition. It works for semidifinite matrices. */
|
||||
|
||||
void
|
||||
RandomShockRealization::schurFactor(const ConstTwoDMatrix &v)
|
||||
RandomShockRealization::schurFactor(const TwoDMatrix &v)
|
||||
{
|
||||
SymSchurDecomp ssd(v);
|
||||
ssd.getFactor(factor);
|
||||
|
|
|
@ -990,7 +990,7 @@ protected:
|
|||
MersenneTwister mtwister;
|
||||
TwoDMatrix factor;
|
||||
public:
|
||||
RandomShockRealization(const ConstTwoDMatrix &v, unsigned int iseed)
|
||||
RandomShockRealization(const TwoDMatrix &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 ConstTwoDMatrix &v);
|
||||
void schurFactor(const ConstTwoDMatrix &v);
|
||||
void choleskyFactor(const TwoDMatrix &v);
|
||||
void schurFactor(const TwoDMatrix &v);
|
||||
};
|
||||
|
||||
/* This is just a matrix of finite numbers. It can be constructed from
|
||||
|
@ -1019,6 +1019,10 @@ class ExplicitShockRealization : virtual public ShockRealization
|
|||
{
|
||||
TwoDMatrix shocks;
|
||||
public:
|
||||
ExplicitShockRealization(const TwoDMatrix &sh)
|
||||
: shocks(sh)
|
||||
{
|
||||
}
|
||||
ExplicitShockRealization(const ConstTwoDMatrix &sh)
|
||||
: shocks(sh)
|
||||
{
|
||||
|
@ -1059,7 +1063,7 @@ public:
|
|||
class GenShockRealization : public RandomShockRealization, public ExplicitShockRealization
|
||||
{
|
||||
public:
|
||||
GenShockRealization(const ConstTwoDMatrix &v, const ConstTwoDMatrix &sh, int seed)
|
||||
GenShockRealization(const TwoDMatrix &v, const TwoDMatrix &sh, int seed)
|
||||
: RandomShockRealization(v, seed), ExplicitShockRealization(sh)
|
||||
{
|
||||
KORD_RAISE_IF(sh.nrows() != v.nrows() || v.nrows() != v.ncols(),
|
||||
|
|
|
@ -54,13 +54,6 @@ 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)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue