Mercurial > octave-nkf
comparison src/ls-oct-ascii.cc @ 6171:4508e9d73ea1
[project @ 2006-11-15 20:03:18 by jwe]
author | jwe |
---|---|
date | Wed, 15 Nov 2006 20:03:18 +0000 |
parents | 85c7dc4afe6b |
children | e5ed0d1edddc |
comparison
equal
deleted
inserted
replaced
6170:033b9fd8012a | 6171:4508e9d73ea1 |
---|---|
348 save_ascii_data_for_plotting (std::ostream& os, const octave_value& t, | 348 save_ascii_data_for_plotting (std::ostream& os, const octave_value& t, |
349 const std::string& name) | 349 const std::string& name) |
350 { | 350 { |
351 bool infnan_warned = true; | 351 bool infnan_warned = true; |
352 | 352 |
353 return save_ascii_data (os, t, name, infnan_warned, false, 0); | 353 return save_ascii_data (os, t, name, infnan_warned, false, 4); |
354 } | 354 } |
355 | 355 |
356 // Maybe this should be a static function in tree-plot.cc? | 356 // Maybe this should be a static function in tree-plot.cc? |
357 | 357 |
358 // If TC is matrix, save it on stream OS in a format useful for | 358 // If TC is matrix, save it on stream OS in a format useful for |
371 { | 371 { |
372 os << "# 3D data...\n" | 372 os << "# 3D data...\n" |
373 << "# type: matrix\n" | 373 << "# type: matrix\n" |
374 << "# total rows: " << nr << "\n" | 374 << "# total rows: " << nr << "\n" |
375 << "# total columns: " << nc << "\n"; | 375 << "# total columns: " << nc << "\n"; |
376 | |
377 long old_precision = os.precision (); | |
378 os.precision (4); | |
376 | 379 |
377 if (parametric) | 380 if (parametric) |
378 { | 381 { |
379 octave_idx_type extras = nc % 3; | 382 octave_idx_type extras = nc % 3; |
380 if (extras) | 383 if (extras) |
400 os << tmp.extract (0, i, nr-1, i); | 403 os << tmp.extract (0, i, nr-1, i); |
401 if (i+1 < nc) | 404 if (i+1 < nc) |
402 os << "\n"; | 405 os << "\n"; |
403 } | 406 } |
404 } | 407 } |
408 | |
409 os.precision (old_precision); | |
405 } | 410 } |
406 else | 411 else |
407 { | 412 { |
408 ::error ("for now, I can only save real matrices in 3D format"); | 413 ::error ("for now, I can only save real matrices in 3D format"); |
409 fail = true; | 414 fail = true; |