comparison src/ov-bool-mat.cc @ 4944:44046bbaa52c

[project @ 2004-08-31 05:30:46 by jwe]
author jwe
date Tue, 31 Aug 2004 05:30:47 +0000
parents 9f7ef92b50b0
children f7e39f977fe8
comparison
equal deleted inserted replaced
4943:1a499d0c58f5 4944:44046bbaa52c
302 { 302 {
303 FOUR_BYTE_INT mdims; 303 FOUR_BYTE_INT mdims;
304 if (! is.read (X_CAST (char *, &mdims), 4)) 304 if (! is.read (X_CAST (char *, &mdims), 4))
305 return false; 305 return false;
306 if (swap) 306 if (swap)
307 swap_4_bytes (X_CAST (char *, &mdims)); 307 swap_bytes<4> (&mdims);
308 if (mdims >= 0) 308 if (mdims >= 0)
309 return false; 309 return false;
310 310
311 // mdims is negative for consistency with other matrices, where it is 311 // mdims is negative for consistency with other matrices, where it is
312 // negative to allow the positive value to be used for rows/cols for 312 // negative to allow the positive value to be used for rows/cols for
319 for (int i = 0; i < mdims; i++) 319 for (int i = 0; i < mdims; i++)
320 { 320 {
321 if (! is.read (X_CAST (char *, &di), 4)) 321 if (! is.read (X_CAST (char *, &di), 4))
322 return false; 322 return false;
323 if (swap) 323 if (swap)
324 swap_4_bytes (X_CAST (char *, &di)); 324 swap_bytes<4> (&di);
325 dv(i) = di; 325 dv(i) = di;
326 } 326 }
327 327
328 int nel = dv.numel (); 328 int nel = dv.numel ();
329 OCTAVE_LOCAL_BUFFER (char, htmp, nel); 329 OCTAVE_LOCAL_BUFFER (char, htmp, nel);
337 337
338 return true; 338 return true;
339 } 339 }
340 340
341 #if defined (HAVE_HDF5) 341 #if defined (HAVE_HDF5)
342
342 bool 343 bool
343 octave_bool_matrix::save_hdf5 (hid_t loc_id, const char *name, 344 octave_bool_matrix::save_hdf5 (hid_t loc_id, const char *name,
344 bool /* save_as_floats */) 345 bool /* save_as_floats */)
345 { 346 {
346 dim_vector dv = dims (); 347 dim_vector dv = dims ();
445 446
446 H5Dclose (data_hid); 447 H5Dclose (data_hid);
447 448
448 return retval; 449 return retval;
449 } 450 }
451
450 #endif 452 #endif
451 453
452 /* 454 /*
453 ;;; Local Variables: *** 455 ;;; Local Variables: ***
454 ;;; mode: C++ *** 456 ;;; mode: C++ ***