23 #ifndef O2SCL_HDF_IO_H 24 #define O2SCL_HDF_IO_H 29 #include <boost/numeric/ublas/vector.hpp> 31 #include <o2scl/hdf_file.h> 32 #include <o2scl/table.h> 33 #include <o2scl/table_units.h> 34 #include <o2scl/hist.h> 35 #include <o2scl/hist_2d.h> 36 #include <o2scl/table3d.h> 37 #include <o2scl/tensor_grid.h> 38 #include <o2scl/expval.h> 39 #include <o2scl/contour.h> 40 #include <o2scl/uniform_grid.h> 48 void hdf_output(hdf_file &hf,
o2scl::table<> &t, std::string name);
50 #ifndef O2SCL_NO_HDF_INPUT 62 if (name.length()==0) {
64 if (name.length()==0) {
65 O2SCL_ERR2(
"No object of type table found in ",
105 if (type2!=
"table") {
106 O2SCL_ERR2(
"Typename in HDF group does not match ",
111 std::vector<std::string> cnames, cols;
118 if (cnames.size()!=cvalues.size()) {
119 O2SCL_ERR2(
"Size mismatch between constant names and values ",
122 for(
size_t i=0;i<cnames.size();i++) {
128 for(
size_t i=0;i<cols.size();i++) {
134 hf.
geti(
"nlines",nlines2);
148 ubvector vtmp(nlines2);
150 for(
int j=0;j<nlines2;j++) {
180 template<
class vec_t>
185 if (name.length()==0) {
187 if (name.length()==0) {
188 O2SCL_ERR2(
"No object of type table found in ",
216 template<
class vec_t>
228 hf.
geti(
"unit_flag",uf);
232 std::vector<std::string> units;
234 for(
size_t i=0;i<units.size();i++) {
271 std::string name=
"");
273 void hdf_output(
hdf_file &hf, std::vector<o2scl::contour_line> &cl,
277 std::string name=
"");
279 void hdf_output(
hdf_file &hf, std::vector<o2scl::edge_crossings> &ec,
283 std::string name=
"");
286 std::vector<size_t> > &t, std::string name);
289 std::vector<size_t> > &t, std::string name=
"");
void clear_table()
Clear the table and the column names (but leave constants)
Tensor class with arbitrary dimensions with a grid.
Matrix expectation value.
int geti(std::string name, int &i)
Get a integer named name.
int get_szt_def(std::string name, size_t def, size_t &i)
Get a size_t named name.
int find_group_by_type(std::string type, std::string &group_name, int verbose=0)
Look in hdf_file hf for an O<span style='position: relative; top: 0.3em; font-size: 0...
void hdf_input_data(hdf_file &hf, o2scl::table< vec_t > &t)
Internal function for inputting a o2scl::table object.
void set_nlines(size_t il)
Set the number of lines.
invalid argument supplied by user
A two-dimensional histogram class.
void check_synchro() const
Return 0 if the tree and list are properly synchronized.
hid_t get_current_id()
Retrieve the current working id.
A one-dimensional histogram class.
int close_group(hid_t group)
Close a previously created group.
void set_unit(std::string scol, std::string unit)
Set the unit for column scol to unit.
Cubic spline for natural boundary conditions.
int gets_fixed(std::string name, std::string &s)
Get a fixed-length string named name.
Vector expectation value.
#define O2SCL_ERR2(d, d2, n)
Set an error, two-string version.
The O<span style='position: relative; top: 0.3em; font-size: 0.8em'>2</span>scl O$_2$scl namespace ...
void set_current_id(hid_t cur)
Set the current working id.
virtual void add_constant(std::string name, double val)
Add a constant, or if the constant already exists, change its value.
Scalar expectation value.
size_t get_ncolumns() const
Return the number of columns.
Data table table class with units.
void new_column(std::string head)
Add a new column owned by the table table .
A data structure containing many slices of two-dimensional data points defined on a grid...
Store data in an O<span style='position: relative; top: 0.3em; font-size: 0.8em'>2</span>scl O$_2$sc...
void set(std::string scol, size_t row, double val)
Set row row of column named col to value val . .
int gets_vec(std::string name, std::vector< std::string > &s)
Get a vector of strings named name and store it in s.
int getd_vec_copy(std::string name, vec_t &v)
Get vector dataset and place data in v.
size_t itype
Current interpolation type.
std::string get_column_name(size_t icol) const
Returns the name of column col .
void hdf_input(hdf_file &hf, o2scl::table< vec_t > &t, std::string name)
Input a o2scl::table object from a hdf_file.
void clear_constants()
CLear all constants.
hid_t open_group(hid_t init_id, std::string path)
Open a group relative to the location specified in init_id.