2019-06-19 14:34:30 +02:00
|
|
|
/*
|
|
|
|
* Copyright © 2004 Ondra Kamenik
|
2023-04-17 17:19:43 +02:00
|
|
|
* Copyright © 2019-2023 Dynare Team
|
2019-06-19 14:34:30 +02:00
|
|
|
*
|
|
|
|
* This file is part of Dynare.
|
|
|
|
*
|
|
|
|
* Dynare is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* Dynare is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2021-06-09 17:33:48 +02:00
|
|
|
* along with Dynare. If not, see <https://www.gnu.org/licenses/>.
|
2019-06-19 14:34:30 +02:00
|
|
|
*/
|
2019-01-04 16:29:57 +01:00
|
|
|
|
|
|
|
#include "kord_exception.hh"
|
|
|
|
#include "decision_rule.hh"
|
|
|
|
#include "dynamic_model.hh"
|
|
|
|
|
2019-01-08 17:12:05 +01:00
|
|
|
#include "SymSchurDecomp.hh"
|
2019-01-04 16:29:57 +01:00
|
|
|
|
2019-01-14 12:19:00 +01:00
|
|
|
#include <memory>
|
2019-01-04 16:29:57 +01:00
|
|
|
|
2019-05-10 18:41:23 +02:00
|
|
|
// FoldDecisionRule conversion from UnfoldDecisionRule
|
2019-01-04 16:29:57 +01:00
|
|
|
FoldDecisionRule::FoldDecisionRule(const UnfoldDecisionRule &udr)
|
2019-03-06 18:40:19 +01:00
|
|
|
: DecisionRuleImpl<Storage::fold>(ctraits<Storage::fold>::Tpol(udr.nrows(), udr.nvars()),
|
2019-12-20 14:36:20 +01:00
|
|
|
udr.ypart, udr.nu, udr.ysteady)
|
2019-01-04 16:29:57 +01:00
|
|
|
{
|
2019-03-05 18:35:35 +01:00
|
|
|
for (const auto &it : udr)
|
2019-03-06 18:40:19 +01:00
|
|
|
insert(std::make_unique<ctraits<Storage::fold>::Ttensym>(*(it.second)));
|
2019-01-04 16:29:57 +01:00
|
|
|
}
|
|
|
|
|
2019-05-10 18:41:23 +02:00
|
|
|
// UnfoldDecisionRule conversion from FoldDecisionRule
|
2019-01-04 16:29:57 +01:00
|
|
|
UnfoldDecisionRule::UnfoldDecisionRule(const FoldDecisionRule &fdr)
|
2019-03-06 18:40:19 +01:00
|
|
|
: DecisionRuleImpl<Storage::unfold>(ctraits<Storage::unfold>::Tpol(fdr.nrows(), fdr.nvars()),
|
2019-12-20 14:36:20 +01:00
|
|
|
fdr.ypart, fdr.nu, fdr.ysteady)
|
2019-01-04 16:29:57 +01:00
|
|
|
{
|
2019-03-05 18:35:35 +01:00
|
|
|
for (const auto &it : fdr)
|
2019-03-06 18:40:19 +01:00
|
|
|
insert(std::make_unique<ctraits<Storage::unfold>::Ttensym>(*(it.second)));
|
2019-01-04 16:29:57 +01:00
|
|
|
}
|