27 #ifndef MLN_IO_CLOUD_SAVE_HH
28 # define MLN_IO_CLOUD_SAVE_HH
37 # include <mln/core/concept/image.hh>
38 # include <mln/core/site_set/p_array.hh>
57 void save(
const p_array<P>& arr,
const std::string&
filename);
60 # ifndef MLN_INCLUDE_ONLY
67 void save_data(
const p_array<P>& arr, std::ofstream& file)
69 mln_piter(p_array<P>)
p(arr);
72 std::ostringstream sline;
73 algebra::vec<P::dim,float> v = p.to_site().to_vec();
75 for (
unsigned i = 1; i < P::dim; ++i)
87 void save(
const p_array<P>& arr,
const std::string&
filename)
89 mln_trace(
"mln::io::cloud::save");
91 std::ofstream file(filename.c_str());
94 std::cerr <<
"error: cannot open file '" << filename <<
"'!";
98 internal::save_data(arr, file);
103 # endif // ! MLN_INCLUDE_ONLY
111 #endif // ! MLN_IO_CLOUD_SAVE_HH