comparison src/ls-mat-ascii.cc @ 5938:5a3a716c257d

[project @ 2006-08-18 06:06:53 by jwe]
author jwe
date Fri, 18 Aug 2006 06:06:53 +0000
parents ace8d8d26933
children b2167e370f82
comparison
equal deleted inserted replaced
5937:0c8ac963ae69 5938:5a3a716c257d
326 filename.c_str ()); 326 filename.c_str ());
327 327
328 return retval; 328 return retval;
329 } 329 }
330 330
331 bool
332 save_mat_ascii_data (std::ostream& os, const octave_value& val,
333 int precision)
334 {
335 bool success = true;
336
337 long old_precision = os.precision ();
338 os.precision (precision);
339
340 if (val.is_complex_type ())
341 warning ("save: omitting imaginary part for ASCII file");
342
343 Matrix m = val.matrix_value (true);
344
345 if (error_state)
346 {
347 success = false;
348
349 error_state = 0;
350 }
351 else
352 os << m;
353
354 os.precision (old_precision);
355
356 return (os && success);
357 }
358
331 /* 359 /*
332 ;;; Local Variables: *** 360 ;;; Local Variables: ***
333 ;;; mode: C++ *** 361 ;;; mode: C++ ***
334 ;;; End: *** 362 ;;; End: ***
335 */ 363 */