comparison src/ov-complex.cc @ 4815:2eb844b27953

[project @ 2004-03-04 00:14:44 by jwe]
author jwe
date Thu, 04 Mar 2004 00:14:44 +0000
parents e95c86d48732
children 81f78a2ff8a6
comparison
equal deleted inserted replaced
4814:495e9df75836 4815:2eb844b27953
242 { 242 {
243 hsize_t dimens[3]; 243 hsize_t dimens[3];
244 hid_t space_hid = -1, type_hid = -1, data_hid = -1; 244 hid_t space_hid = -1, type_hid = -1, data_hid = -1;
245 bool retval = true; 245 bool retval = true;
246 246
247 space_hid = H5Screate_simple (0, dimens, (hsize_t*) 0); 247 space_hid = H5Screate_simple (0, dimens, 0);
248 if (space_hid < 0) return false; 248 if (space_hid < 0) return false;
249 249
250 type_hid = hdf5_make_complex_type (H5T_NATIVE_DOUBLE); 250 type_hid = hdf5_make_complex_type (H5T_NATIVE_DOUBLE);
251 if (type_hid < 0) 251 if (type_hid < 0)
252 { 252 {
262 return false; 262 return false;
263 } 263 }
264 264
265 Complex tmp = complex_value (); 265 Complex tmp = complex_value ();
266 retval = H5Dwrite (data_hid, type_hid, H5S_ALL, H5S_ALL, H5P_DEFAULT, 266 retval = H5Dwrite (data_hid, type_hid, H5S_ALL, H5S_ALL, H5P_DEFAULT,
267 (void*) X_CAST (double*, &tmp)) >= 0; 267 &tmp) >= 0;
268 268
269 H5Dclose (data_hid); 269 H5Dclose (data_hid);
270 H5Tclose (type_hid); 270 H5Tclose (type_hid);
271 H5Sclose (space_hid); 271 H5Sclose (space_hid);
272 return retval; 272 return retval;
301 } 301 }
302 302
303 // complex scalar: 303 // complex scalar:
304 Complex ctmp; 304 Complex ctmp;
305 if (H5Dread (data_hid, complex_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, 305 if (H5Dread (data_hid, complex_type, H5S_ALL, H5S_ALL, H5P_DEFAULT,
306 (void *) X_CAST (double *, &ctmp)) >= 0) 306 &ctmp) >= 0)
307 { 307 {
308 retval = true; 308 retval = true;
309 scalar = ctmp; 309 scalar = ctmp;
310 } 310 }
311 311