Mercurial > forge
comparison main/fixed/src/ov-fixed-cx-mat.cc @ 9931:58d36e8880db octave-forge
Description: Make the package compile against HDF5 1.8
Author: Rafael Laboissiere <rafael@laboissiere.net>
author | jordigh |
---|---|
date | Fri, 30 Mar 2012 15:59:45 +0000 |
parents | d84d2fea3c90 |
children | 2deb6b24d293 |
comparison
equal
deleted
inserted
replaced
9930:d30cfca46e8a | 9931:58d36e8880db |
---|---|
614 bool | 614 bool |
615 octave_fixed_complex_matrix::save_hdf5 (hid_t loc_id, const char *name, | 615 octave_fixed_complex_matrix::save_hdf5 (hid_t loc_id, const char *name, |
616 bool save_as_floats) | 616 bool save_as_floats) |
617 { | 617 { |
618 hid_t group_hid = -1; | 618 hid_t group_hid = -1; |
619 group_hid = H5Gcreate (loc_id, name, 0); | 619 group_hid = H5Gcreate (loc_id, name, 0, H5P_DEFAULT, H5P_DEFAULT); |
620 if (group_hid < 0 ) return false; | 620 if (group_hid < 0 ) return false; |
621 | 621 |
622 dim_vector d = dims (); | 622 dim_vector d = dims (); |
623 OCTAVE_LOCAL_BUFFER(hsize_t, hdims, d.length () > 2 ? d.length () : 3); | 623 OCTAVE_LOCAL_BUFFER(hsize_t, hdims, d.length () > 2 ? d.length () : 3); |
624 hid_t space_hid = -1, data_hid = -1, type_hid = -1; | 624 hid_t space_hid = -1, data_hid = -1, type_hid = -1; |
642 H5Sclose (space_hid); | 642 H5Sclose (space_hid); |
643 H5Gclose (group_hid); | 643 H5Gclose (group_hid); |
644 return false; | 644 return false; |
645 } | 645 } |
646 | 646 |
647 data_hid = H5Dcreate (group_hid, "int", type_hid, space_hid, H5P_DEFAULT); | 647 data_hid = H5Dcreate (group_hid, "int", type_hid, space_hid, H5P_DEFAULT, |
648 H5P_DEFAULT, H5P_DEFAULT); | |
648 if (data_hid < 0) | 649 if (data_hid < 0) |
649 { | 650 { |
650 H5Sclose (space_hid); | 651 H5Sclose (space_hid); |
651 H5Tclose (type_hid); | 652 H5Tclose (type_hid); |
652 H5Gclose (group_hid); | 653 H5Gclose (group_hid); |
669 H5Tclose (type_hid); | 670 H5Tclose (type_hid); |
670 H5Gclose (group_hid); | 671 H5Gclose (group_hid); |
671 return false; | 672 return false; |
672 } | 673 } |
673 | 674 |
674 data_hid = H5Dcreate (group_hid, "dec", type_hid, space_hid, H5P_DEFAULT); | 675 data_hid = H5Dcreate (group_hid, "dec", type_hid, space_hid, H5P_DEFAULT, |
676 H5P_DEFAULT, H5P_DEFAULT); | |
675 if (data_hid < 0) | 677 if (data_hid < 0) |
676 { | 678 { |
677 H5Sclose (space_hid); | 679 H5Sclose (space_hid); |
678 H5Tclose (type_hid); | 680 H5Tclose (type_hid); |
679 H5Gclose (group_hid); | 681 H5Gclose (group_hid); |
705 H5Sclose (space_hid); | 707 H5Sclose (space_hid); |
706 H5Gclose (group_hid); | 708 H5Gclose (group_hid); |
707 return false; | 709 return false; |
708 } | 710 } |
709 | 711 |
710 data_hid = H5Dcreate (group_hid, "num", type_hid, space_hid, H5P_DEFAULT); | 712 data_hid = H5Dcreate (group_hid, "num", type_hid, space_hid, H5P_DEFAULT, |
713 H5P_DEFAULT, H5P_DEFAULT); | |
711 if (data_hid < 0) | 714 if (data_hid < 0) |
712 { | 715 { |
713 H5Sclose (space_hid); | 716 H5Sclose (space_hid); |
714 H5Tclose (type_hid); | 717 H5Tclose (type_hid); |
715 H5Gclose (group_hid); | 718 H5Gclose (group_hid); |
738 { | 741 { |
739 herr_t retval = -1; | 742 herr_t retval = -1; |
740 hid_t group_hid, data_hid, space_id, type_hid; | 743 hid_t group_hid, data_hid, space_id, type_hid; |
741 hsize_t rank, rank_old; | 744 hsize_t rank, rank_old; |
742 | 745 |
743 group_hid = H5Gopen (loc_id, name); | 746 group_hid = H5Gopen (loc_id, name, H5P_DEFAULT); |
744 if (group_hid < 0 ) return false; | 747 if (group_hid < 0 ) return false; |
745 | 748 |
746 hid_t complex_type = hdf5_make_fixed_complex_type (H5T_NATIVE_UINT, | 749 hid_t complex_type = hdf5_make_fixed_complex_type (H5T_NATIVE_UINT, |
747 sizeof(unsigned int)); | 750 sizeof(unsigned int)); |
748 | 751 |
749 data_hid = H5Dopen (group_hid, "int"); | 752 data_hid = H5Dopen (group_hid, "int", H5P_DEFAULT); |
750 type_hid = H5Dget_type (data_hid); | 753 type_hid = H5Dget_type (data_hid); |
751 | 754 |
752 if (! hdf5_types_compatible (type_hid, complex_type)) | 755 if (! hdf5_types_compatible (type_hid, complex_type)) |
753 { | 756 { |
754 H5Tclose(complex_type); | 757 H5Tclose(complex_type); |
808 return false; | 811 return false; |
809 } | 812 } |
810 H5Tclose(type_hid); | 813 H5Tclose(type_hid); |
811 H5Dclose (data_hid); | 814 H5Dclose (data_hid); |
812 | 815 |
813 data_hid = H5Dopen (group_hid, "dec"); | 816 data_hid = H5Dopen (group_hid, "dec", H5P_DEFAULT); |
814 type_hid = H5Dget_type (data_hid); | 817 type_hid = H5Dget_type (data_hid); |
815 | 818 |
816 if (! hdf5_types_compatible (type_hid, complex_type)) | 819 if (! hdf5_types_compatible (type_hid, complex_type)) |
817 { | 820 { |
818 H5Tclose(complex_type); | 821 H5Tclose(complex_type); |
873 return false; | 876 return false; |
874 } | 877 } |
875 H5Tclose(type_hid); | 878 H5Tclose(type_hid); |
876 H5Dclose (data_hid); | 879 H5Dclose (data_hid); |
877 | 880 |
878 data_hid = H5Dopen (group_hid, "num"); | 881 data_hid = H5Dopen (group_hid, "num", H5P_DEFAULT); |
879 type_hid = H5Dget_type (data_hid); | 882 type_hid = H5Dget_type (data_hid); |
880 | 883 |
881 if (! hdf5_types_compatible (type_hid, complex_type)) | 884 if (! hdf5_types_compatible (type_hid, complex_type)) |
882 { | 885 { |
883 H5Tclose(complex_type); | 886 H5Tclose(complex_type); |