Beispiel #1
0
 array_proxy ( FileGroupType file_group, std::string const & name) :
  indexmap_ ( indexmap_type(file_group.openDataSet( name.c_str() ).getSpace(),T_is_complex) ) { 
   if (!h5::exists(file_group, name)) TRIQS_RUNTIME_ERROR<< " h5 : no dataset"<< name << " in file "; 
   storage_ = std::make_pair( boost::make_shared<FileGroupType>(file_group),name);
   DataSet dataset = file_group.openDataSet( name.c_str() );
   try { if (T_is_complex) write_attribute(dataset,"__complex__","1"); } 
   catch (...) {} // catch if the attribute already exists...
  }
Beispiel #2
0
   array_proxy ( FileGroupType file_group, std::string const & name_, LengthType L, bool overwrite = false) :
    indexmap_ ( indexmap_type (L) ) 
 { 
  if (h5::exists(file_group, name_)) {
   if (overwrite) file_group.unlink(name_.c_str());  
   else TRIQS_RUNTIME_ERROR<< " h5 : dataset"<< name_ << " already exists in the file "; 
  }
  storage_ = std::make_pair( boost::make_shared<FileGroupType>(file_group),name_);
  DataSpace ds  = indexmap_.template dataspace<T_is_complex>(); //(indexmap_type::rank_full, &indexmap_.lengths()[0], &indexmap_.strides()[0]  );
  DataSet dataset = file_group.createDataSet( name_.c_str(), data_type_file(ValueType()), ds);
  if (T_is_complex) write_attribute(dataset,"__complex__","1");
 }
Beispiel #3
0
 array(const T & X, typename boost::enable_if< is_array_assign_lhs<T> >::type *dummy =0):
  BaseType(indexmap_type(X.domain())) { assignment(*this,X); }