28QuantLib::ext::shared_ptr<ore::data::InMemoryReport>
30 const QuantLib::ext::shared_ptr<ore::data::InMemoryReport>& report) {
31 QuantLib::ext::shared_ptr<ore::data::InMemoryReport> newReport =
32 QuantLib::ext::make_shared<ore::data::InMemoryReport>();
33 if (report !=
nullptr) {
34 newReport->addColumn(columnName,
string());
35 for (
size_t i = 0; i < report->columns(); i++) {
36 newReport->addColumn(report->header(i), report->columnType(i), report->columnPrecision(i));
38 for (
size_t row = 0; row < report->rows(); row++) {
40 newReport->add(
value);
41 for (
size_t col = 0; col < report->columns(); col++) {
42 newReport->add(report->data(col)[row]);
50QuantLib::ext::shared_ptr<ore::data::InMemoryReport>
52 const QuantLib::ext::shared_ptr<ore::data::InMemoryReport>& report) {
53 QuantLib::ext::shared_ptr<ore::data::InMemoryReport> newReport =
54 QuantLib::ext::make_shared<ore::data::InMemoryReport>();
55 if (report !=
nullptr && newColsReport->rows() == 1) {
57 for (
size_t i = 0; i < newColsReport->columns(); ++i) {
58 newReport->addColumn(newColsReport->header(i), newColsReport->columnType(i),
59 newColsReport->columnPrecision(i));
61 for (
size_t i = 0; i < report->columns(); i++) {
62 newReport->addColumn(report->header(i), report->columnType(i), report->columnPrecision(i));
64 for (
size_t row = 0; row < report->rows(); row++) {
66 for (
size_t i = 0; i < newColsReport->columns(); ++i) {
67 newReport->add(newColsReport->data(i)[0]);
69 for (
size_t col = 0; col < report->columns(); col++) {
70 newReport->add(report->data(col)[row]);
78QuantLib::ext::shared_ptr<ore::data::InMemoryReport>
79concatenateReports(
const std::vector<QuantLib::ext::shared_ptr<ore::data::InMemoryReport>>& reports) {
80 if (!reports.empty() && reports.front() !=
nullptr) {
81 auto firstReport = reports.front();
82 QuantLib::ext::shared_ptr<InMemoryReport> concatenatedReport =
83 QuantLib::ext::make_shared<InMemoryReport>(*firstReport);
84 for (
size_t i = 1; i < reports.size(); i++) {
85 if (reports[i] !=
nullptr) {
86 concatenatedReport->add(*reports[i]);
89 return concatenatedReport;
SafeStack< ValueType > value
QuantLib::ext::shared_ptr< ore::data::InMemoryReport > addColumnToExisitingReport(const std::string &columnName, const std::string &value, const QuantLib::ext::shared_ptr< ore::data::InMemoryReport > &report)
QuantLib::ext::shared_ptr< ore::data::InMemoryReport > concatenateReports(const std::vector< QuantLib::ext::shared_ptr< ore::data::InMemoryReport > > &reports)
QuantLib::ext::shared_ptr< ore::data::InMemoryReport > addColumnsToExisitingReport(const QuantLib::ext::shared_ptr< ore::data::InMemoryReport > &newColsReport, const QuantLib::ext::shared_ptr< ore::data::InMemoryReport > &report)
Serializable Credit Default Swap.
Utilities functions for reports.