Janus 2.0.0
High-performance C++20 dual-mode numerical framework
Loading...
Searching...
No Matches
janus::utils Namespace Reference

Functions

void write_json (const std::string &filename, const std::map< std::string, std::vector< double > > &data)
 Write a map of string-to-vector<double> as JSON.
std::map< std::string, std::vector< double > > read_json (const std::string &filename)
 Parse a flat JSON file into a string-to-vector<double> map.

Function Documentation

◆ read_json()

std::map< std::string, std::vector< double > > janus::utils::read_json ( const std::string & filename)
inline

Parse a flat JSON file into a string-to-vector<double> map.

Parameters
filenameInput file path (must contain a top-level object with array values)
Returns
Parsed map of key to numeric vector

◆ write_json()

void janus::utils::write_json ( const std::string & filename,
const std::map< std::string, std::vector< double > > & data )
inline

Write a map of string-to-vector<double> as JSON.

Parameters
filenameOutput file path
dataMap of key-value pairs to serialize