2376
|
1 /* |
|
2 |
2847
|
3 Copyright (C) 1996, 1997 John W. Eaton |
2376
|
4 |
|
5 This file is part of Octave. |
|
6 |
|
7 Octave is free software; you can redistribute it and/or modify it |
|
8 under the terms of the GNU General Public License as published by the |
|
9 Free Software Foundation; either version 2, or (at your option) any |
|
10 later version. |
|
11 |
|
12 Octave is distributed in the hope that it will be useful, but WITHOUT |
|
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
15 for more details. |
|
16 |
|
17 You should have received a copy of the GNU General Public License |
|
18 along with Octave; see the file COPYING. If not, write to the Free |
5307
|
19 Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
|
20 02110-1301, USA. |
2376
|
21 |
|
22 */ |
|
23 |
|
24 #ifdef HAVE_CONFIG_H |
|
25 #include <config.h> |
|
26 #endif |
|
27 |
3503
|
28 #include <iostream> |
4726
|
29 #include <vector> |
2901
|
30 |
4944
|
31 #include "data-conv.h" |
2376
|
32 #include "lo-ieee.h" |
|
33 #include "mx-base.h" |
4944
|
34 #include "mach-info.h" |
2376
|
35 |
|
36 #include "gripes.h" |
|
37 #include "oct-obj.h" |
4944
|
38 #include "oct-stream.h" |
2410
|
39 #include "ops.h" |
3219
|
40 #include "ov-base.h" |
|
41 #include "ov-base-mat.h" |
|
42 #include "ov-base-mat.cc" |
2410
|
43 #include "ov-complex.h" |
2376
|
44 #include "ov-cx-mat.h" |
2410
|
45 #include "ov-re-mat.h" |
|
46 #include "ov-scalar.h" |
2376
|
47 #include "pr-output.h" |
|
48 |
4687
|
49 #include "byte-swap.h" |
|
50 #include "ls-oct-ascii.h" |
|
51 #include "ls-hdf5.h" |
|
52 #include "ls-utils.h" |
|
53 |
4513
|
54 template class octave_base_matrix<ComplexNDArray>; |
2376
|
55 |
3219
|
56 DEFINE_OCTAVE_ALLOCATOR (octave_complex_matrix); |
2477
|
57 |
4612
|
58 DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA (octave_complex_matrix, |
|
59 "complex matrix", "double"); |
2376
|
60 |
2410
|
61 octave_value * |
|
62 octave_complex_matrix::try_narrowing_conversion (void) |
|
63 { |
|
64 octave_value *retval = 0; |
|
65 |
4513
|
66 if (matrix.ndims () == 2) |
|
67 { |
|
68 ComplexMatrix cm = matrix.matrix_value (); |
2410
|
69 |
5275
|
70 octave_idx_type nr = cm.rows (); |
|
71 octave_idx_type nc = cm.cols (); |
4513
|
72 |
|
73 if (nr == 1 && nc == 1) |
|
74 { |
|
75 Complex c = matrix (0, 0); |
2410
|
76 |
5450
|
77 double im = std::imag (c); |
|
78 |
|
79 if (im == 0.0 && ! lo_ieee_signbit (im)) |
4513
|
80 retval = new octave_scalar (std::real (c)); |
|
81 else |
|
82 retval = new octave_complex (c); |
|
83 } |
|
84 else if (nr == 0 || nc == 0) |
|
85 retval = new octave_matrix (Matrix (nr, nc)); |
|
86 else if (cm.all_elements_are_real ()) |
|
87 retval = new octave_matrix (::real (cm)); |
2410
|
88 } |
4923
|
89 else if (matrix.all_elements_are_real ()) |
|
90 retval = new octave_matrix (::real (matrix)); |
2410
|
91 |
|
92 return retval; |
|
93 } |
2376
|
94 |
|
95 void |
|
96 octave_complex_matrix::assign (const octave_value_list& idx, |
4686
|
97 const ComplexNDArray& rhs) |
4418
|
98 { |
4513
|
99 octave_base_matrix<ComplexNDArray>::assign (idx, rhs); |
4418
|
100 } |
|
101 |
|
102 void |
|
103 octave_complex_matrix::assign (const octave_value_list& idx, |
4686
|
104 const NDArray& rhs) |
2376
|
105 { |
5275
|
106 octave_idx_type len = idx.length (); |
2376
|
107 |
5275
|
108 for (octave_idx_type i = 0; i < len; i++) |
4513
|
109 matrix.set_index (idx(i).index_vector ()); |
2376
|
110 |
4513
|
111 ::assign (matrix, rhs); |
2376
|
112 } |
|
113 |
|
114 bool |
|
115 octave_complex_matrix::valid_as_scalar_index (void) const |
|
116 { |
|
117 // XXX FIXME XXX |
|
118 return false; |
|
119 } |
|
120 |
|
121 double |
|
122 octave_complex_matrix::double_value (bool force_conversion) const |
|
123 { |
4102
|
124 double retval = lo_ieee_nan_value (); |
2376
|
125 |
4451
|
126 if (! force_conversion && Vwarn_imag_to_real) |
2376
|
127 gripe_implicit_conversion ("complex matrix", "real scalar"); |
|
128 |
4455
|
129 // XXX FIXME XXX -- maybe this should be a function, valid_as_scalar() |
|
130 if (rows () > 0 && columns () > 0) |
|
131 { |
|
132 // XXX FIXME XXX -- is warn_fortran_indexing the right variable here? |
|
133 if (Vwarn_fortran_indexing) |
|
134 gripe_implicit_conversion ("complex matrix", "real scalar"); |
|
135 |
|
136 retval = std::real (matrix (0, 0)); |
|
137 } |
2376
|
138 else |
|
139 gripe_invalid_conversion ("complex matrix", "real scalar"); |
|
140 |
|
141 return retval; |
|
142 } |
|
143 |
|
144 Matrix |
|
145 octave_complex_matrix::matrix_value (bool force_conversion) const |
|
146 { |
|
147 Matrix retval; |
|
148 |
4451
|
149 if (! force_conversion && Vwarn_imag_to_real) |
2376
|
150 gripe_implicit_conversion ("complex matrix", "real matrix"); |
|
151 |
4513
|
152 retval = ::real (matrix.matrix_value ()); |
2376
|
153 |
|
154 return retval; |
|
155 } |
|
156 |
|
157 Complex |
|
158 octave_complex_matrix::complex_value (bool) const |
|
159 { |
4102
|
160 double tmp = lo_ieee_nan_value (); |
|
161 |
|
162 Complex retval (tmp, tmp); |
2376
|
163 |
4455
|
164 // XXX FIXME XXX -- maybe this should be a function, valid_as_scalar() |
|
165 if (rows () > 0 && columns () > 0) |
|
166 { |
|
167 // XXX FIXME XXX -- is warn_fortran_indexing the right variable here? |
|
168 if (Vwarn_fortran_indexing) |
|
169 gripe_implicit_conversion ("complex matrix", "complex scalar"); |
|
170 |
|
171 retval = matrix (0, 0); |
|
172 } |
2376
|
173 else |
|
174 gripe_invalid_conversion ("complex matrix", "complex scalar"); |
|
175 |
|
176 return retval; |
|
177 } |
|
178 |
|
179 ComplexMatrix |
|
180 octave_complex_matrix::complex_matrix_value (bool) const |
|
181 { |
4513
|
182 return matrix.matrix_value (); |
2376
|
183 } |
|
184 |
5164
|
185 SparseMatrix |
|
186 octave_complex_matrix::sparse_matrix_value (bool force_conversion) const |
|
187 { |
|
188 SparseMatrix retval; |
|
189 |
|
190 if (! force_conversion && Vwarn_imag_to_real) |
|
191 gripe_implicit_conversion ("complex matrix", "real matrix"); |
|
192 |
|
193 retval = SparseMatrix (::real (matrix.matrix_value ())); |
|
194 |
|
195 return retval; |
|
196 } |
|
197 |
|
198 SparseComplexMatrix |
|
199 octave_complex_matrix::sparse_complex_matrix_value (bool) const |
|
200 { |
|
201 return SparseComplexMatrix (matrix.matrix_value ()); |
|
202 } |
|
203 |
4687
|
204 static ComplexMatrix |
|
205 strip_infnan (const ComplexMatrix& m) |
|
206 { |
5275
|
207 octave_idx_type nr = m.rows (); |
|
208 octave_idx_type nc = m.columns (); |
4687
|
209 |
|
210 ComplexMatrix retval (nr, nc); |
|
211 |
5275
|
212 octave_idx_type k = 0; |
|
213 for (octave_idx_type i = 0; i < nr; i++) |
4687
|
214 { |
5275
|
215 for (octave_idx_type j = 0; j < nc; j++) |
4687
|
216 { |
|
217 Complex c = m (i, j); |
|
218 if (xisnan (c)) |
|
219 goto next_row; |
|
220 else |
|
221 { |
5260
|
222 double re = std::real (c); |
|
223 double im = std::imag (c); |
4687
|
224 |
|
225 re = xisinf (re) ? (re > 0 ? OCT_RBV : -OCT_RBV) : re; |
|
226 im = xisinf (im) ? (im > 0 ? OCT_RBV : -OCT_RBV) : im; |
|
227 |
|
228 retval (k, j) = Complex (re, im); |
|
229 } |
|
230 } |
|
231 k++; |
|
232 |
|
233 next_row: |
|
234 continue; |
|
235 } |
|
236 |
|
237 if (k > 0) |
|
238 retval.resize (k, nc); |
|
239 |
|
240 return retval; |
|
241 } |
|
242 |
|
243 bool |
|
244 octave_complex_matrix::save_ascii (std::ostream& os, bool& infnan_warned, |
|
245 bool strip_nan_and_inf) |
|
246 { |
|
247 dim_vector d = dims (); |
|
248 if (d.length () > 2) |
|
249 { |
|
250 ComplexNDArray tmp = complex_array_value (); |
|
251 |
|
252 if (strip_nan_and_inf) |
|
253 { |
|
254 warning ("save: Can not strip Inf or NaN values"); |
|
255 warning ("save: Inf or NaN values may not be reloadable"); |
|
256 infnan_warned = true; |
|
257 } |
|
258 else if (! infnan_warned && tmp.any_element_is_inf_or_nan ()) |
|
259 { |
|
260 warning ("save: Inf or NaN values may not be reloadable"); |
|
261 infnan_warned = true; |
|
262 } |
|
263 |
|
264 os << "# ndims: " << d.length () << "\n"; |
|
265 |
5275
|
266 for (int i = 0; i < d.length (); i++) |
4687
|
267 os << " " << d (i); |
|
268 |
|
269 os << "\n" << tmp; |
|
270 } |
|
271 else |
|
272 { |
|
273 // Keep this case, rather than use generic code above for backward |
|
274 // compatiability. Makes load_ascii much more complex!! |
|
275 os << "# rows: " << rows () << "\n" |
|
276 << "# columns: " << columns () << "\n"; |
|
277 |
|
278 ComplexMatrix tmp = complex_matrix_value (); |
|
279 |
|
280 if (strip_nan_and_inf) |
|
281 tmp = strip_infnan (tmp); |
|
282 else if (! infnan_warned && tmp.any_element_is_inf_or_nan ()) |
|
283 { |
|
284 warning ("save: Inf or NaN values may not be reloadable"); |
|
285 infnan_warned = true; |
|
286 } |
|
287 |
|
288 os << tmp; |
|
289 } |
|
290 |
|
291 return true; |
|
292 } |
|
293 |
|
294 bool |
|
295 octave_complex_matrix::load_ascii (std::istream& is) |
|
296 { |
|
297 bool success = true; |
5099
|
298 |
|
299 string_vector keywords(2); |
|
300 |
|
301 keywords[0] = "ndims"; |
|
302 keywords[1] = "rows"; |
4687
|
303 |
5099
|
304 std::string kw; |
5275
|
305 octave_idx_type val = 0; |
5099
|
306 |
|
307 if (extract_keyword (is, keywords, kw, val, true)) |
4687
|
308 { |
5099
|
309 if (kw == "ndims") |
4687
|
310 { |
5275
|
311 int mdims = static_cast<int> (val); |
4687
|
312 |
5099
|
313 if (mdims >= 0) |
4687
|
314 { |
5099
|
315 dim_vector dv; |
|
316 dv.resize (mdims); |
4687
|
317 |
5099
|
318 for (int i = 0; i < mdims; i++) |
|
319 is >> dv(i); |
4687
|
320 |
5099
|
321 ComplexNDArray tmp(dv); |
4687
|
322 is >> tmp; |
5099
|
323 |
4687
|
324 if (!is) |
|
325 { |
|
326 error ("load: failed to load matrix constant"); |
|
327 success = false; |
|
328 } |
|
329 matrix = tmp; |
|
330 } |
|
331 else |
5099
|
332 { |
|
333 error ("load: failed to extract number of rows and columns"); |
|
334 success = false; |
|
335 } |
4687
|
336 } |
5099
|
337 else if (kw == "rows") |
4687
|
338 { |
5275
|
339 octave_idx_type nr = val; |
|
340 octave_idx_type nc = 0; |
5099
|
341 |
|
342 if (nr >= 0 && extract_keyword (is, "columns", nc) && nc >= 0) |
|
343 { |
|
344 if (nr > 0 && nc > 0) |
|
345 { |
|
346 ComplexMatrix tmp (nr, nc); |
|
347 is >> tmp; |
|
348 if (!is) |
|
349 { |
|
350 error ("load: failed to load matrix constant"); |
|
351 success = false; |
|
352 } |
|
353 matrix = tmp; |
|
354 } |
|
355 else if (nr == 0 || nc == 0) |
|
356 matrix = ComplexMatrix (nr, nc); |
|
357 else |
|
358 panic_impossible (); |
|
359 } |
|
360 else |
|
361 { |
|
362 error ("load: failed to extract number of rows and columns"); |
|
363 success = false; |
|
364 } |
4687
|
365 } |
5099
|
366 else |
|
367 panic_impossible (); |
|
368 } |
|
369 else |
|
370 { |
|
371 error ("load: failed to extract number of rows and columns"); |
|
372 success = false; |
4687
|
373 } |
|
374 |
|
375 return success; |
|
376 } |
|
377 |
|
378 bool |
|
379 octave_complex_matrix::save_binary (std::ostream& os, bool& save_as_floats) |
|
380 { |
|
381 dim_vector d = dims (); |
|
382 if (d.length() < 1) |
|
383 return false; |
|
384 |
|
385 // Use negative value for ndims to differentiate with old format!! |
|
386 FOUR_BYTE_INT tmp = - d.length(); |
|
387 os.write (X_CAST (char *, &tmp), 4); |
5275
|
388 for (int i = 0; i < d.length (); i++) |
4687
|
389 { |
|
390 tmp = d(i); |
|
391 os.write (X_CAST (char *, &tmp), 4); |
|
392 } |
|
393 |
|
394 ComplexNDArray m = complex_array_value (); |
|
395 save_type st = LS_DOUBLE; |
|
396 if (save_as_floats) |
|
397 { |
|
398 if (m.too_large_for_float ()) |
|
399 { |
|
400 warning ("save: some values too large to save as floats --"); |
|
401 warning ("save: saving as doubles instead"); |
|
402 } |
|
403 else |
|
404 st = LS_FLOAT; |
|
405 } |
|
406 else if (d.numel () > 4096) // XXX FIXME XXX -- make this configurable. |
|
407 { |
|
408 double max_val, min_val; |
|
409 if (m.all_integers (max_val, min_val)) |
|
410 st = get_save_type (max_val, min_val); |
|
411 } |
|
412 |
|
413 |
|
414 const Complex *mtmp = m.data (); |
|
415 write_doubles (os, X_CAST (const double *, mtmp), st, 2 * d.numel ()); |
|
416 |
|
417 return true; |
|
418 } |
|
419 |
|
420 bool |
|
421 octave_complex_matrix::load_binary (std::istream& is, bool swap, |
|
422 oct_mach_info::float_format fmt) |
|
423 { |
|
424 char tmp; |
|
425 FOUR_BYTE_INT mdims; |
|
426 if (! is.read (X_CAST (char *, &mdims), 4)) |
|
427 return false; |
|
428 if (swap) |
4944
|
429 swap_bytes<4> (&mdims); |
4687
|
430 if (mdims < 0) |
|
431 { |
|
432 mdims = - mdims; |
|
433 FOUR_BYTE_INT di; |
|
434 dim_vector dv; |
|
435 dv.resize (mdims); |
|
436 |
|
437 for (int i = 0; i < mdims; i++) |
|
438 { |
|
439 if (! is.read (X_CAST (char *, &di), 4)) |
|
440 return false; |
|
441 if (swap) |
4944
|
442 swap_bytes<4> (&di); |
4687
|
443 dv(i) = di; |
|
444 } |
|
445 |
5157
|
446 // Convert an array with a single dimension to be a row vector. |
|
447 // Octave should never write files like this, other software |
|
448 // might. |
|
449 |
|
450 if (mdims == 1) |
|
451 { |
|
452 mdims = 2; |
|
453 dv.resize (mdims); |
|
454 dv(1) = dv(0); |
|
455 dv(0) = 1; |
|
456 } |
|
457 |
4687
|
458 if (! is.read (X_CAST (char *, &tmp), 1)) |
|
459 return false; |
|
460 |
|
461 ComplexNDArray m(dv); |
|
462 Complex *im = m.fortran_vec (); |
|
463 read_doubles (is, X_CAST (double *, im), X_CAST (save_type, tmp), |
|
464 2 * dv.numel (), swap, fmt); |
|
465 if (error_state || ! is) |
|
466 return false; |
|
467 matrix = m; |
|
468 } |
|
469 else |
|
470 { |
|
471 FOUR_BYTE_INT nr, nc; |
|
472 nr = mdims; |
|
473 if (! is.read (X_CAST (char *, &nc), 4)) |
|
474 return false; |
|
475 if (swap) |
4944
|
476 swap_bytes<4> (&nc); |
4687
|
477 if (! is.read (X_CAST (char *, &tmp), 1)) |
|
478 return false; |
|
479 ComplexMatrix m (nr, nc); |
|
480 Complex *im = m.fortran_vec (); |
5275
|
481 octave_idx_type len = nr * nc; |
4687
|
482 read_doubles (is, X_CAST (double *, im), |
|
483 X_CAST (save_type, tmp), 2*len, swap, fmt); |
|
484 if (error_state || ! is) |
|
485 return false; |
|
486 matrix = m; |
|
487 } |
|
488 return true; |
|
489 } |
|
490 |
|
491 #if defined (HAVE_HDF5) |
4944
|
492 |
4687
|
493 bool |
|
494 octave_complex_matrix::save_hdf5 (hid_t loc_id, const char *name, |
|
495 bool save_as_floats) |
|
496 { |
4837
|
497 dim_vector dv = dims (); |
|
498 int empty = save_hdf5_empty (loc_id, name, dv); |
|
499 if (empty) |
4805
|
500 return (empty > 0); |
|
501 |
4837
|
502 int rank = dv.length (); |
4805
|
503 hid_t space_hid = -1, data_hid = -1, type_hid = -1; |
4687
|
504 bool retval = true; |
|
505 ComplexNDArray m = complex_array_value (); |
|
506 |
4805
|
507 OCTAVE_LOCAL_BUFFER (hsize_t, hdims, rank); |
|
508 |
4687
|
509 // Octave uses column-major, while HDF5 uses row-major ordering |
4805
|
510 for (int i = 0; i < rank; i++) |
4837
|
511 hdims[i] = dv (rank-i-1); |
4805
|
512 |
4815
|
513 space_hid = H5Screate_simple (rank, hdims, 0); |
4687
|
514 if (space_hid < 0) return false; |
|
515 |
|
516 hid_t save_type_hid = H5T_NATIVE_DOUBLE; |
|
517 |
|
518 if (save_as_floats) |
|
519 { |
|
520 if (m.too_large_for_float ()) |
|
521 { |
|
522 warning ("save: some values too large to save as floats --"); |
|
523 warning ("save: saving as doubles instead"); |
|
524 } |
|
525 else |
|
526 save_type_hid = H5T_NATIVE_FLOAT; |
|
527 } |
|
528 #if HAVE_HDF5_INT2FLOAT_CONVERSIONS |
|
529 // hdf5 currently doesn't support float/integer conversions |
|
530 else |
|
531 { |
|
532 double max_val, min_val; |
|
533 |
|
534 if (m.all_integers (max_val, min_val)) |
|
535 save_type_hid |
|
536 = save_type_to_hdf5 (get_save_type (max_val, min_val)); |
|
537 } |
|
538 #endif /* HAVE_HDF5_INT2FLOAT_CONVERSIONS */ |
|
539 |
|
540 type_hid = hdf5_make_complex_type (save_type_hid); |
|
541 if (type_hid < 0) |
|
542 { |
|
543 H5Sclose (space_hid); |
|
544 return false; |
|
545 } |
|
546 |
|
547 data_hid = H5Dcreate (loc_id, name, type_hid, space_hid, H5P_DEFAULT); |
|
548 if (data_hid < 0) |
|
549 { |
|
550 H5Sclose (space_hid); |
|
551 H5Tclose (type_hid); |
|
552 return false; |
|
553 } |
|
554 |
|
555 hid_t complex_type_hid = hdf5_make_complex_type (H5T_NATIVE_DOUBLE); |
|
556 if (complex_type_hid < 0) retval = false; |
|
557 |
|
558 if (retval) |
|
559 { |
|
560 Complex *mtmp = m.fortran_vec (); |
|
561 if (H5Dwrite (data_hid, complex_type_hid, H5S_ALL, H5S_ALL, H5P_DEFAULT, |
4815
|
562 mtmp) < 0) |
4687
|
563 { |
|
564 H5Tclose (complex_type_hid); |
|
565 retval = false; |
|
566 } |
|
567 } |
|
568 |
|
569 H5Tclose (complex_type_hid); |
|
570 H5Dclose (data_hid); |
|
571 H5Tclose (type_hid); |
|
572 H5Sclose (space_hid); |
4837
|
573 |
4687
|
574 return retval; |
|
575 } |
|
576 |
|
577 bool |
|
578 octave_complex_matrix::load_hdf5 (hid_t loc_id, const char *name, |
|
579 bool /* have_h5giterate_bug */) |
|
580 { |
4837
|
581 bool retval = false; |
|
582 |
4805
|
583 dim_vector dv; |
|
584 int empty = load_hdf5_empty (loc_id, name, dv); |
|
585 if (empty > 0) |
|
586 matrix.resize(dv); |
4837
|
587 if (empty) |
4805
|
588 return (empty > 0); |
|
589 |
4687
|
590 hid_t data_hid = H5Dopen (loc_id, name); |
|
591 hid_t type_hid = H5Dget_type (data_hid); |
|
592 |
|
593 hid_t complex_type = hdf5_make_complex_type (H5T_NATIVE_DOUBLE); |
|
594 |
|
595 if (! hdf5_types_compatible (type_hid, complex_type)) |
|
596 { |
4837
|
597 H5Tclose (complex_type); |
4687
|
598 H5Dclose (data_hid); |
|
599 return false; |
|
600 } |
|
601 |
|
602 hid_t space_id = H5Dget_space (data_hid); |
|
603 |
|
604 hsize_t rank = H5Sget_simple_extent_ndims (space_id); |
|
605 |
|
606 if (rank < 1) |
|
607 { |
4837
|
608 H5Tclose (complex_type); |
4687
|
609 H5Sclose (space_id); |
|
610 H5Dclose (data_hid); |
|
611 return false; |
|
612 } |
|
613 |
|
614 OCTAVE_LOCAL_BUFFER (hsize_t, hdims, rank); |
|
615 OCTAVE_LOCAL_BUFFER (hsize_t, maxdims, rank); |
|
616 |
|
617 H5Sget_simple_extent_dims (space_id, hdims, maxdims); |
|
618 |
|
619 // Octave uses column-major, while HDF5 uses row-major ordering |
|
620 if (rank == 1) |
|
621 { |
|
622 dv.resize (2); |
|
623 dv(0) = 1; |
|
624 dv(1) = hdims[0]; |
|
625 } |
|
626 else |
|
627 { |
|
628 dv.resize (rank); |
4815
|
629 for (hsize_t i = 0, j = rank - 1; i < rank; i++, j--) |
4687
|
630 dv(j) = hdims[i]; |
|
631 } |
|
632 |
|
633 ComplexNDArray m (dv); |
|
634 Complex *reim = m.fortran_vec (); |
4815
|
635 if (H5Dread (data_hid, complex_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, |
|
636 reim) >= 0) |
4687
|
637 { |
|
638 retval = true; |
|
639 matrix = m; |
|
640 } |
|
641 |
4837
|
642 H5Tclose (complex_type); |
4687
|
643 H5Sclose (space_id); |
|
644 H5Dclose (data_hid); |
4837
|
645 |
4687
|
646 return retval; |
|
647 } |
4944
|
648 |
4687
|
649 #endif |
|
650 |
4643
|
651 void |
|
652 octave_complex_matrix::print_raw (std::ostream& os, |
|
653 bool pr_as_read_syntax) const |
|
654 { |
|
655 octave_print_internal (os, matrix, pr_as_read_syntax, |
|
656 current_print_indent_level ()); |
|
657 } |
|
658 |
2376
|
659 /* |
|
660 ;;; Local Variables: *** |
|
661 ;;; mode: C++ *** |
|
662 ;;; End: *** |
|
663 */ |