Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

modified makefile and some interfaces have changed #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.vscode
test/test*.h5
test/write_test
package/inst
Expand Down
26 changes: 13 additions & 13 deletions h5read.cc
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ check_vec (const octave_value& val, Matrix& mat/*out*/,
if (error_state)
return 0;

if (! mat.isvector ())
if (! mat.is_vector ())
{
error ("%s must be a vector", name);
return 0;
Expand Down Expand Up @@ -599,7 +599,7 @@ H5File::H5File (const char *filename, const bool create_if_nonexisting,
//suppress hdf5 error output
H5Eset_auto (H5E_DEFAULT,0,0);

octave::sys::file_stat fs (filename);
file_stat fs (filename);
if (! fs.exists () && create_if_nonexisting)
file = H5Fcreate (filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
else if (! fs.exists () && ! create_if_nonexisting)
Expand Down Expand Up @@ -755,8 +755,8 @@ H5File::read_dset_hyperslab (const char *dsetname,
if (open_dset (dsetname) < 0)
return octave_value ();

if (rank == 0 && ! (start.isempty () && count.isempty ()
&& stride.isempty () && block.isempty ()))
if (rank == 0 && ! (start.is_empty () && count.is_empty ()
&& stride.is_empty () && block.is_empty ()))
{
error ("Cannot specify hyperslab for scalar datasets (rank 0)");
return octave_value ();
Expand Down Expand Up @@ -1019,7 +1019,7 @@ H5File::write_dset (const char *dsetname,

herr_t status;
// find the right type
if (ov_data.iscomplex ())
if (ov_data.is_complex_type())
{
//check if the data set already exists. if it does, open it,
//otherwise, create it. Furthermore check if the datatype is
Expand All @@ -1045,7 +1045,7 @@ H5File::write_dset (const char *dsetname,
ComplexNDArray data = ov_data.complex_array_value ();
OPEN_AND_WRITE;
}
else if (ov_data.isinteger ())
else if (ov_data.is_integer_type ())
{
if (ov_data.is_uint64_type ())
{
Expand Down Expand Up @@ -1137,8 +1137,8 @@ H5File::write_dset_hyperslab (const char *dsetname,
return;

// check if the given hyperslab settings are reasonable
if (rank == 0 && ! (start.isempty () && count.isempty ()
&& stride.isempty () && block.isempty ()))
if (rank == 0 && ! (start.is_empty () && count.is_empty ()
&& stride.is_empty () && block.is_empty ()))
{
error ("Cannot specify hyperslab for scalar datasets (rank 0)");
return;
Expand Down Expand Up @@ -1463,22 +1463,22 @@ H5File::write_att (const char *location, const char *attname,

buf = (void *) attvalue.string_value ().c_str ();
}
else if (attvalue.isinteger ())
else if (attvalue.is_integer_type ())
{
//type_id = H5Tcopy (H5T_STD_I64LE); //cannot read this back in then, don't know why
type_id = H5Tcopy (H5T_NATIVE_INT);
mem_type_id = H5Tcopy (H5T_NATIVE_INT);
attval_int = attvalue.int_value ();
buf = (void *) &attval_int;
}
else if (attvalue.isreal ())
else if (attvalue.is_real_type ())
{
type_id = H5Tcopy (H5T_NATIVE_DOUBLE);
mem_type_id = H5Tcopy (H5T_NATIVE_DOUBLE);
attval_double = attvalue.double_value ();
buf = (void *) &attval_double;
}
else if (attvalue.iscomplex ())
else if (attvalue.is_complex_type ())
{
error ("complex values are not supported by the HDF5 format. \
You have to save real and imag part separately.");
Expand Down Expand Up @@ -1575,14 +1575,14 @@ H5File::create_dset (const char *location, const Matrix& size,
free (dims);
free (maxdims);

if (any_int_leq_zero (size) && chunksize.isempty ())
if (any_int_leq_zero (size) && chunksize.is_empty())
{
error ("If the size argument contains an Inf or zero element, then ChunkSize must be specified.");
return;
}
// get a dataset creation property list
hid_t crp_list = H5Pcreate (H5P_DATASET_CREATE);
if (! chunksize.isempty ())
if (! chunksize.is_empty())
{
// a dataset with an unlimited dimension must be chunked.
if (chunksize(0) == 0)
Expand Down
2 changes: 1 addition & 1 deletion makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ objs=$(src:.cc=.o)
H5FLAGS=$(shell octave --eval 'exit(__octave_config_info__ ("build_features").HDF5 != 1)' &> /dev/null && echo "-DHAVE_HDF5") \
$(shell octave --eval 'exit(__octave_config_info__ ("build_features").HDF5_18 != 1)' &> /dev/null && echo "-DHAVE_HDF5_18")

MKOCTFILE=CXX="$(CXX)" CXXFLAGS="-ansi" mkoctfile -v -std=c++11 $(H5FLAGS)
MKOCTFILE=CXX="$(CXX)" CXXFLAGS="-ansi -std=c++11" mkoctfile -v $(H5FLAGS)

VERSION=0.5.0
PACKAGEFILE=hdf5oct-$(VERSION).tar.gz
Expand Down