21# include "rheolef/disarray.h"
22# include "rheolef/load_chunk.h"
27template <
class T,
class A>
33template <
class T,
class A>
35 :
base(loc_size1, init_val, alloc),
39template <
class T,
class A>
41 :
base(ownership.size(),init_val),
45template <
class T,
class A>
48 _ownership(x._ownership)
50 std::copy (x.begin(), x.end(), begin());
52template <
class T,
class A>
57 _ownership = ownership;
58 base::resize (_ownership.size(), init_val);
59 std::fill (begin(), end(), init_val);
61template <
class T,
class A>
67 base::resize (_ownership.size(), init_val);
68 std::fill (begin(), end(), init_val);
70template <
class T,
class A>
71template <
class GetFunction>
74 std::istream& is = ips.
is();
75 if (!
load_chunk (is, begin(), end(), get_element))
79template <
class T,
class A>
85template <
class T,
class A>
86template <
class PutFunction>
90 std::ostream& os = ops.
os();
92 put_element (os,
operator[](i));
97template <
class T,
class A>
103template <
class T,
class A>
111template <
class T,
class A>
114 std::ofstream os (name.c_str());
115 std::cerr <<
"! file \"" << name <<
"\" created." << std::endl;
119template <
class T,
class A>
125 check_macro (inew2iold.size() == size(),
"reverse permutation[0:"<<inew2iold.size()
126 <<
"[ has incompatible dis_range with oriinal permutation[0:"<<size()<<
"[");
127 for (
size_type iold = 0, nold = size(); iold < nold; iold++) {
129 inew2iold [inew] = iold;
132template <
class T,
class A>
base::size_type size_type
see the distributor page for the full documentation
static const size_type decide
idiststream: see the diststream page for the full documentation
odiststream: see the diststream page for the full documentation
#define error_macro(message)
check_macro(expr1.have_homogeneous_space(Xh1), "dual(expr1,expr2); expr1 should have homogeneous space. HINT: use dual(interpolate(Xh, expr1),expr2)")
This file is part of Rheolef.
bool load_chunk(std::istream &s, RandomIterator iter, RandomIterator last)
disarray element input helper
disarray element output helper