26 #ifndef MLN_IO_CLOUD_SAVE_HH
27 # define MLN_IO_CLOUD_SAVE_HH
36 # include <mln/core/concept/image.hh>
37 # include <mln/core/site_set/p_array.hh>
53 void save(
const p_array<P>& arr,
const std::string& filename);
56 # ifndef MLN_INCLUDE_ONLY
63 void save_data(
const p_array<P>& arr, std::ofstream& file)
65 mln_piter(p_array<P>) p(arr);
68 std::ostringstream sline;
69 algebra::vec<P::dim,float> v = p.to_site().to_vec();
71 for (
unsigned i = 1; i < P::dim; ++i)
85 trace::entering(
"mln::io::cloud::save");
87 std::ofstream file(filename.c_str());
90 std::cerr <<
"error: cannot open file '" << filename <<
"'!";
94 internal::save_data(arr, file);
96 trace::exiting(
"mln::io::cloud::save");
100 # endif // ! MLN_INCLUDE_ONLY
108 #endif // ! MLN_IO_CLOUD_SAVE_HH