- Joined
- 6/4/22
- Messages
- 40
- Points
- 118
Hi Forum,
I am trying to parse some C++ vector values into a JSON file in a following structure.
I am using the boost libraries such as <boost/property_tree/json_parser.hpp>.
However, I don't know how to save the vector data into the JSON in a format like: "Spot": [1.0, 2.0, 3.0, 4.0, 5.0].
Below is the data structure I want to achieve.
I am trying to parse some C++ vector values into a JSON file in a following structure.
I am using the boost libraries such as <boost/property_tree/json_parser.hpp>.
However, I don't know how to save the vector data into the JSON in a format like: "Spot": [1.0, 2.0, 3.0, 4.0, 5.0].
Below is the data structure I want to achieve.
JSON:
{
"Crank-Nicolson" : {
"Spot": [1.0, 2.0, 3.0, 4.0, 5.0],
"PV": [11.0, 12.0, 13.0, 14.0, 15.0],
"Delta": [21.0, 22.0, 23.0, 24.0, 25.0],
},
"Explicit Euler" : {
"Spot": [1.0, 2.0, 3.0, 4.0, 5.0],
"PV": [11.0, 12.0, 13.0, 14.0, 15.0],
"Delta": [21.0, 22.0, 23.0, 24.0, 25.0],
},
"Implicit Euler" : {
"Spot": [1.0, 2.0, 3.0, 4.0, 5.0],
"PV": [11.0, 12.0, 13.0, 14.0, 15.0],
"Delta": [21.0, 22.0, 23.0, 24.0, 25.0],
}
}