Skip to content

Commit

Permalink
rearrange cpp source files based on headers
Browse files Browse the repository at this point in the history
  • Loading branch information
ygeunkim committed Feb 5, 2025
1 parent ed6ce5c commit 7fe977e
Show file tree
Hide file tree
Showing 18 changed files with 3,206 additions and 3,207 deletions.
726 changes: 363 additions & 363 deletions R/RcppExports.R

Large diffs are not rendered by default.

10 changes: 0 additions & 10 deletions inst/include/bvhar/bayesfit

This file was deleted.

10 changes: 10 additions & 0 deletions inst/include/bvhar/mniw
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#ifndef BVHAR_MNIW_H
#define BVHAR_MNIW_H

#include "src/core/interrupt.h"

#include "src/bayes/mniw/minnesota.h"
#include "src/bayes/mniw/forecaster.h"
#include "src/bayes/mniw/spillover.h"

#endif // BVHAR_MNIW_H
8 changes: 8 additions & 0 deletions inst/include/bvhar/triangular
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#ifndef BVHAR_TRIANGULAR_H
#define BVHAR_TRIANGULAR_H

#include "src/bayes/triangular/triangular.h"
#include "src/bayes/triangular/forecaster.h"
#include "src/bayes/triangular/spillover.h"

#endif // BVHAR_TRIANGULAR_H
39 changes: 0 additions & 39 deletions python/src/bvhar/_src/_bayes.cpp

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,42 @@
#include <bvhar/forecast>
#include <bvhar/triangular>

PYBIND11_MODULE(_forecast, m) {
PYBIND11_MODULE(_cta, m) {
py::class_<bvhar::McmcRun<bvhar::McmcReg>>(m, "McmcLdlt")
.def(
py::init<int, int, int, int, const Eigen::MatrixXd&, const Eigen::MatrixXd&,
py::dict&, py::dict&, py::dict&,
std::vector<py::dict>&, int, const Eigen::VectorXi&, const Eigen::VectorXi&, const Eigen::VectorXi&,
const Eigen::MatrixXi&, bool, const Eigen::VectorXi&, bool, int>()
)
.def("returnRecords", &bvhar::McmcRun<bvhar::McmcReg>::returnRecords);

py::class_<bvhar::McmcRun<bvhar::McmcReg, false>>(m, "McmcLdltGrp")
.def(
py::init<int, int, int, int, const Eigen::MatrixXd&, const Eigen::MatrixXd&,
py::dict&, py::dict&, py::dict&,
std::vector<py::dict>&, int, const Eigen::VectorXi&, const Eigen::VectorXi&, const Eigen::VectorXi&,
const Eigen::MatrixXi&, bool, const Eigen::VectorXi&, bool, int>()
)
.def("returnRecords", &bvhar::McmcRun<bvhar::McmcReg, false>::returnRecords);

py::class_<bvhar::McmcRun<bvhar::McmcSv>>(m, "SvMcmc")
.def(
py::init<int, int, int, int, const Eigen::MatrixXd&, const Eigen::MatrixXd&,
py::dict&, py::dict&, py::dict&,
std::vector<py::dict>&, int, const Eigen::VectorXi&, const Eigen::VectorXi&, const Eigen::VectorXi&,
const Eigen::MatrixXi&, bool, const Eigen::VectorXi&, bool, int>()
)
.def("returnRecords", &bvhar::McmcRun<bvhar::McmcSv>::returnRecords);

py::class_<bvhar::McmcRun<bvhar::McmcSv, false>>(m, "SvGrpMcmc")
.def(
py::init<int, int, int, int, const Eigen::MatrixXd&, const Eigen::MatrixXd&,
py::dict&, py::dict&, py::dict&,
std::vector<py::dict>&, int, const Eigen::VectorXi&, const Eigen::VectorXi&, const Eigen::VectorXi&,
const Eigen::MatrixXi&, bool, const Eigen::VectorXi&, bool, int>()
)
.def("returnRecords", &bvhar::McmcRun<bvhar::McmcSv, false>::returnRecords);

py::class_<bvhar::McmcForecastRun<bvhar::RegForecaster>>(m, "LdltForecast")
.def(py::init<int, int, int, const Eigen::MatrixXd&, bool, double, py::dict&, const Eigen::VectorXi&, bool, bool, int, bool>())
.def(py::init<int, int, int, int, const Eigen::MatrixXd&, bool, double, py::dict&, const Eigen::VectorXi&, bool, bool, int, bool>())
Expand Down Expand Up @@ -170,4 +206,34 @@ PYBIND11_MODULE(_forecast, m) {
const Eigen::MatrixXi&, const Eigen::VectorXi&, bool, int, bool>()
)
.def("returnForecast", &bvhar::McmcVharforecastRun<bvhar::McmcExpandforecastRun, bvhar::SvForecaster, false>::returnForecast);

py::class_<bvhar::McmcSpilloverRun<bvhar::LdltRecords>>(m, "LdltSpillover")
.def(py::init<int, int, py::dict&, bool>())
.def(py::init<int, int, int, py::dict&, bool>())
.def("returnSpillover", &bvhar::McmcSpilloverRun<bvhar::LdltRecords>::returnSpillover);

py::class_<bvhar::DynamicLdltSpillover>(m, "LdltDynamicSpillover")
.def(
py::init<const Eigen::MatrixXd&, int, int, int, int, int, int, int, bool,
py::dict&, py::dict&, py::dict&, std::vector<py::dict>&, int, bool,
const Eigen::VectorXi&, const Eigen::VectorXi&, const Eigen::VectorXi&, const Eigen::MatrixXi&,
bool, const Eigen::MatrixXi&, int>()
)
.def(
py::init<const Eigen::MatrixXd&, int, int, int, int, int, int, int, int, bool,
py::dict&, py::dict&, py::dict&, std::vector<py::dict>&, int, bool,
const Eigen::VectorXi&, const Eigen::VectorXi&, const Eigen::VectorXi&, const Eigen::MatrixXi&,
bool, const Eigen::MatrixXi&, int>()
)
.def("returnSpillover", &bvhar::DynamicLdltSpillover::returnSpillover);

py::class_<bvhar::McmcSpilloverRun<bvhar::SvRecords>>(m, "SvSpillover")
.def(py::init<int, int, py::dict&, bool>())
.def(py::init<int, int, int, py::dict&, bool>())
.def("returnSpillover", &bvhar::McmcSpilloverRun<bvhar::SvRecords>::returnSpillover);

py::class_<bvhar::DynamicSvSpillover>(m, "SvDynamicSpillover")
.def(py::init<int, int, int, py::dict&, bool, bool, int>())
.def(py::init<int, int, int, int, py::dict&, bool, bool, int>())
.def("returnSpillover", &bvhar::DynamicSvSpillover::returnSpillover);
}
33 changes: 0 additions & 33 deletions python/src/bvhar/_src/_spillover.cpp

This file was deleted.

12 changes: 6 additions & 6 deletions python/src/bvhar/model/_bayes.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
from ..utils._misc import make_fortran_array, check_np, build_grpmat, process_record, concat_chain, concat_params, process_dens_forecast, process_dens_spillover, process_dens_vector_spillover, process_dens_list_spillover
from ..utils.checkomp import get_maxomp
from ..utils._utils import build_response, build_design
from .._src._bayes import McmcLdlt, McmcLdltGrp
from .._src._forecast import LdltForecast, LdltVarRoll, LdltVharRoll, LdltVarExpand, LdltVharExpand, LdltGrpVarRoll, LdltGrpVharRoll, LdltGrpVarExpand, LdltGrpVharExpand
from .._src._spillover import LdltSpillover, LdltDynamicSpillover
from .._src._bayes import SvMcmc, SvGrpMcmc
from .._src._forecast import SvForecast, SvVarRoll, SvVharRoll, SvVarExpand, SvVharExpand, SvGrpVarRoll, SvGrpVharRoll, SvGrpVarExpand, SvGrpVharExpand
from .._src._spillover import SvSpillover, SvDynamicSpillover
from .._src._cta import McmcLdlt, McmcLdltGrp
from .._src._cta import LdltForecast, LdltVarRoll, LdltVharRoll, LdltVarExpand, LdltVharExpand, LdltGrpVarRoll, LdltGrpVharRoll, LdltGrpVarExpand, LdltGrpVharExpand
from .._src._cta import LdltSpillover, LdltDynamicSpillover
from .._src._cta import SvMcmc, SvGrpMcmc
from .._src._cta import SvForecast, SvVarRoll, SvVharRoll, SvVarExpand, SvVharExpand, SvGrpVarRoll, SvGrpVharRoll, SvGrpVarExpand, SvGrpVharExpand
from .._src._cta import SvSpillover, SvDynamicSpillover
from ._spec import LdltConfig, SvConfig, InterceptConfig
from ._spec import _BayesConfig, SsvsConfig, HorseshoeConfig, MinnesotaConfig, DlConfig, NgConfig, GdpConfig
import numpy as np
Expand Down
Loading

0 comments on commit 7fe977e

Please sign in to comment.