Skip to content

Commit

Permalink
Allow for serialization of imfreq_ops and imtime_ops
Browse files Browse the repository at this point in the history
  • Loading branch information
Wentzell committed Aug 8, 2024
1 parent f2c2376 commit b0ea7c5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
8 changes: 7 additions & 1 deletion c++/cppdlr/dlr_imfreq.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,9 +258,15 @@ namespace cppdlr {
nda::vector<int> piv; ///< LU pivots (LAPACK format) of imaginary frequency vals -> coefs matrix
} if2cf;

// -------------------- hdf5 -------------------
// -------------------- serialization -------------------

public:
template <class Archive> void serialize(Archive &ar) { //
ar & lambda_ & statistic & r & niom & dlr_rf & dlr_if & cf2if & if2cf.lu & if2cf.piv;
}

// -------------------- hdf5 -------------------

static std::string hdf5_format() { return "cppdlr::imfreq_ops"; }

friend void h5_write(h5::group fg, std::string const &subgroup_name, imfreq_ops const &m) {
Expand Down
8 changes: 7 additions & 1 deletion c++/cppdlr/dlr_imtime.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -828,9 +828,15 @@ namespace cppdlr {
// Array used for dlr_imtime::reflect
mutable nda::matrix<double> refl; ///< Matrix of reflection

// -------------------- hdf5 -------------------
// -------------------- serialization -------------------

public:
template <class Archive> void serialize(Archive &ar) { //
ar & lambda_ & r & dlr_rf & dlr_it & cf2it & it2cf.lu & it2cf.zlu & it2cf.piv & hilb & tcf2it & thilb & ttcf2it & ipmat & refl;
}

// -------------------- hdf5 -------------------

static std::string hdf5_format() { return "cppdlr::imtime_ops"; }

friend void h5_write(h5::group fg, std::string const &subgroup_name, imtime_ops const &m) {
Expand Down

0 comments on commit b0ea7c5

Please sign in to comment.