clang-format configuration: set “PackConstructorInitializers: NextLine”
parent
7edf01a2a9
commit
c6a7801ba8
|
@ -19,6 +19,7 @@ BreakInheritanceList: AfterColon
|
||||||
Cpp11BracedListStyle: true
|
Cpp11BracedListStyle: true
|
||||||
DeriveLineEnding: false
|
DeriveLineEnding: false
|
||||||
IndentPPDirectives: AfterHash
|
IndentPPDirectives: AfterHash
|
||||||
|
PackConstructorInitializers: NextLine
|
||||||
PPIndentWidth: 1
|
PPIndentWidth: 1
|
||||||
PointerAlignment: Left
|
PointerAlignment: Left
|
||||||
SpaceAfterTemplateKeyword: false
|
SpaceAfterTemplateKeyword: false
|
||||||
|
|
|
@ -32,8 +32,7 @@
|
||||||
|
|
||||||
Evaluate::Evaluate(const filesystem::path& codfile, bool steady_state_arg,
|
Evaluate::Evaluate(const filesystem::path& codfile, bool steady_state_arg,
|
||||||
const BasicSymbolTable& symbol_table_arg) :
|
const BasicSymbolTable& symbol_table_arg) :
|
||||||
symbol_table {symbol_table_arg},
|
symbol_table {symbol_table_arg}, steady_state {steady_state_arg}
|
||||||
steady_state {steady_state_arg}
|
|
||||||
{
|
{
|
||||||
ifstream CompiledCode {codfile, ios::in | ios::binary | ios::ate};
|
ifstream CompiledCode {codfile, ios::in | ios::binary | ios::ate};
|
||||||
if (!CompiledCode.is_open())
|
if (!CompiledCode.is_open())
|
||||||
|
|
|
@ -42,9 +42,14 @@ Interpreter::Interpreter(Evaluate& evaluator_arg, double* params_arg, double* y_
|
||||||
const BasicSymbolTable& symbol_table_arg, int verbosity_arg) :
|
const BasicSymbolTable& symbol_table_arg, int verbosity_arg) :
|
||||||
symbol_table {symbol_table_arg},
|
symbol_table {symbol_table_arg},
|
||||||
steady_state {steady_state_arg},
|
steady_state {steady_state_arg},
|
||||||
block_decomposed {block_decomposed_arg}, evaluator {evaluator_arg},
|
block_decomposed {block_decomposed_arg},
|
||||||
minimal_solving_periods {minimal_solving_periods_arg}, y_size {y_size_arg}, y_kmin {y_kmin_arg},
|
evaluator {evaluator_arg},
|
||||||
y_kmax {y_kmax_arg}, periods {periods_arg}, verbosity {verbosity_arg}
|
minimal_solving_periods {minimal_solving_periods_arg},
|
||||||
|
y_size {y_size_arg},
|
||||||
|
y_kmin {y_kmin_arg},
|
||||||
|
y_kmax {y_kmax_arg},
|
||||||
|
periods {periods_arg},
|
||||||
|
verbosity {verbosity_arg}
|
||||||
{
|
{
|
||||||
pivotva = nullptr;
|
pivotva = nullptr;
|
||||||
mem_mngr.init_Mem();
|
mem_mngr.init_Mem();
|
||||||
|
|
|
@ -27,8 +27,8 @@ ApproximationWelfare::ApproximationWelfare(KordwDynare& w, double discount_facto
|
||||||
const FGSContainer& rule_ders_arg,
|
const FGSContainer& rule_ders_arg,
|
||||||
const FGSContainer& rule_ders_s_arg, Journal& j) :
|
const FGSContainer& rule_ders_s_arg, Journal& j) :
|
||||||
welfare {w},
|
welfare {w},
|
||||||
discount_factor(discount_factor_arg), nvs {welfare.getModel().nys(), welfare.getModel().nexog(),
|
discount_factor(discount_factor_arg),
|
||||||
welfare.getModel().nexog(), 1},
|
nvs {welfare.getModel().nys(), welfare.getModel().nexog(), welfare.getModel().nexog(), 1},
|
||||||
journal {j}
|
journal {j}
|
||||||
{
|
{
|
||||||
rule_ders = std::make_unique<FGSContainer>(rule_ders_arg);
|
rule_ders = std::make_unique<FGSContainer>(rule_ders_arg);
|
||||||
|
|
|
@ -27,8 +27,12 @@ KordwDynare::KordwDynare(KordpDynare& m, ConstVector& NNZD_arg, Journal& jr, Vec
|
||||||
std::unique_ptr<ObjectiveAC> objectiveFile_arg,
|
std::unique_ptr<ObjectiveAC> objectiveFile_arg,
|
||||||
const std::vector<int>& dr_order) :
|
const std::vector<int>& dr_order) :
|
||||||
model {m},
|
model {m},
|
||||||
NNZD {NNZD_arg}, journal {jr}, params {inParams},
|
NNZD {NNZD_arg},
|
||||||
resid(1), ud {1}, objectiveFile {std::move(objectiveFile_arg)}
|
journal {jr},
|
||||||
|
params {inParams},
|
||||||
|
resid(1),
|
||||||
|
ud {1},
|
||||||
|
objectiveFile {std::move(objectiveFile_arg)}
|
||||||
{
|
{
|
||||||
dynppToDyn = dr_order;
|
dynppToDyn = dr_order;
|
||||||
dynToDynpp.resize(model.ny());
|
dynToDynpp.resize(model.ny());
|
||||||
|
@ -309,11 +313,30 @@ KOrderWelfare::KOrderWelfare(int num_stat, int num_pred, int num_both, int num_f
|
||||||
const FGSContainer& g_arg, const FGSContainer& gs_arg,
|
const FGSContainer& g_arg, const FGSContainer& gs_arg,
|
||||||
const TwoDMatrix& v, Journal& jr) :
|
const TwoDMatrix& v, Journal& jr) :
|
||||||
ypart(num_stat, num_pred, num_both, num_forw),
|
ypart(num_stat, num_pred, num_both, num_forw),
|
||||||
ny(ypart.ny()), nu(nu), maxk(ucont.getMaxDim()),
|
ny(ypart.ny()),
|
||||||
order(ord), discount_factor {discount_factor}, nvs {ypart.nys(), nu, nu, 1}, _uU(4), _fU(4),
|
nu(nu),
|
||||||
_uW(4), _fW(4), _uWrond(4), _fWrond(4), _ug(4), _fg(g_arg), _ugs(4), _fgs(gs_arg),
|
maxk(ucont.getMaxDim()),
|
||||||
_uXstack(&_ug, ny), _fXstack(&_fg, ny), _uGstack(&_ugs, ypart.nys(), nu),
|
order(ord),
|
||||||
_fGstack(&_fgs, ypart.nys(), nu), _um(maxk, v), _fm(_um), u(ucont), journal(jr)
|
discount_factor {discount_factor},
|
||||||
|
nvs {ypart.nys(), nu, nu, 1},
|
||||||
|
_uU(4),
|
||||||
|
_fU(4),
|
||||||
|
_uW(4),
|
||||||
|
_fW(4),
|
||||||
|
_uWrond(4),
|
||||||
|
_fWrond(4),
|
||||||
|
_ug(4),
|
||||||
|
_fg(g_arg),
|
||||||
|
_ugs(4),
|
||||||
|
_fgs(gs_arg),
|
||||||
|
_uXstack(&_ug, ny),
|
||||||
|
_fXstack(&_fg, ny),
|
||||||
|
_uGstack(&_ugs, ypart.nys(), nu),
|
||||||
|
_fGstack(&_fgs, ypart.nys(), nu),
|
||||||
|
_um(maxk, v),
|
||||||
|
_fm(_um),
|
||||||
|
u(ucont),
|
||||||
|
journal(jr)
|
||||||
{
|
{
|
||||||
KORD_RAISE_IF(v.ncols() != nu, "Wrong number of columns of Vcov in KOrderWelfare constructor");
|
KORD_RAISE_IF(v.ncols() != nu, "Wrong number of columns of Vcov in KOrderWelfare constructor");
|
||||||
KORD_RAISE_IF(nu != v.nrows(), "Wrong number of rows of Vcov in KOrderWelfare constructor");
|
KORD_RAISE_IF(nu != v.nrows(), "Wrong number of rows of Vcov in KOrderWelfare constructor");
|
||||||
|
|
|
@ -33,11 +33,28 @@ KordpDynare::KordpDynare(const std::vector<std::string>& endo, const std::vector
|
||||||
std::unique_ptr<DynamicModelAC> dynamicModelFile_arg,
|
std::unique_ptr<DynamicModelAC> dynamicModelFile_arg,
|
||||||
const std::vector<int>& dr_order, const ConstTwoDMatrix& llincidence) :
|
const std::vector<int>& dr_order, const ConstTwoDMatrix& llincidence) :
|
||||||
nStat {nstat},
|
nStat {nstat},
|
||||||
nBoth {nboth}, nPred {npred}, nForw {nforw}, nExog {nexog}, nPar {npar}, nYs {npred + nboth},
|
nBoth {nboth},
|
||||||
nYss {nboth + nforw}, nY {nstat + npred + nboth + nforw}, nJcols {nExog + nY + nYs + nYss},
|
nPred {npred},
|
||||||
NNZD {nnzd}, nSteps {nsteps}, nOrder {norder}, journal {jr}, ySteady {ysteady},
|
nForw {nforw},
|
||||||
params {inParams}, vCov {vcov}, md {1}, dnl {endo}, denl {exo}, dsnl {*this, dnl, denl},
|
nExog {nexog},
|
||||||
ll_Incidence {llincidence}, dynamicModelFile {std::move(dynamicModelFile_arg)}
|
nPar {npar},
|
||||||
|
nYs {npred + nboth},
|
||||||
|
nYss {nboth + nforw},
|
||||||
|
nY {nstat + npred + nboth + nforw},
|
||||||
|
nJcols {nExog + nY + nYs + nYss},
|
||||||
|
NNZD {nnzd},
|
||||||
|
nSteps {nsteps},
|
||||||
|
nOrder {norder},
|
||||||
|
journal {jr},
|
||||||
|
ySteady {ysteady},
|
||||||
|
params {inParams},
|
||||||
|
vCov {vcov},
|
||||||
|
md {1},
|
||||||
|
dnl {endo},
|
||||||
|
denl {exo},
|
||||||
|
dsnl {*this, dnl, denl},
|
||||||
|
ll_Incidence {llincidence},
|
||||||
|
dynamicModelFile {std::move(dynamicModelFile_arg)}
|
||||||
{
|
{
|
||||||
computeJacobianPermutation(dr_order);
|
computeJacobianPermutation(dr_order);
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,10 +52,14 @@ ZAuxContainer::getType(int i, const Symmetry& s) const
|
||||||
Approximation::Approximation(DynamicModel& m, Journal& j, int ns, bool dr_centr, bool pruned_dr,
|
Approximation::Approximation(DynamicModel& m, Journal& j, int ns, bool dr_centr, bool pruned_dr,
|
||||||
double qz_crit) :
|
double qz_crit) :
|
||||||
model(m),
|
model(m),
|
||||||
journal(j), ypart(model.nstat(), model.npred(), model.nboth(), model.nforw()),
|
journal(j),
|
||||||
mom(UNormalMoments(model.order(), model.getVcov())), nvs {ypart.nys(), model.nexog(),
|
ypart(model.nstat(), model.npred(), model.nboth(), model.nforw()),
|
||||||
model.nexog(), 1},
|
mom(UNormalMoments(model.order(), model.getVcov())),
|
||||||
steps(ns), dr_centralize(dr_centr), pruning(pruned_dr), qz_criterium(qz_crit),
|
nvs {ypart.nys(), model.nexog(), model.nexog(), 1},
|
||||||
|
steps(ns),
|
||||||
|
dr_centralize(dr_centr),
|
||||||
|
pruning(pruned_dr),
|
||||||
|
qz_criterium(qz_crit),
|
||||||
ss(ypart.ny(), steps + 1)
|
ss(ypart.ny(), steps + 1)
|
||||||
{
|
{
|
||||||
ss.nans();
|
ss.nans();
|
||||||
|
|
|
@ -127,15 +127,13 @@ public:
|
||||||
}
|
}
|
||||||
DecisionRuleImpl(const _Tg& g, const PartitionY& yp, int nuu, const ConstVector& ys,
|
DecisionRuleImpl(const _Tg& g, const PartitionY& yp, int nuu, const ConstVector& ys,
|
||||||
double sigma) :
|
double sigma) :
|
||||||
ctraits<t>::Tpol(yp.ny(), yp.nys() + nuu),
|
ctraits<t>::Tpol(yp.ny(), yp.nys() + nuu), ysteady(ys), ypart(yp), nu(nuu)
|
||||||
ysteady(ys), ypart(yp), nu(nuu)
|
|
||||||
{
|
{
|
||||||
fillTensors(g, sigma);
|
fillTensors(g, sigma);
|
||||||
}
|
}
|
||||||
DecisionRuleImpl(const _Tg& g, const PartitionY& yp, int nuu, const ConstVector& ys, double sigma,
|
DecisionRuleImpl(const _Tg& g, const PartitionY& yp, int nuu, const ConstVector& ys, double sigma,
|
||||||
bool pruning) :
|
bool pruning) :
|
||||||
ctraits<t>::Tpol(yp.ny(), yp.nys() + nuu),
|
ctraits<t>::Tpol(yp.ny(), yp.nys() + nuu), ysteady(ys), ypart(yp), nu(nuu)
|
||||||
ysteady(ys), ypart(yp), nu(nuu)
|
|
||||||
{
|
{
|
||||||
if (pruning)
|
if (pruning)
|
||||||
fillTensorsPruning(g);
|
fillTensorsPruning(g);
|
||||||
|
@ -149,7 +147,9 @@ public:
|
||||||
fillTensors(W, nys);
|
fillTensors(W, nys);
|
||||||
}
|
}
|
||||||
DecisionRuleImpl(const DecisionRuleImpl<t>& dr, const ConstVector& fixpoint) :
|
DecisionRuleImpl(const DecisionRuleImpl<t>& dr, const ConstVector& fixpoint) :
|
||||||
ctraits<t>::Tpol(dr.ypart.ny(), dr.ypart.nys() + dr.nu), ysteady(fixpoint), ypart(dr.ypart),
|
ctraits<t>::Tpol(dr.ypart.ny(), dr.ypart.nys() + dr.nu),
|
||||||
|
ysteady(fixpoint),
|
||||||
|
ypart(dr.ypart),
|
||||||
nu(dr.nu)
|
nu(dr.nu)
|
||||||
{
|
{
|
||||||
centralize(dr);
|
centralize(dr);
|
||||||
|
|
|
@ -61,8 +61,13 @@ public:
|
||||||
FirstOrder(int num_stat, int num_pred, int num_both, int num_forw, int num_u,
|
FirstOrder(int num_stat, int num_pred, int num_both, int num_forw, int num_u,
|
||||||
const FSSparseTensor& f, Journal& jr, double qz_crit) :
|
const FSSparseTensor& f, Journal& jr, double qz_crit) :
|
||||||
ypart(num_stat, num_pred, num_both, num_forw),
|
ypart(num_stat, num_pred, num_both, num_forw),
|
||||||
nu(num_u), gy(ypart.ny(), ypart.nys()), gu(ypart.ny(), nu), alphar(ypart.ny() + ypart.nboth),
|
nu(num_u),
|
||||||
alphai(ypart.ny() + ypart.nboth), beta(ypart.ny() + ypart.nboth), qz_criterium(qz_crit),
|
gy(ypart.ny(), ypart.nys()),
|
||||||
|
gu(ypart.ny(), nu),
|
||||||
|
alphar(ypart.ny() + ypart.nboth),
|
||||||
|
alphai(ypart.ny() + ypart.nboth),
|
||||||
|
beta(ypart.ny() + ypart.nboth),
|
||||||
|
qz_criterium(qz_crit),
|
||||||
journal(jr)
|
journal(jr)
|
||||||
{
|
{
|
||||||
solve(FFSTensor(f));
|
solve(FFSTensor(f));
|
||||||
|
|
|
@ -293,14 +293,29 @@ KOrder::KOrder(int num_stat, int num_pred, int num_both, int num_forw,
|
||||||
const TensorContainer<FSSparseTensor>& fcont, const TwoDMatrix& gy,
|
const TensorContainer<FSSparseTensor>& fcont, const TwoDMatrix& gy,
|
||||||
const TwoDMatrix& gu, const TwoDMatrix& v, Journal& jr) :
|
const TwoDMatrix& gu, const TwoDMatrix& v, Journal& jr) :
|
||||||
ypart(num_stat, num_pred, num_both, num_forw),
|
ypart(num_stat, num_pred, num_both, num_forw),
|
||||||
ny(ypart.ny()), nu(gu.ncols()), maxk(fcont.getMaxDim()), nvs {ypart.nys(), nu, nu, 1}, _ug(4),
|
ny(ypart.ny()),
|
||||||
_fg(4), _ugs(4), _fgs(4), _ugss(4), _fgss(4), _uG(4), _fG(4),
|
nu(gu.ncols()),
|
||||||
|
maxk(fcont.getMaxDim()),
|
||||||
|
nvs {ypart.nys(), nu, nu, 1},
|
||||||
|
_ug(4),
|
||||||
|
_fg(4),
|
||||||
|
_ugs(4),
|
||||||
|
_fgs(4),
|
||||||
|
_ugss(4),
|
||||||
|
_fgss(4),
|
||||||
|
_uG(4),
|
||||||
|
_fG(4),
|
||||||
_uZstack(&_uG, ypart.nyss(), &_ug, ny, ypart.nys(), nu),
|
_uZstack(&_uG, ypart.nyss(), &_ug, ny, ypart.nys(), nu),
|
||||||
_fZstack(&_fG, ypart.nyss(), &_fg, ny, ypart.nys(), nu), _uGstack(&_ugs, ypart.nys(), nu),
|
_fZstack(&_fG, ypart.nyss(), &_fg, ny, ypart.nys(), nu),
|
||||||
_fGstack(&_fgs, ypart.nys(), nu), _um(maxk, v), _fm(_um), f(fcont),
|
_uGstack(&_ugs, ypart.nys(), nu),
|
||||||
|
_fGstack(&_fgs, ypart.nys(), nu),
|
||||||
|
_um(maxk, v),
|
||||||
|
_fm(_um),
|
||||||
|
f(fcont),
|
||||||
matA(f.get(Symmetry {1}), _uZstack.getStackSizes(), gy, ypart),
|
matA(f.get(Symmetry {1}), _uZstack.getStackSizes(), gy, ypart),
|
||||||
matS(f.get(Symmetry {1}), _uZstack.getStackSizes(), gy, ypart),
|
matS(f.get(Symmetry {1}), _uZstack.getStackSizes(), gy, ypart),
|
||||||
matB(f.get(Symmetry {1}), _uZstack.getStackSizes()), journal(jr)
|
matB(f.get(Symmetry {1}), _uZstack.getStackSizes()),
|
||||||
|
journal(jr)
|
||||||
{
|
{
|
||||||
KORD_RAISE_IF(gy.ncols() != ypart.nys(), "Wrong number of columns in gy in KOrder constructor");
|
KORD_RAISE_IF(gy.ncols() != ypart.nys(), "Wrong number of columns in gy in KOrder constructor");
|
||||||
KORD_RAISE_IF(v.ncols() != nu, "Wrong number of columns of Vcov in KOrder constructor");
|
KORD_RAISE_IF(v.ncols() != nu, "Wrong number of columns of Vcov in KOrder constructor");
|
||||||
|
|
|
@ -45,10 +45,21 @@ MatrixAA::MatrixAA(const FSSparseTensor& f, const IntSequence& ss, const TwoDMat
|
||||||
KOrderStoch::KOrderStoch(const PartitionY& yp, int nu, const TensorContainer<FSSparseTensor>& fcont,
|
KOrderStoch::KOrderStoch(const PartitionY& yp, int nu, const TensorContainer<FSSparseTensor>& fcont,
|
||||||
const FGSContainer& hh, Journal& jr) :
|
const FGSContainer& hh, Journal& jr) :
|
||||||
nvs {yp.nys(), nu, nu, 1},
|
nvs {yp.nys(), nu, nu, 1},
|
||||||
ypart(yp), journal(jr), _ug(4), _fg(4), _ugs(4), _fgs(4), _uG(4), _fG(4), _uh(nullptr),
|
ypart(yp),
|
||||||
_fh(&hh), _uZstack(&_uG, ypart.nyss(), &_ug, ypart.ny(), ypart.nys(), nu),
|
journal(jr),
|
||||||
|
_ug(4),
|
||||||
|
_fg(4),
|
||||||
|
_ugs(4),
|
||||||
|
_fgs(4),
|
||||||
|
_uG(4),
|
||||||
|
_fG(4),
|
||||||
|
_uh(nullptr),
|
||||||
|
_fh(&hh),
|
||||||
|
_uZstack(&_uG, ypart.nyss(), &_ug, ypart.ny(), ypart.nys(), nu),
|
||||||
_fZstack(&_fG, ypart.nyss(), &_fg, ypart.ny(), ypart.nys(), nu),
|
_fZstack(&_fG, ypart.nyss(), &_fg, ypart.ny(), ypart.nys(), nu),
|
||||||
_uGstack(&_ugs, ypart.nys(), nu), _fGstack(&_fgs, ypart.nys(), nu), f(fcont),
|
_uGstack(&_ugs, ypart.nys(), nu),
|
||||||
|
_fGstack(&_fgs, ypart.nys(), nu),
|
||||||
|
f(fcont),
|
||||||
matA(fcont.get(Symmetry {1}), _uZstack.getStackSizes(), hh.get(Symmetry {1, 0, 0, 0}), ypart)
|
matA(fcont.get(Symmetry {1}), _uZstack.getStackSizes(), hh.get(Symmetry {1, 0, 0, 0}), ypart)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -57,10 +68,21 @@ KOrderStoch::KOrderStoch(const PartitionY& yp, int nu, const TensorContainer<FSS
|
||||||
KOrderStoch::KOrderStoch(const PartitionY& yp, int nu, const TensorContainer<FSSparseTensor>& fcont,
|
KOrderStoch::KOrderStoch(const PartitionY& yp, int nu, const TensorContainer<FSSparseTensor>& fcont,
|
||||||
const UGSContainer& hh, Journal& jr) :
|
const UGSContainer& hh, Journal& jr) :
|
||||||
nvs {yp.nys(), nu, nu, 1},
|
nvs {yp.nys(), nu, nu, 1},
|
||||||
ypart(yp), journal(jr), _ug(4), _fg(4), _ugs(4), _fgs(4), _uG(4), _fG(4), _uh(&hh),
|
ypart(yp),
|
||||||
_fh(nullptr), _uZstack(&_uG, ypart.nyss(), &_ug, ypart.ny(), ypart.nys(), nu),
|
journal(jr),
|
||||||
|
_ug(4),
|
||||||
|
_fg(4),
|
||||||
|
_ugs(4),
|
||||||
|
_fgs(4),
|
||||||
|
_uG(4),
|
||||||
|
_fG(4),
|
||||||
|
_uh(&hh),
|
||||||
|
_fh(nullptr),
|
||||||
|
_uZstack(&_uG, ypart.nyss(), &_ug, ypart.ny(), ypart.nys(), nu),
|
||||||
_fZstack(&_fG, ypart.nyss(), &_fg, ypart.ny(), ypart.nys(), nu),
|
_fZstack(&_fG, ypart.nyss(), &_fg, ypart.ny(), ypart.nys(), nu),
|
||||||
_uGstack(&_ugs, ypart.nys(), nu), _fGstack(&_fgs, ypart.nys(), nu), f(fcont),
|
_uGstack(&_ugs, ypart.nys(), nu),
|
||||||
|
_fGstack(&_fgs, ypart.nys(), nu),
|
||||||
|
f(fcont),
|
||||||
matA(fcont.get(Symmetry {1}), _uZstack.getStackSizes(), hh.get(Symmetry {1, 0, 0, 0}), ypart)
|
matA(fcont.get(Symmetry {1}), _uZstack.getStackSizes(), hh.get(Symmetry {1, 0, 0, 0}), ypart)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
@ -339,7 +339,9 @@ GeneralMatrix::gemm_partial_right(const std::string& trans, const ConstGeneralMa
|
||||||
}
|
}
|
||||||
|
|
||||||
ConstGeneralMatrix::ConstGeneralMatrix(const GeneralMatrix& m, int i, int j, int nrows, int ncols) :
|
ConstGeneralMatrix::ConstGeneralMatrix(const GeneralMatrix& m, int i, int j, int nrows, int ncols) :
|
||||||
data(m.getData(), j * m.getLD() + i, (ncols - 1) * m.getLD() + nrows), rows(nrows), cols(ncols),
|
data(m.getData(), j * m.getLD() + i, (ncols - 1) * m.getLD() + nrows),
|
||||||
|
rows(nrows),
|
||||||
|
cols(ncols),
|
||||||
ld(m.getLD())
|
ld(m.getLD())
|
||||||
{
|
{
|
||||||
// FIXME: check that the submatrix is fully in the matrix
|
// FIXME: check that the submatrix is fully in the matrix
|
||||||
|
@ -348,7 +350,9 @@ ConstGeneralMatrix::ConstGeneralMatrix(const GeneralMatrix& m, int i, int j, int
|
||||||
ConstGeneralMatrix::ConstGeneralMatrix(const ConstGeneralMatrix& m, int i, int j, int nrows,
|
ConstGeneralMatrix::ConstGeneralMatrix(const ConstGeneralMatrix& m, int i, int j, int nrows,
|
||||||
int ncols) :
|
int ncols) :
|
||||||
data(m.getData(), j * m.getLD() + i, (ncols - 1) * m.getLD() + nrows),
|
data(m.getData(), j * m.getLD() + i, (ncols - 1) * m.getLD() + nrows),
|
||||||
rows(nrows), cols(ncols), ld(m.getLD())
|
rows(nrows),
|
||||||
|
cols(ncols),
|
||||||
|
ld(m.getLD())
|
||||||
{
|
{
|
||||||
// FIXME: check that the submatrix is fully in the matrix
|
// FIXME: check that the submatrix is fully in the matrix
|
||||||
}
|
}
|
||||||
|
|
|
@ -586,8 +586,11 @@ protected:
|
||||||
|
|
||||||
public:
|
public:
|
||||||
SVDDecomp(const GeneralMatrix& A) :
|
SVDDecomp(const GeneralMatrix& A) :
|
||||||
minmn(std::min<int>(A.nrows(), A.ncols())), sigma(minmn), U(A.nrows(), A.nrows()),
|
minmn(std::min<int>(A.nrows(), A.ncols())),
|
||||||
VT(A.ncols(), A.ncols()), conv(false)
|
sigma(minmn),
|
||||||
|
U(A.nrows(), A.nrows()),
|
||||||
|
VT(A.ncols(), A.ncols()),
|
||||||
|
conv(false)
|
||||||
{
|
{
|
||||||
construct(A);
|
construct(A);
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,8 +31,12 @@ GeneralSylvester::GeneralSylvester(int ord, int n, int m, int zero_cols, const C
|
||||||
const ConstVector& db, const ConstVector& dc,
|
const ConstVector& db, const ConstVector& dc,
|
||||||
const ConstVector& dd, const SylvParams& ps) :
|
const ConstVector& dd, const SylvParams& ps) :
|
||||||
pars(ps),
|
pars(ps),
|
||||||
order(ord), a(Vector {da}, n), b(Vector {db}, n, n - zero_cols), c(Vector {dc}, m),
|
order(ord),
|
||||||
d(Vector {dd}, n, power(m, order)), solved(false)
|
a(Vector {da}, n),
|
||||||
|
b(Vector {db}, n, n - zero_cols),
|
||||||
|
c(Vector {dc}, m),
|
||||||
|
d(Vector {dd}, n, power(m, order)),
|
||||||
|
solved(false)
|
||||||
{
|
{
|
||||||
init();
|
init();
|
||||||
}
|
}
|
||||||
|
@ -41,8 +45,12 @@ GeneralSylvester::GeneralSylvester(int ord, int n, int m, int zero_cols, const C
|
||||||
const ConstVector& db, const ConstVector& dc, Vector& dd,
|
const ConstVector& db, const ConstVector& dc, Vector& dd,
|
||||||
const SylvParams& ps) :
|
const SylvParams& ps) :
|
||||||
pars(ps),
|
pars(ps),
|
||||||
order(ord), a(Vector {da}, n), b(Vector {db}, n, n - zero_cols), c(Vector {dc}, m),
|
order(ord),
|
||||||
d(dd, n, power(m, order)), solved(false)
|
a(Vector {da}, n),
|
||||||
|
b(Vector {db}, n, n - zero_cols),
|
||||||
|
c(Vector {dc}, m),
|
||||||
|
d(dd, n, power(m, order)),
|
||||||
|
solved(false)
|
||||||
{
|
{
|
||||||
init();
|
init();
|
||||||
}
|
}
|
||||||
|
@ -51,8 +59,12 @@ GeneralSylvester::GeneralSylvester(int ord, int n, int m, int zero_cols, const C
|
||||||
const ConstVector& db, const ConstVector& dc,
|
const ConstVector& db, const ConstVector& dc,
|
||||||
const ConstVector& dd, bool alloc_for_check) :
|
const ConstVector& dd, bool alloc_for_check) :
|
||||||
pars(alloc_for_check),
|
pars(alloc_for_check),
|
||||||
order(ord), a(Vector {da}, n), b(Vector {db}, n, n - zero_cols), c(Vector {dc}, m),
|
order(ord),
|
||||||
d(Vector {dd}, n, power(m, order)), solved(false)
|
a(Vector {da}, n),
|
||||||
|
b(Vector {db}, n, n - zero_cols),
|
||||||
|
c(Vector {dc}, m),
|
||||||
|
d(Vector {dd}, n, power(m, order)),
|
||||||
|
solved(false)
|
||||||
{
|
{
|
||||||
init();
|
init();
|
||||||
}
|
}
|
||||||
|
@ -61,8 +73,12 @@ GeneralSylvester::GeneralSylvester(int ord, int n, int m, int zero_cols, const C
|
||||||
const ConstVector& db, const ConstVector& dc, Vector& dd,
|
const ConstVector& db, const ConstVector& dc, Vector& dd,
|
||||||
bool alloc_for_check) :
|
bool alloc_for_check) :
|
||||||
pars(alloc_for_check),
|
pars(alloc_for_check),
|
||||||
order(ord), a(Vector {da}, n), b(Vector {db}, n, n - zero_cols), c(Vector {dc}, m),
|
order(ord),
|
||||||
d(dd, n, power(m, order)), solved(false)
|
a(Vector {da}, n),
|
||||||
|
b(Vector {db}, n, n - zero_cols),
|
||||||
|
c(Vector {dc}, m),
|
||||||
|
d(dd, n, power(m, order)),
|
||||||
|
solved(false)
|
||||||
{
|
{
|
||||||
init();
|
init();
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,7 +35,9 @@ KronVector::KronVector(Vector& v, int mm, int nn, int dp) : Vector(v), m(mm), n(
|
||||||
}
|
}
|
||||||
|
|
||||||
KronVector::KronVector(KronVector& v, int i) :
|
KronVector::KronVector(KronVector& v, int i) :
|
||||||
Vector(v, i * power(v.m, v.depth - 1) * v.n, power(v.m, v.depth - 1) * v.n), m(v.m), n(v.n),
|
Vector(v, i * power(v.m, v.depth - 1) * v.n, power(v.m, v.depth - 1) * v.n),
|
||||||
|
m(v.m),
|
||||||
|
n(v.n),
|
||||||
depth(v.depth - 1)
|
depth(v.depth - 1)
|
||||||
{
|
{
|
||||||
if (depth < 0)
|
if (depth < 0)
|
||||||
|
@ -87,15 +89,19 @@ ConstKronVector::ConstKronVector(ConstVector v, int mm, int nn, int dp) :
|
||||||
ConstKronVector::ConstKronVector(const KronVector& v, int i) :
|
ConstKronVector::ConstKronVector(const KronVector& v, int i) :
|
||||||
ConstVector(v, i * power(v.getM(), v.getDepth() - 1) * v.getN(),
|
ConstVector(v, i * power(v.getM(), v.getDepth() - 1) * v.getN(),
|
||||||
power(v.getM(), v.getDepth() - 1) * v.getN()),
|
power(v.getM(), v.getDepth() - 1) * v.getN()),
|
||||||
m(v.getM()), n(v.getN()), depth(v.getDepth() - 1)
|
m(v.getM()),
|
||||||
|
n(v.getN()),
|
||||||
|
depth(v.getDepth() - 1)
|
||||||
{
|
{
|
||||||
if (depth < 0)
|
if (depth < 0)
|
||||||
throw SYLV_MES_EXCEPTION("Bad KronVector pick, depth < 0.");
|
throw SYLV_MES_EXCEPTION("Bad KronVector pick, depth < 0.");
|
||||||
}
|
}
|
||||||
|
|
||||||
ConstKronVector::ConstKronVector(const ConstKronVector& v, int i) :
|
ConstKronVector::ConstKronVector(const ConstKronVector& v, int i) :
|
||||||
ConstVector(v, i * power(v.m, v.depth - 1) * v.n, power(v.m, v.depth - 1) * v.n), m(v.getM()),
|
ConstVector(v, i * power(v.m, v.depth - 1) * v.n, power(v.m, v.depth - 1) * v.n),
|
||||||
n(v.getN()), depth(v.getDepth() - 1)
|
m(v.getM()),
|
||||||
|
n(v.getN()),
|
||||||
|
depth(v.getDepth() - 1)
|
||||||
{
|
{
|
||||||
if (depth < 0)
|
if (depth < 0)
|
||||||
throw SYLV_MES_EXCEPTION("Bad KronVector pick, depth < 0.");
|
throw SYLV_MES_EXCEPTION("Bad KronVector pick, depth < 0.");
|
||||||
|
|
|
@ -395,8 +395,7 @@ QuasiTriangular::QuasiTriangular(double r, const QuasiTriangular& t) :
|
||||||
|
|
||||||
QuasiTriangular::QuasiTriangular(double r, const QuasiTriangular& t, double r2,
|
QuasiTriangular::QuasiTriangular(double r, const QuasiTriangular& t, double r2,
|
||||||
const QuasiTriangular& t2) :
|
const QuasiTriangular& t2) :
|
||||||
SqSylvMatrix(t.nrows()),
|
SqSylvMatrix(t.nrows()), diagonal(getData().base(), t.diagonal)
|
||||||
diagonal(getData().base(), t.diagonal)
|
|
||||||
{
|
{
|
||||||
setMatrix(r, t);
|
setMatrix(r, t);
|
||||||
addMatrix(r2, t2);
|
addMatrix(r2, t2);
|
||||||
|
@ -414,8 +413,7 @@ QuasiTriangular::QuasiTriangular(const ConstVector& d, int d_size) :
|
||||||
|
|
||||||
QuasiTriangular::QuasiTriangular([[maybe_unused]] const std::string& dummy,
|
QuasiTriangular::QuasiTriangular([[maybe_unused]] const std::string& dummy,
|
||||||
const QuasiTriangular& t) :
|
const QuasiTriangular& t) :
|
||||||
SqSylvMatrix(t.nrows()),
|
SqSylvMatrix(t.nrows()), diagonal(getData().base(), t.diagonal)
|
||||||
diagonal(getData().base(), t.diagonal)
|
|
||||||
{
|
{
|
||||||
Vector aux(t.getData());
|
Vector aux(t.getData());
|
||||||
blas_int d_size = diagonal.getSize();
|
blas_int d_size = diagonal.getSize();
|
||||||
|
|
|
@ -43,8 +43,7 @@ QuasiTriangularZero::QuasiTriangularZero(double r, const QuasiTriangularZero& t)
|
||||||
|
|
||||||
QuasiTriangularZero::QuasiTriangularZero(double r, const QuasiTriangularZero& t, double r2,
|
QuasiTriangularZero::QuasiTriangularZero(double r, const QuasiTriangularZero& t, double r2,
|
||||||
const QuasiTriangularZero& t2) :
|
const QuasiTriangularZero& t2) :
|
||||||
QuasiTriangular(r, t, r2, t2),
|
QuasiTriangular(r, t, r2, t2), nz(t.nz), ru(t.ru)
|
||||||
nz(t.nz), ru(t.ru)
|
|
||||||
{
|
{
|
||||||
ru.mult(r);
|
ru.mult(r);
|
||||||
ru.add(r2, t2.ru);
|
ru.add(r2, t2.ru);
|
||||||
|
@ -57,7 +56,8 @@ QuasiTriangularZero::QuasiTriangularZero(const std::string& dummy, const QuasiTr
|
||||||
}
|
}
|
||||||
|
|
||||||
QuasiTriangularZero::QuasiTriangularZero(const SchurDecompZero& decomp) :
|
QuasiTriangularZero::QuasiTriangularZero(const SchurDecompZero& decomp) :
|
||||||
QuasiTriangular(decomp.getT().getData(), decomp.getT().nrows()), nz(decomp.getZeroCols()),
|
QuasiTriangular(decomp.getT().getData(), decomp.getT().nrows()),
|
||||||
|
nz(decomp.getZeroCols()),
|
||||||
ru(decomp.getRU())
|
ru(decomp.getRU())
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
@ -210,7 +210,10 @@ public:
|
||||||
DoubleParamItem cpu_time; // time of the job in CPU seconds
|
DoubleParamItem cpu_time; // time of the job in CPU seconds
|
||||||
|
|
||||||
SylvParams(bool wc = false) :
|
SylvParams(bool wc = false) :
|
||||||
method(solve_method::recurse), convergence_tol(1.e-30), max_num_iter(15), bs_norm(1.3),
|
method(solve_method::recurse),
|
||||||
|
convergence_tol(1.e-30),
|
||||||
|
max_num_iter(15),
|
||||||
|
bs_norm(1.3),
|
||||||
want_check(wc)
|
want_check(wc)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,15 +33,13 @@ TriangularSylvester::TriangularSylvester(const QuasiTriangular& k, const QuasiTr
|
||||||
|
|
||||||
TriangularSylvester::TriangularSylvester(const SchurDecompZero& kdecomp,
|
TriangularSylvester::TriangularSylvester(const SchurDecompZero& kdecomp,
|
||||||
const SchurDecomp& fdecomp) :
|
const SchurDecomp& fdecomp) :
|
||||||
SylvesterSolver(kdecomp, fdecomp),
|
SylvesterSolver(kdecomp, fdecomp), matrixKK {matrixK->square()}, matrixFF {matrixF->square()}
|
||||||
matrixKK {matrixK->square()}, matrixFF {matrixF->square()}
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
TriangularSylvester::TriangularSylvester(const SchurDecompZero& kdecomp,
|
TriangularSylvester::TriangularSylvester(const SchurDecompZero& kdecomp,
|
||||||
const SimilarityDecomp& fdecomp) :
|
const SimilarityDecomp& fdecomp) :
|
||||||
SylvesterSolver(kdecomp, fdecomp),
|
SylvesterSolver(kdecomp, fdecomp), matrixKK {matrixK->square()}, matrixFF {matrixF->square()}
|
||||||
matrixKK {matrixK->square()}, matrixFF {matrixF->square()}
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -57,7 +57,9 @@ public:
|
||||||
}
|
}
|
||||||
Vector(const Vector& v);
|
Vector(const Vector& v);
|
||||||
Vector(Vector&& v) :
|
Vector(Vector&& v) :
|
||||||
len {std::exchange(v.len, 0)}, s {v.s}, data {std::exchange(v.data, nullptr)},
|
len {std::exchange(v.len, 0)},
|
||||||
|
s {v.s},
|
||||||
|
data {std::exchange(v.data, nullptr)},
|
||||||
destroy {std::exchange(v.destroy, false)}
|
destroy {std::exchange(v.destroy, false)}
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
@ -117,9 +117,10 @@ public:
|
||||||
conts. */
|
conts. */
|
||||||
|
|
||||||
FineContainer(const _Stype& sc, int max) :
|
FineContainer(const _Stype& sc, int max) :
|
||||||
SizeRefinement(sc.getStackSizes(), sc.numConts(), max), StackContainer<_Ttype>(
|
SizeRefinement(sc.getStackSizes(), sc.numConts(), max),
|
||||||
numRefinements(), getNC()),
|
StackContainer<_Ttype>(numRefinements(), getNC()),
|
||||||
ref_conts(getNC()), stack_cont(sc)
|
ref_conts(getNC()),
|
||||||
|
stack_cont(sc)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < numRefinements(); i++)
|
for (int i = 0; i < numRefinements(); i++)
|
||||||
_Stype::stack_sizes[i] = getRefSize(i);
|
_Stype::stack_sizes[i] = getRefSize(i);
|
||||||
|
|
|
@ -87,7 +87,8 @@ public:
|
||||||
}
|
}
|
||||||
// Move constructor
|
// Move constructor
|
||||||
IntSequence(IntSequence&& s) noexcept :
|
IntSequence(IntSequence&& s) noexcept :
|
||||||
data {std::exchange(s.data, nullptr)}, length {std::exchange(s.length, 0)},
|
data {std::exchange(s.data, nullptr)},
|
||||||
|
length {std::exchange(s.length, 0)},
|
||||||
destroy {std::exchange(s.destroy, false)}
|
destroy {std::exchange(s.destroy, false)}
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,7 +26,9 @@
|
||||||
‘end_seq’ according to ‘unit_flag’ and columns lengths. */
|
‘end_seq’ according to ‘unit_flag’ and columns lengths. */
|
||||||
|
|
||||||
IrregTensorHeader::IrregTensorHeader(const StackProduct<FGSTensor>& sp, const IntSequence& c) :
|
IrregTensorHeader::IrregTensorHeader(const StackProduct<FGSTensor>& sp, const IntSequence& c) :
|
||||||
nv(sp.getAllSize()), unit_flag(sp.dimen()), cols(sp.createPackedColumns(c, unit_flag)),
|
nv(sp.getAllSize()),
|
||||||
|
unit_flag(sp.dimen()),
|
||||||
|
cols(sp.createPackedColumns(c, unit_flag)),
|
||||||
end_seq(sp.dimen())
|
end_seq(sp.dimen())
|
||||||
{
|
{
|
||||||
for (int i = 0; i < sp.dimen(); i++)
|
for (int i = 0; i < sp.dimen(); i++)
|
||||||
|
|
|
@ -204,8 +204,7 @@ FSSparseTensor::print() const
|
||||||
/* This is the same as FGSTensor slicing constructor from FSSparseTensor. */
|
/* This is the same as FGSTensor slicing constructor from FSSparseTensor. */
|
||||||
GSSparseTensor::GSSparseTensor(const FSSparseTensor& t, const IntSequence& ss,
|
GSSparseTensor::GSSparseTensor(const FSSparseTensor& t, const IntSequence& ss,
|
||||||
const IntSequence& coor, TensorDimens td) :
|
const IntSequence& coor, TensorDimens td) :
|
||||||
SparseTensor(td.dimen(), t.nrows(), td.calcFoldMaxOffset()),
|
SparseTensor(td.dimen(), t.nrows(), td.calcFoldMaxOffset()), tdims(std::move(td))
|
||||||
tdims(std::move(td))
|
|
||||||
{
|
{
|
||||||
// set ‘lb’ and ‘ub’ to lower and upper bounds of slice indices
|
// set ‘lb’ and ‘ub’ to lower and upper bounds of slice indices
|
||||||
/* The same code is present in FGSTensor slicing constructor, see it for
|
/* The same code is present in FGSTensor slicing constructor, see it for
|
||||||
|
|
|
@ -76,8 +76,7 @@ WorkerFoldMAADense::operator()(std::mutex& mut)
|
||||||
|
|
||||||
WorkerFoldMAADense::WorkerFoldMAADense(const FoldedStackContainer& container, Symmetry s,
|
WorkerFoldMAADense::WorkerFoldMAADense(const FoldedStackContainer& container, Symmetry s,
|
||||||
const FGSContainer& dcontainer, FGSTensor& outten) :
|
const FGSContainer& dcontainer, FGSTensor& outten) :
|
||||||
cont(container),
|
cont(container), sym(std::move(s)), dense_cont(dcontainer), out(outten)
|
||||||
sym(std::move(s)), dense_cont(dcontainer), out(outten)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -140,8 +139,7 @@ WorkerFoldMAASparse1::operator()(std::mutex& mut)
|
||||||
WorkerFoldMAASparse1::WorkerFoldMAASparse1(const FoldedStackContainer& container,
|
WorkerFoldMAASparse1::WorkerFoldMAASparse1(const FoldedStackContainer& container,
|
||||||
const FSSparseTensor& ten, FGSTensor& outten,
|
const FSSparseTensor& ten, FGSTensor& outten,
|
||||||
IntSequence c) :
|
IntSequence c) :
|
||||||
cont(container),
|
cont(container), t(ten), out(outten), coor(std::move(c))
|
||||||
t(ten), out(outten), coor(std::move(c))
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -196,8 +194,7 @@ WorkerFoldMAASparse2::operator()(std::mutex& mut)
|
||||||
WorkerFoldMAASparse2::WorkerFoldMAASparse2(const FoldedStackContainer& container,
|
WorkerFoldMAASparse2::WorkerFoldMAASparse2(const FoldedStackContainer& container,
|
||||||
const FSSparseTensor& ten, FGSTensor& outten,
|
const FSSparseTensor& ten, FGSTensor& outten,
|
||||||
IntSequence c) :
|
IntSequence c) :
|
||||||
cont(container),
|
cont(container), t(ten), out(outten), coor(std::move(c))
|
||||||
t(ten), out(outten), coor(std::move(c))
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -270,8 +267,7 @@ WorkerFoldMAASparse4::operator()(std::mutex& mut)
|
||||||
WorkerFoldMAASparse4::WorkerFoldMAASparse4(const FoldedStackContainer& container,
|
WorkerFoldMAASparse4::WorkerFoldMAASparse4(const FoldedStackContainer& container,
|
||||||
const FSSparseTensor& ten, FGSTensor& outten,
|
const FSSparseTensor& ten, FGSTensor& outten,
|
||||||
IntSequence c) :
|
IntSequence c) :
|
||||||
cont(container),
|
cont(container), t(ten), out(outten), coor(std::move(c))
|
||||||
t(ten), out(outten), coor(std::move(c))
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -405,8 +401,7 @@ WorkerUnfoldMAADense::operator()(std::mutex& mut)
|
||||||
|
|
||||||
WorkerUnfoldMAADense::WorkerUnfoldMAADense(const UnfoldedStackContainer& container, Symmetry s,
|
WorkerUnfoldMAADense::WorkerUnfoldMAADense(const UnfoldedStackContainer& container, Symmetry s,
|
||||||
const UGSContainer& dcontainer, UGSTensor& outten) :
|
const UGSContainer& dcontainer, UGSTensor& outten) :
|
||||||
cont(container),
|
cont(container), sym(std::move(s)), dense_cont(dcontainer), out(outten)
|
||||||
sym(std::move(s)), dense_cont(dcontainer), out(outten)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -496,8 +491,7 @@ WorkerUnfoldMAASparse1::operator()(std::mutex& mut)
|
||||||
WorkerUnfoldMAASparse1::WorkerUnfoldMAASparse1(const UnfoldedStackContainer& container,
|
WorkerUnfoldMAASparse1::WorkerUnfoldMAASparse1(const UnfoldedStackContainer& container,
|
||||||
const FSSparseTensor& ten, UGSTensor& outten,
|
const FSSparseTensor& ten, UGSTensor& outten,
|
||||||
IntSequence c) :
|
IntSequence c) :
|
||||||
cont(container),
|
cont(container), t(ten), out(outten), coor(std::move(c))
|
||||||
t(ten), out(outten), coor(std::move(c))
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -560,8 +554,7 @@ WorkerUnfoldMAASparse2::operator()(std::mutex& mut)
|
||||||
WorkerUnfoldMAASparse2::WorkerUnfoldMAASparse2(const UnfoldedStackContainer& container,
|
WorkerUnfoldMAASparse2::WorkerUnfoldMAASparse2(const UnfoldedStackContainer& container,
|
||||||
const FSSparseTensor& ten, UGSTensor& outten,
|
const FSSparseTensor& ten, UGSTensor& outten,
|
||||||
IntSequence c) :
|
IntSequence c) :
|
||||||
cont(container),
|
cont(container), t(ten), out(outten), coor(std::move(c))
|
||||||
t(ten), out(outten), coor(std::move(c))
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -180,13 +180,17 @@ protected:
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Tensor(indor io, IntSequence last, int r, int c, int d) :
|
Tensor(indor io, IntSequence last, int r, int c, int d) :
|
||||||
TwoDMatrix(r, c), in_beg(*this, d),
|
TwoDMatrix(r, c),
|
||||||
in_end(*this, std::move(last), (io == indor::along_row) ? r : c), dim(d)
|
in_beg(*this, d),
|
||||||
|
in_end(*this, std::move(last), (io == indor::along_row) ? r : c),
|
||||||
|
dim(d)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
Tensor(indor io, IntSequence first, IntSequence last, int r, int c, int d) :
|
Tensor(indor io, IntSequence first, IntSequence last, int r, int c, int d) :
|
||||||
TwoDMatrix(r, c), in_beg(*this, std::move(first), 0),
|
TwoDMatrix(r, c),
|
||||||
in_end(*this, std::move(last), (io == indor::along_row) ? r : c), dim(d)
|
in_beg(*this, std::move(first), 0),
|
||||||
|
in_end(*this, std::move(last), (io == indor::along_row) ? r : c),
|
||||||
|
dim(d)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
Tensor(int first_row, int num, Tensor& t) :
|
Tensor(int first_row, int num, Tensor& t) :
|
||||||
|
@ -194,8 +198,10 @@ public:
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
Tensor(const Tensor& t) :
|
Tensor(const Tensor& t) :
|
||||||
TwoDMatrix(t), in_beg(*this, t.in_beg.getCoor(), *(t.in_beg)),
|
TwoDMatrix(t),
|
||||||
in_end(*this, t.in_end.getCoor(), *(t.in_end)), dim(t.dim)
|
in_beg(*this, t.in_beg.getCoor(), *(t.in_beg)),
|
||||||
|
in_end(*this, t.in_end.getCoor(), *(t.in_end)),
|
||||||
|
dim(t.dim)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
Tensor(Tensor&&) = default;
|
Tensor(Tensor&&) = default;
|
||||||
|
|
|
@ -381,8 +381,7 @@ Monom4Vector::print() const
|
||||||
|
|
||||||
SparseDerivGenerator::SparseDerivGenerator(int nf, int ny, int nu, int nup, int nbigg, int ng,
|
SparseDerivGenerator::SparseDerivGenerator(int nf, int ny, int nu, int nup, int nbigg, int ng,
|
||||||
int mx, double prob, int maxdim) :
|
int mx, double prob, int maxdim) :
|
||||||
maxdimen(maxdim),
|
maxdimen(maxdim), bigg(4), g(4), rcont(4)
|
||||||
bigg(4), g(4), rcont(4)
|
|
||||||
{
|
{
|
||||||
intgen.init(nf, ny, nu, nup, nbigg, mx, prob);
|
intgen.init(nf, ny, nu, nup, nbigg, mx, prob);
|
||||||
|
|
||||||
|
@ -407,8 +406,7 @@ SparseDerivGenerator::SparseDerivGenerator(int nf, int ny, int nu, int nup, int
|
||||||
|
|
||||||
DenseDerivGenerator::DenseDerivGenerator(int ng, int nx, int ny, int nu, int mx, double prob,
|
DenseDerivGenerator::DenseDerivGenerator(int ng, int nx, int ny, int nu, int mx, double prob,
|
||||||
int maxdim) :
|
int maxdim) :
|
||||||
maxdimen(maxdim),
|
maxdimen(maxdim), xcont(0), rcont(0), ts(maxdimen), uxcont(0), uts(maxdimen)
|
||||||
xcont(0), rcont(0), ts(maxdimen), uxcont(0), uts(maxdimen)
|
|
||||||
{
|
{
|
||||||
intgen.init(ng, nx, ny, nu, nu, mx, prob);
|
intgen.init(ng, nx, ny, nu, nu, mx, prob);
|
||||||
Monom1Vector g(nx, ng);
|
Monom1Vector g(nx, ng);
|
||||||
|
|
|
@ -95,7 +95,9 @@ DynamicModelDllCaller::DynamicModelDllCaller(size_t ntt, mwIndex ny, mwIndex nx,
|
||||||
const int32_T* g1_sparse_colptr_arg, bool linear_arg,
|
const int32_T* g1_sparse_colptr_arg, bool linear_arg,
|
||||||
bool compute_jacobian_arg) :
|
bool compute_jacobian_arg) :
|
||||||
DynamicModelCaller {linear_arg, compute_jacobian_arg},
|
DynamicModelCaller {linear_arg, compute_jacobian_arg},
|
||||||
params {params_arg}, steady_state {steady_state_arg}, g1_sparse_colptr {g1_sparse_colptr_arg}
|
params {params_arg},
|
||||||
|
steady_state {steady_state_arg},
|
||||||
|
g1_sparse_colptr {g1_sparse_colptr_arg}
|
||||||
{
|
{
|
||||||
tt = std::make_unique<double[]>(ntt);
|
tt = std::make_unique<double[]>(ntt);
|
||||||
y_p = std::make_unique<double[]>(3 * ny);
|
y_p = std::make_unique<double[]>(3 * ny);
|
||||||
|
@ -134,11 +136,13 @@ DynamicModelMatlabCaller::DynamicModelMatlabCaller(std::string basename_arg, mwI
|
||||||
const mxArray* g1_sparse_colptr_mx_arg,
|
const mxArray* g1_sparse_colptr_mx_arg,
|
||||||
bool linear_arg, bool compute_jacobian_arg) :
|
bool linear_arg, bool compute_jacobian_arg) :
|
||||||
DynamicModelCaller {linear_arg, compute_jacobian_arg},
|
DynamicModelCaller {linear_arg, compute_jacobian_arg},
|
||||||
basename {std::move(basename_arg)}, y_mx {mxCreateDoubleMatrix(3 * ny, 1, mxREAL)},
|
basename {std::move(basename_arg)},
|
||||||
x_mx {mxCreateDoubleMatrix(nx, 1, mxREAL)}, jacobian_mx {nullptr}, params_mx {mxDuplicateArray(
|
y_mx {mxCreateDoubleMatrix(3 * ny, 1, mxREAL)},
|
||||||
params_mx_arg)},
|
x_mx {mxCreateDoubleMatrix(nx, 1, mxREAL)},
|
||||||
steady_state_mx {mxDuplicateArray(steady_state_mx_arg)}, g1_sparse_rowval_mx {mxDuplicateArray(
|
jacobian_mx {nullptr},
|
||||||
g1_sparse_rowval_mx_arg)},
|
params_mx {mxDuplicateArray(params_mx_arg)},
|
||||||
|
steady_state_mx {mxDuplicateArray(steady_state_mx_arg)},
|
||||||
|
g1_sparse_rowval_mx {mxDuplicateArray(g1_sparse_rowval_mx_arg)},
|
||||||
g1_sparse_colval_mx {mxDuplicateArray(g1_sparse_colval_mx_arg)},
|
g1_sparse_colval_mx {mxDuplicateArray(g1_sparse_colval_mx_arg)},
|
||||||
g1_sparse_colptr_mx {mxDuplicateArray(g1_sparse_colptr_mx_arg)}
|
g1_sparse_colptr_mx {mxDuplicateArray(g1_sparse_colptr_mx_arg)}
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue