本文整理汇总了C++中h5::group::get_all_subgroup_names方法的典型用法代码示例。如果您正苦于以下问题:C++ group::get_all_subgroup_names方法的具体用法?C++ group::get_all_subgroup_names怎么用?C++ group::get_all_subgroup_names使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类h5::group
的用法示例。
在下文中一共展示了group::get_all_subgroup_names方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: read
template <bool IsView> static void read(h5::group gr, gf_impl<block_index, Target, Opt, IsView, false> &g) {
// does not work : need to read the block name and remake the mesh...
g._mesh = gf_mesh<block_index, Opt>(gr.get_all_subgroup_names());
g._data.resize(g._mesh.size());
// if (g._data.size() != g._mesh.size()) TRIQS_RUNTIME_ERROR << "h5 read block gf : number of block mismatch";
for (size_t i = 0; i < g.mesh().size(); ++i) h5_read(gr, g.mesh().domain().names()[i], g._data[i]);
// h5_read(gr,"symmetry",g._symmetry);
}
示例2: catch
void h5_read ( h5::group F, std::string const & subgroup_name, parameters & p){
auto gr = F.open_group(subgroup_name);
std::vector<std::string> ds_name = F.get_all_dataset_names(subgroup_name), grp_name = F.get_all_subgroup_names(subgroup_name);
for (auto & x : grp_name) {
//std::cerr << " loading group : "<< x <<std::endl;
auto x_grp = gr.open_group(x);
auto triqs_data_scheme = x_grp.read_triqs_hdf5_data_scheme();
if (triqs_data_scheme != "") {
auto type_hash = _object::h5_scheme_to_code[triqs_data_scheme];
auto it = _object::code_to_h5_read_fnts.find(type_hash);
if (it == _object::code_to_h5_read_fnts.end()) TRIQS_RUNTIME_ERROR << "TRIQS_HDF5_data_scheme : ["<< triqs_data_scheme << "] is unknown. Did you register your object ?";
p[x] = it->second(gr,x);
}
else {
parameters p2;
h5_read (gr,x,p2);
p[x] = p2;
}
}
for (auto & x : ds_name) {
//std::cerr << " loading : "<< x <<std::endl;
try {
_object obj;
h5_read(gr,x,obj);
p[x] = obj;
}
catch(H5::Exception const & e) { TRIQS_RUNTIME_ERROR<< "Cannot load "<< x<<"\n H5 error is : \n "<< e.getCDetailMsg();}
}
}