|
DNDSR 0.1.0.dev1+gcd065ad
Distributed Numeric Data Structure for CFV
|
JSON-to-Eigen conversion utilities and nlohmann_json helper macros. More...
#include "Defines.hpp"#include <nlohmann/json.hpp>#include "EigenUtil.hpp"#include "DeviceStorage.hpp"#include "Vector.hpp"Go to the source code of this file.
Namespaces | |
| namespace | DNDS |
| the host side operators are provided as implemented | |
| namespace | Eigen |
Macros | |
| #define | JSON_ASSERT DNDS_assert |
| #define | __DNDS__json_to_config(name) |
Helper macro: read (read == true) or write (read == false) a named member into / out of a jsonObj. | |
| #define | DNDS_NLOHMANN_DEFINE_TYPE_INTRUSIVE_WITH_ORDERED_JSON(Type, ...) |
Like NLOHMANN_DEFINE_TYPE_INTRUSIVE but targets nlohmann::ordered_json. | |
| #define | DNDS_NLOHMANN_DEFINE_TYPE_INTRUSIVE_WITH_ORDERED_AND_UNORDERED_JSON(Type, ...) |
Like DNDS_NLOHMANN_DEFINE_TYPE_INTRUSIVE_WITH_ORDERED_JSON but additionally installs the unordered-JSON overloads for interop with code that uses nlohmann::json directly. | |
Typedefs | |
| using | DNDS::t_jsonconfig = nlohmann::ordered_json |
| Project-wide JSON type alias: nlohmann/json with ordered keys. | |
Functions | |
| Eigen::VectorXd | DNDS::JsonGetEigenVector (const nlohmann::json &arr) |
Parse a JSON array into an Eigen::VectorXd. Throws a descriptive assertion on any JSON error. | |
| Eigen::VectorFMTSafe< real, -1 > | DNDS::JsonGetEigenVectorFMTSafe (const nlohmann::json &arr) |
Parse a JSON array into an Eigen::VectorFMTSafe (fixed-point-aware wrapper). | |
| auto | DNDS::EigenVectorGetJson (const Eigen::VectorXd &ve) |
Dump an Eigen::VectorXd into a JSON array of doubles. | |
| auto | DNDS::EigenVectorFMTSafeGetJson (const Eigen::VectorFMTSafe< real, -1 > &ve) |
Dump an Eigen::VectorFMTSafe into a JSON array of doubles. | |
| void | Eigen::to_json (nlohmann::json &j, const VectorXd &v) |
| void | Eigen::from_json (const nlohmann::json &j, VectorXd &v) |
| void | Eigen::to_json (nlohmann::ordered_json &j, const VectorXd &v) |
| void | Eigen::from_json (const nlohmann::ordered_json &j, VectorXd &v) |
| void | Eigen::to_json (nlohmann::ordered_json &j, const VectorFMTSafe< DNDS::real, -1 > &v) |
| void | Eigen::from_json (const nlohmann::ordered_json &j, VectorFMTSafe< DNDS::real, -1 > &v) |
| void | Eigen::to_json (nlohmann::ordered_json &j, const Vector3d &v) |
| void | Eigen::from_json (const nlohmann::ordered_json &j, Vector3d &v) |
| void | DNDS::to_json (nlohmann::ordered_json &j, const host_device_vector< real > &v) |
| void | DNDS::from_json (const nlohmann::ordered_json &j, host_device_vector< real > &v) |
JSON-to-Eigen conversion utilities and nlohmann_json helper macros.
Definition in file JsonUtil.hpp.
| #define __DNDS__json_to_config | ( | name | ) |
Helper macro: read (read == true) or write (read == false) a named member into / out of a jsonObj.
Used in the common pattern of mirroring a config struct between JSON and C++:
Errors during reading are surfaced via DNDS_assert_info with the member name.
Definition at line 98 of file JsonUtil.hpp.
| #define DNDS_NLOHMANN_DEFINE_TYPE_INTRUSIVE_WITH_ORDERED_AND_UNORDERED_JSON | ( | Type, | |
| ... | |||
| ) |
Like DNDS_NLOHMANN_DEFINE_TYPE_INTRUSIVE_WITH_ORDERED_JSON but additionally installs the unordered-JSON overloads for interop with code that uses nlohmann::json directly.
Definition at line 125 of file JsonUtil.hpp.
| #define DNDS_NLOHMANN_DEFINE_TYPE_INTRUSIVE_WITH_ORDERED_JSON | ( | Type, | |
| ... | |||
| ) |
Like NLOHMANN_DEFINE_TYPE_INTRUSIVE but targets nlohmann::ordered_json.
DNDSR prefers ordered JSON for configuration; this macro wires up both to_json and from_json friend functions against the ordered type.
Definition at line 118 of file JsonUtil.hpp.
| #define JSON_ASSERT DNDS_assert |
Definition at line 6 of file JsonUtil.hpp.