SHOGUN  3.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HDF5File.cpp
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or modify
3  * it under the terms of the GNU General Public License as published by
4  * the Free Software Foundation; either version 3 of the License, or
5  * (at your option) any later version.
6  *
7  * Written (W) 2010 Soeren Sonnenburg
8  * Copyright (C) 2010 Berlin Institute of Technology
9  */
10 
11 #include <shogun/lib/config.h>
12 
13 #ifdef HAVE_HDF5
14 #include <stdio.h>
15 #include <string.h>
16 #include <hdf5.h>
17 
18 #include <shogun/lib/memory.h>
19 #include <shogun/io/HDF5File.h>
20 #include <shogun/io/SGIO.h>
21 
22 using namespace shogun;
23 
24 CHDF5File::CHDF5File()
25 {
26  SG_UNSTABLE("CHDF5File::CHDF5File()", "\n")
27 
28  get_boolean_type();
29  h5file = -1;
30 }
31 
32 CHDF5File::CHDF5File(char* fname, char rw, const char* name) : CFile()
33 {
34  get_boolean_type();
35  H5Eset_auto2(H5E_DEFAULT, NULL, NULL);
36 
37  if (name)
38  set_variable_name(name);
39 
40  switch (rw)
41  {
42  case 'r':
43  h5file = H5Fopen(fname, H5F_ACC_RDONLY, H5P_DEFAULT);
44  break;
45  case 'w':
46  h5file = H5Fcreate(fname, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
47  break;
48  case 'a':
49  h5file = H5Fopen(fname, H5F_ACC_RDWR, H5P_DEFAULT);
50  if (h5file <0)
51  h5file = H5Fcreate(fname, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
52  break;
53  default:
54  SG_ERROR("unknown mode '%c'\n", rw)
55  };
56 
57  if (h5file<0)
58  SG_ERROR("Could not open file '%s'\n", fname)
59 }
60 
61 CHDF5File::~CHDF5File()
62 {
63  H5Fclose(h5file);
64 }
65 
66 #define GET_VECTOR(fname, sg_type, datatype) \
67 void CHDF5File::fname(sg_type*& vec, int32_t& len) \
68 { \
69  if (!h5file) \
70  SG_ERROR("File invalid.\n") \
71  \
72  int32_t* dims; \
73  int32_t ndims; \
74  int64_t nelements; \
75  hid_t dataset = H5Dopen2(h5file, variable_name, H5P_DEFAULT); \
76  if (dataset<0) \
77  SG_ERROR("Error opening data set\n") \
78  hid_t dtype = H5Dget_type(dataset); \
79  H5T_class_t t_class=H5Tget_class(dtype); \
80  TSGDataType t datatype; hid_t h5_type=get_compatible_type(t_class, &t); \
81  if (h5_type==-1) \
82  { \
83  H5Dclose(dataset); \
84  SG_INFO("No compatible datatype found\n") \
85  } \
86  get_dims(dataset, dims, ndims, nelements); \
87  if (!((ndims==2 && dims[0]==nelements && dims[1]==1) || \
88  (ndims==2 && dims[0]==1 && dims[1]==nelements) || \
89  (ndims==1 && dims[0]==nelements))) \
90  SG_ERROR("Error not a 1-dimensional vector (ndims=%d, dims[0]=%d)\n", ndims, dims[0]) \
91  vec=SG_MALLOC(sg_type, nelements); \
92  len=nelements; \
93  herr_t status = H5Dread(dataset, h5_type, H5S_ALL, \
94  H5S_ALL, H5P_DEFAULT, vec); \
95  H5Dclose(dataset); \
96  H5Tclose(dtype); \
97  SG_FREE(dims); \
98  if (status<0) \
99  { \
100  SG_FREE(vec); \
101  SG_ERROR("Error reading dataset\n") \
102  } \
103 }
104 
105 GET_VECTOR(get_vector, bool, (CT_VECTOR, ST_NONE, PT_BOOL))
106 GET_VECTOR(get_vector, int8_t, (CT_VECTOR, ST_NONE, PT_INT8))
107 GET_VECTOR(get_vector, uint8_t, (CT_VECTOR, ST_NONE, PT_UINT8))
108 GET_VECTOR(get_vector, char, (CT_VECTOR, ST_NONE, PT_CHAR))
109 GET_VECTOR(get_vector, int32_t, (CT_VECTOR, ST_NONE, PT_INT32))
110 GET_VECTOR(get_vector, uint32_t, (CT_VECTOR, ST_NONE, PT_UINT32))
111 GET_VECTOR(get_vector, float32_t, (CT_VECTOR, ST_NONE, PT_FLOAT32))
112 GET_VECTOR(get_vector, float64_t, (CT_VECTOR, ST_NONE, PT_FLOAT64))
113 GET_VECTOR(get_vector, floatmax_t, (CT_VECTOR, ST_NONE, PT_FLOATMAX))
114 GET_VECTOR(get_vector, int16_t, (CT_VECTOR, ST_NONE, PT_INT16))
115 GET_VECTOR(get_vector, uint16_t, (CT_VECTOR, ST_NONE, PT_INT16))
116 GET_VECTOR(get_vector, int64_t, (CT_VECTOR, ST_NONE, PT_INT64))
117 GET_VECTOR(get_vector, uint64_t, (CT_VECTOR, ST_NONE, PT_UINT64))
118 #undef GET_VECTOR
119 
120 #define GET_MATRIX(fname, sg_type, datatype) \
121 void CHDF5File::fname(sg_type*& matrix, int32_t& num_feat, int32_t& num_vec) \
122 { \
123  if (!h5file) \
124  SG_ERROR("File invalid.\n") \
125  \
126  int32_t* dims; \
127  int32_t ndims; \
128  int64_t nelements; \
129  hid_t dataset = H5Dopen2(h5file, variable_name, H5P_DEFAULT); \
130  if (dataset<0) \
131  SG_ERROR("Error opening data set\n") \
132  hid_t dtype = H5Dget_type(dataset); \
133  H5T_class_t t_class=H5Tget_class(dtype); \
134  TSGDataType t datatype; hid_t h5_type=get_compatible_type(t_class, &t); \
135  if (h5_type==-1) \
136  { \
137  H5Dclose(dataset); \
138  SG_INFO("No compatible datatype found\n") \
139  } \
140  get_dims(dataset, dims, ndims, nelements); \
141  if (ndims!=2) \
142  SG_ERROR("Error not a 2-dimensional matrix\n") \
143  matrix=SG_MALLOC(sg_type, nelements); \
144  num_feat=dims[0]; \
145  num_vec=dims[1]; \
146  herr_t status = H5Dread(dataset, h5_type, H5S_ALL, \
147  H5S_ALL, H5P_DEFAULT, matrix); \
148  H5Dclose(dataset); \
149  H5Tclose(dtype); \
150  SG_FREE(dims); \
151  if (status<0) \
152  { \
153  SG_FREE(matrix); \
154  SG_ERROR("Error reading dataset\n") \
155  } \
156 }
157 
158 GET_MATRIX(get_matrix, bool, (CT_MATRIX, ST_NONE, PT_BOOL))
159 GET_MATRIX(get_matrix, char, (CT_MATRIX, ST_NONE, PT_CHAR))
160 GET_MATRIX(get_matrix, uint8_t, (CT_MATRIX, ST_NONE, PT_UINT8))
161 GET_MATRIX(get_matrix, int32_t, (CT_MATRIX, ST_NONE, PT_INT32))
162 GET_MATRIX(get_matrix, uint32_t, (CT_MATRIX, ST_NONE, PT_INT32))
163 GET_MATRIX(get_matrix, int64_t, (CT_MATRIX, ST_NONE, PT_INT64))
164 GET_MATRIX(get_matrix, uint64_t, (CT_MATRIX, ST_NONE, PT_INT64))
165 GET_MATRIX(get_matrix, int16_t, (CT_MATRIX, ST_NONE, PT_INT16))
166 GET_MATRIX(get_matrix, uint16_t, (CT_MATRIX, ST_NONE, PT_INT16))
167 GET_MATRIX(get_matrix, float32_t, (CT_MATRIX, ST_NONE, PT_FLOAT32))
168 GET_MATRIX(get_matrix, float64_t, (CT_MATRIX, ST_NONE, PT_FLOAT64))
169 GET_MATRIX(get_matrix, floatmax_t, (CT_MATRIX, ST_NONE, PT_FLOATMAX))
170 #undef GET_MATRIX
171 
172 #define GET_SPARSEMATRIX(fname, sg_type, datatype) \
173 void CHDF5File::fname(SGSparseVector<sg_type>*& matrix, int32_t& num_feat, int32_t& num_vec) \
174 { \
175  if (!(file)) \
176  SG_ERROR("File invalid.\n") \
177 }
178 GET_SPARSEMATRIX(get_sparse_matrix, bool, DT_SPARSE_BOOL)
179 GET_SPARSEMATRIX(get_sparse_matrix, char, DT_SPARSE_CHAR)
180 GET_SPARSEMATRIX(get_sparse_matrix, int8_t, DT_SPARSE_INT8)
181 GET_SPARSEMATRIX(get_sparse_matrix, uint8_t, DT_SPARSE_BYTE)
182 GET_SPARSEMATRIX(get_sparse_matrix, int32_t, DT_SPARSE_INT)
183 GET_SPARSEMATRIX(get_sparse_matrix, uint32_t, DT_SPARSE_UINT)
184 GET_SPARSEMATRIX(get_sparse_matrix, int64_t, DT_SPARSE_LONG)
185 GET_SPARSEMATRIX(get_sparse_matrix, uint64_t, DT_SPARSE_ULONG)
186 GET_SPARSEMATRIX(get_sparse_matrix, int16_t, DT_SPARSE_SHORT)
187 GET_SPARSEMATRIX(get_sparse_matrix, uint16_t, DT_SPARSE_WORD)
188 GET_SPARSEMATRIX(get_sparse_matrix, float32_t, DT_SPARSE_SHORTREAL)
189 GET_SPARSEMATRIX(get_sparse_matrix, float64_t, DT_SPARSE_REAL)
190 GET_SPARSEMATRIX(get_sparse_matrix, floatmax_t, DT_SPARSE_LONGREAL)
191 #undef GET_SPARSEMATRIX
192 
193 
194 #define GET_STRING_LIST(fname, sg_type, datatype) \
195 void CHDF5File::fname(SGString<sg_type>*& strings, int32_t& num_str, int32_t& max_string_len) \
196 { \
197 }
198 
199 GET_STRING_LIST(get_string_list, bool, DT_STRING_BOOL)
200 GET_STRING_LIST(get_string_list, char, DT_STRING_CHAR)
201 GET_STRING_LIST(get_string_list, int8_t, DT_STRING_INT8)
202 GET_STRING_LIST(get_string_list, uint8_t, DT_STRING_BYTE)
203 GET_STRING_LIST(get_string_list, int32_t, DT_STRING_INT)
204 GET_STRING_LIST(get_string_list, uint32_t, DT_STRING_UINT)
205 GET_STRING_LIST(get_string_list, int64_t, DT_STRING_LONG)
206 GET_STRING_LIST(get_string_list, uint64_t, DT_STRING_ULONG)
207 GET_STRING_LIST(get_string_list, int16_t, DT_STRING_SHORT)
208 GET_STRING_LIST(get_string_list, uint16_t, DT_STRING_WORD)
209 GET_STRING_LIST(get_string_list, float32_t, DT_STRING_SHORTREAL)
210 GET_STRING_LIST(get_string_list, float64_t, DT_STRING_REAL)
211 GET_STRING_LIST(get_string_list, floatmax_t, DT_STRING_LONGREAL)
212 #undef GET_STRING_LIST
213 
216 #define SET_VECTOR(fname, sg_type, dtype, h5type) \
217 void CHDF5File::fname(const sg_type* vec, int32_t len) \
218 { \
219  if (h5file<0 || !vec) \
220  SG_ERROR("File or vector invalid.\n") \
221  \
222  create_group_hierarchy(); \
223  \
224  hsize_t dims=(hsize_t) len; \
225  hid_t dataspace, dataset, status; \
226  dataspace=H5Screate_simple(1, &dims, NULL); \
227  if (dataspace<0) \
228  SG_ERROR("Could not create hdf5 dataspace\n") \
229  dataset=H5Dcreate2(h5file, variable_name, h5type, dataspace, H5P_DEFAULT,\
230  H5P_DEFAULT, H5P_DEFAULT); \
231  if (dataset<0) \
232  { \
233  SG_ERROR("Could not create hdf5 dataset - does" \
234  " dataset '%s' already exist?\n", variable_name); \
235  } \
236  status=H5Dwrite(dataset, h5type, H5S_ALL, H5S_ALL, H5P_DEFAULT, vec); \
237  if (status<0) \
238  SG_ERROR("Failed to write hdf5 dataset\n") \
239  H5Dclose(dataset); \
240  H5Sclose(dataspace); \
241 }
242 SET_VECTOR(set_vector, bool, DT_VECTOR_BOOL, boolean_type)
243 SET_VECTOR(set_vector, int8_t, DT_VECTOR_BYTE, H5T_NATIVE_INT8)
244 SET_VECTOR(set_vector, uint8_t, DT_VECTOR_BYTE, H5T_NATIVE_UINT8)
245 SET_VECTOR(set_vector, char, DT_VECTOR_CHAR, H5T_NATIVE_CHAR)
246 SET_VECTOR(set_vector, int32_t, DT_VECTOR_INT, H5T_NATIVE_INT32)
247 SET_VECTOR(set_vector, uint32_t, DT_VECTOR_UINT, H5T_NATIVE_UINT32)
248 SET_VECTOR(set_vector, float32_t, DT_VECTOR_SHORTREAL, H5T_NATIVE_FLOAT)
249 SET_VECTOR(set_vector, float64_t, DT_VECTOR_REAL, H5T_NATIVE_DOUBLE)
250 SET_VECTOR(set_vector, floatmax_t, DT_VECTOR_LONGREAL, H5T_NATIVE_LDOUBLE)
251 SET_VECTOR(set_vector, int16_t, DT_VECTOR_SHORT, H5T_NATIVE_INT16)
252 SET_VECTOR(set_vector, uint16_t, DT_VECTOR_WORD, H5T_NATIVE_UINT16)
253 SET_VECTOR(set_vector, int64_t, DT_VECTOR_LONG, H5T_NATIVE_LLONG)
254 SET_VECTOR(set_vector, uint64_t, DT_VECTOR_ULONG, H5T_NATIVE_ULLONG)
255 #undef SET_VECTOR
256 
257 #define SET_MATRIX(fname, sg_type, dtype, h5type) \
258 void CHDF5File::fname(const sg_type* matrix, int32_t num_feat, int32_t num_vec) \
259 { \
260  if (h5file<0 || !matrix) \
261  SG_ERROR("File or matrix invalid.\n") \
262  \
263  create_group_hierarchy(); \
264  \
265  hsize_t dims[2]={(hsize_t) num_feat, (hsize_t) num_vec}; \
266  hid_t dataspace, dataset, status; \
267  dataspace=H5Screate_simple(2, dims, NULL); \
268  if (dataspace<0) \
269  SG_ERROR("Could not create hdf5 dataspace\n") \
270  dataset=H5Dcreate2(h5file, variable_name, h5type, dataspace, H5P_DEFAULT, \
271  H5P_DEFAULT, H5P_DEFAULT); \
272  if (dataset<0) \
273  { \
274  SG_ERROR("Could not create hdf5 dataset - does" \
275  " dataset '%s' already exist?\n", variable_name); \
276  } \
277  status=H5Dwrite(dataset, h5type, H5S_ALL, H5S_ALL, H5P_DEFAULT, matrix); \
278  if (status<0) \
279  SG_ERROR("Failed to write hdf5 dataset\n") \
280  H5Dclose(dataset); \
281  H5Sclose(dataspace); \
282 }
283 SET_MATRIX(set_matrix, bool, DT_DENSE_BOOL, boolean_type)
284 SET_MATRIX(set_matrix, char, DT_DENSE_CHAR, H5T_NATIVE_CHAR)
285 SET_MATRIX(set_matrix, int8_t, DT_DENSE_BYTE, H5T_NATIVE_INT8)
286 SET_MATRIX(set_matrix, uint8_t, DT_DENSE_BYTE, H5T_NATIVE_UINT8)
287 SET_MATRIX(set_matrix, int32_t, DT_DENSE_INT, H5T_NATIVE_INT32)
288 SET_MATRIX(set_matrix, uint32_t, DT_DENSE_UINT, H5T_NATIVE_UINT32)
289 SET_MATRIX(set_matrix, int64_t, DT_DENSE_LONG, H5T_NATIVE_INT64)
290 SET_MATRIX(set_matrix, uint64_t, DT_DENSE_ULONG, H5T_NATIVE_UINT64)
291 SET_MATRIX(set_matrix, int16_t, DT_DENSE_SHORT, H5T_NATIVE_INT16)
292 SET_MATRIX(set_matrix, uint16_t, DT_DENSE_WORD, H5T_NATIVE_UINT16)
293 SET_MATRIX(set_matrix, float32_t, DT_DENSE_SHORTREAL, H5T_NATIVE_FLOAT)
294 SET_MATRIX(set_matrix, float64_t, DT_DENSE_REAL, H5T_NATIVE_DOUBLE)
295 SET_MATRIX(set_matrix, floatmax_t, DT_DENSE_LONGREAL, H5T_NATIVE_LDOUBLE)
296 #undef SET_MATRIX
297 
298 #define SET_SPARSEMATRIX(fname, sg_type, dtype) \
299 void CHDF5File::fname(const SGSparseVector<sg_type>* matrix, \
300  int32_t num_feat, int32_t num_vec) \
301 { \
302  if (!(file && matrix)) \
303  SG_ERROR("File or matrix invalid.\n") \
304  \
305 }
306 SET_SPARSEMATRIX(set_sparse_matrix, bool, DT_SPARSE_BOOL)
307 SET_SPARSEMATRIX(set_sparse_matrix, char, DT_SPARSE_CHAR)
308 SET_SPARSEMATRIX(set_sparse_matrix, int8_t, DT_SPARSE_INT8)
309 SET_SPARSEMATRIX(set_sparse_matrix, uint8_t, DT_SPARSE_BYTE)
310 SET_SPARSEMATRIX(set_sparse_matrix, int32_t, DT_SPARSE_INT)
311 SET_SPARSEMATRIX(set_sparse_matrix, uint32_t, DT_SPARSE_UINT)
312 SET_SPARSEMATRIX(set_sparse_matrix, int64_t, DT_SPARSE_LONG)
313 SET_SPARSEMATRIX(set_sparse_matrix, uint64_t, DT_SPARSE_ULONG)
314 SET_SPARSEMATRIX(set_sparse_matrix, int16_t, DT_SPARSE_SHORT)
315 SET_SPARSEMATRIX(set_sparse_matrix, uint16_t, DT_SPARSE_WORD)
316 SET_SPARSEMATRIX(set_sparse_matrix, float32_t, DT_SPARSE_SHORTREAL)
317 SET_SPARSEMATRIX(set_sparse_matrix, float64_t, DT_SPARSE_REAL)
318 SET_SPARSEMATRIX(set_sparse_matrix, floatmax_t, DT_SPARSE_LONGREAL)
319 #undef SET_SPARSEMATRIX
320 
321 #define SET_STRING_LIST(fname, sg_type, dtype) \
322 void CHDF5File::fname(const SGString<sg_type>* strings, int32_t num_str) \
323 { \
324  if (!(file && strings)) \
325  SG_ERROR("File or strings invalid.\n") \
326  \
327 }
328 SET_STRING_LIST(set_string_list, bool, DT_STRING_BOOL)
329 SET_STRING_LIST(set_string_list, char, DT_STRING_CHAR)
330 SET_STRING_LIST(set_string_list, int8_t, DT_STRING_INT8)
331 SET_STRING_LIST(set_string_list, uint8_t, DT_STRING_BYTE)
332 SET_STRING_LIST(set_string_list, int32_t, DT_STRING_INT)
333 SET_STRING_LIST(set_string_list, uint32_t, DT_STRING_UINT)
334 SET_STRING_LIST(set_string_list, int64_t, DT_STRING_LONG)
335 SET_STRING_LIST(set_string_list, uint64_t, DT_STRING_ULONG)
336 SET_STRING_LIST(set_string_list, int16_t, DT_STRING_SHORT)
337 SET_STRING_LIST(set_string_list, uint16_t, DT_STRING_WORD)
338 SET_STRING_LIST(set_string_list, float32_t, DT_STRING_SHORTREAL)
339 SET_STRING_LIST(set_string_list, float64_t, DT_STRING_REAL)
340 SET_STRING_LIST(set_string_list, floatmax_t, DT_STRING_LONGREAL)
341 #undef SET_STRING_LIST
342 
343 void CHDF5File::get_boolean_type()
344 {
345  boolean_type=H5T_NATIVE_UCHAR;
346  switch (sizeof(bool))
347  {
348  case 1:
349  boolean_type = H5T_NATIVE_UCHAR;
350  break;
351  case 2:
352  boolean_type = H5T_NATIVE_UINT16;
353  break;
354  case 4:
355  boolean_type = H5T_NATIVE_UINT32;
356  break;
357  case 8:
358  boolean_type = H5T_NATIVE_UINT64;
359  break;
360  default:
361  SG_ERROR("Boolean type not supported on this platform\n")
362  }
363 }
364 
365 hid_t CHDF5File::get_compatible_type(H5T_class_t t_class,
366  const TSGDataType* datatype)
367 {
368  switch (t_class)
369  {
370  case H5T_FLOAT:
371  case H5T_INTEGER:
372  switch (datatype->m_ptype)
373  {
374  case PT_BOOL: return boolean_type;
375  case PT_CHAR: return H5T_NATIVE_CHAR;
376  case PT_INT8: return H5T_NATIVE_INT8;
377  case PT_UINT8: return H5T_NATIVE_UINT8;
378  case PT_INT16: return H5T_NATIVE_INT16;
379  case PT_UINT16: return H5T_NATIVE_UINT16;
380  case PT_INT32: return H5T_NATIVE_INT32;
381  case PT_UINT32: return H5T_NATIVE_UINT32;
382  case PT_INT64: return H5T_NATIVE_INT64;
383  case PT_UINT64: return H5T_NATIVE_UINT64;
384  case PT_FLOAT32: return H5T_NATIVE_FLOAT;
385  case PT_FLOAT64: return H5T_NATIVE_DOUBLE;
386  case PT_FLOATMAX: return H5T_NATIVE_LDOUBLE;
387  case PT_COMPLEX128:
388  SG_ERROR("complex128_t not compatible with HDF5File!");
389  return -1;
390  case PT_SGOBJECT:
391  case PT_UNDEFINED:
392  SG_ERROR("Implementation error during writing "
393  "HDF5File!");
394  return -1;
395  }
396  case H5T_STRING:
397  SG_ERROR("Strings not supported")
398  return -1;
399  case H5T_VLEN:
400  SG_ERROR("Variable length containers currently not supported")
401  return -1;
402  case H5T_ARRAY:
403  SG_ERROR("Array containers currently not supported")
404  return -1;
405  default:
406  SG_ERROR("Datatype mismatchn")
407  return -1;
408  }
409 }
410 
411 void CHDF5File::get_dims(hid_t dataset, int32_t*& dims, int32_t& ndims, int64_t& total_elements)
412 {
413  hid_t dataspace = H5Dget_space(dataset);
414  if (dataspace<0)
415  SG_ERROR("Error obtaining hdf5 dataspace\n")
416 
417  ndims = H5Sget_simple_extent_ndims(dataspace);
418  total_elements=H5Sget_simple_extent_npoints(dataspace);
419  hsize_t* dims_out=SG_MALLOC(hsize_t, ndims);
420  dims=SG_MALLOC(int32_t, ndims);
421  H5Sget_simple_extent_dims(dataspace, dims_out, NULL);
422  for (int32_t i=0; i<ndims; i++)
423  dims[i]=dims_out[i];
424  SG_FREE(dims_out);
425  H5Sclose(dataspace);
426 }
427 
428 void CHDF5File::create_group_hierarchy()
429 {
430  char* vname=get_strdup(variable_name);
431  int32_t vlen=strlen(vname);
432  for (int32_t i=0; i<vlen; i++)
433  {
434  if (i!=0 && vname[i]=='/')
435  {
436  vname[i]='\0';
437  hid_t g = H5Gopen2(h5file, vname, H5P_DEFAULT);
438  if (g<0)
439  {
440  g=H5Gcreate2(h5file, vname, H5P_DEFAULT, H5P_DEFAULT,
441  H5P_DEFAULT);
442  if (g<0)
443  SG_ERROR("Error creating group '%s'\n", vname)
444  vname[i]='/';
445  }
446  H5Gclose(g);
447  }
448  }
449  SG_FREE(vname);
450 }
451 #endif // HDF5

SHOGUN Machine Learning Toolbox - Documentation