Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
cube_io.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2023 Quaternion Risk Management Ltd
3 All rights reserved.
4
5 This file is part of ORE, a free-software/open-source library
6 for transparent pricing and risk analysis - http://opensourcerisk.org
7
8 ORE is free software: you can redistribute it and/or modify it
9 under the terms of the Modified BSD License. You should have received a
10 copy of the license along with this program.
11 The license is also available online at <http://opensourcerisk.org>
12
13 This program is distributed on the basis that it will form a useful
14 contribution to risk analytics and model standardisation, but WITHOUT
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 FITNESS FOR A PARTICULAR PURPOSE. See the license for more details.
17*/
18
19/*! \file orea/cube/cube_io.hpp
20 \brief load / save cubes and agg scen data from / to disk
21 \ingroup cube
22*/
23
24#pragma once
25
26#include <orea/cube/npvcube.hpp>
29
30namespace ore {
31namespace analytics {
32
33/*! We save / load the npv cube data toegther with some meta data that is used to set up the CubeInterpretation. This is
34 to ensure that the cube interpretation is consistent with the cube that we load from disk. The meta data overwrites
35 the config in ore.xml / simulation.xml. All meta data is optional, i.e. if not given in the cube file, the original
36 config will be used. */
37
39 QuantLib::ext::shared_ptr<NPVCube> cube;
40 // all of the following members are optional
41 QuantLib::ext::shared_ptr<ScenarioGeneratorData> scenarioGeneratorData;
42 boost::optional<bool> storeFlows;
43 boost::optional<Size> storeCreditStateNPVs;
44};
45
46NPVCubeWithMetaData loadCube(const std::string& filename, const bool doublePrecision = false);
47void saveCube(const std::string& filename, const NPVCubeWithMetaData& cube, const bool doublePrecision = false);
48
49QuantLib::ext::shared_ptr<AggregationScenarioData> loadAggregationScenarioData(const std::string& filename);
50void saveAggregationScenarioData(const std::string& filename, const AggregationScenarioData& cube);
51
52} // namespace analytics
53} // namespace ore
this class holds data associated to scenarios
Container for storing simulated market data.
QuantLib::ext::shared_ptr< AggregationScenarioData > loadAggregationScenarioData(const std::string &filename)
Definition: cube_io.cpp:234
void saveCube(const std::string &filename, const NPVCubeWithMetaData &cube, const bool doublePrecision)
Definition: cube_io.cpp:167
void saveAggregationScenarioData(const std::string &filename, const AggregationScenarioData &cube)
Definition: cube_io.cpp:302
NPVCubeWithMetaData loadCube(const std::string &filename, const bool doublePrecision)
Definition: cube_io.cpp:63
The base NPV cube class.
Scenario generator configuration.
QuantLib::ext::shared_ptr< NPVCube > cube
Definition: cube_io.hpp:39
QuantLib::ext::shared_ptr< ScenarioGeneratorData > scenarioGeneratorData
Definition: cube_io.hpp:41
boost::optional< Size > storeCreditStateNPVs
Definition: cube_io.hpp:43
boost::optional< bool > storeFlows
Definition: cube_io.hpp:42