36 #ifndef MADNESS_WORLD_BUFAR_H__INCLUDED
37 #define MADNESS_WORLD_BUFAR_H__INCLUDED
60 unsigned char *
const ptr;
61 const std::size_t nbyte;
62 mutable std::size_t i;
66 : ptr(0), nbyte(0), i(0), countonly(true) {}
69 : ptr((unsigned char *) ptr), nbyte(nbyte), i(0), countonly(false) {}
75 std::size_t
m = n*
sizeof(
T);
79 else if (i+m > nbyte) {
80 madness::print(
"BufferOutputArchive:ptr,nbyte,i,n,m,i+m:",(
void *)ptr,nbyte,i,n,m,i+m);
81 MADNESS_ASSERT(i+m<=nbyte);
97 inline std::size_t
size()
const {
104 template <
typename A,
typename B,
typename C,
typename D,
typename E,
typename F,
typename G,
typename H,
typename I,
typename J>
106 const E& e,
const F&
f,
const G&
g,
const H& h,
107 const I& i,
const J& j) {
109 count & a & b & c & d & e & f & g & h & i & j;
115 template <
typename A,
typename B,
typename C,
typename D,
typename E,
typename F,
typename G,
typename H,
typename I>
117 const E& e,
const F&
f,
const G&
g,
const H& h,
120 count & a & b & c & d & e & f & g & h & i;
126 template <
typename A,
typename B,
typename C,
typename D,
typename E,
typename F,
typename G,
typename H>
128 const E& e,
const F&
f,
const G&
g,
const H& h) {
130 count & a & b & c & d & e & f & g & h;
136 template <
typename A,
typename B,
typename C,
typename D,
typename E,
typename F,
typename G>
138 const E& e,
const F&
f,
const G&
g) {
140 count & a & b & c & d & e & f &
g;
146 template <
typename A,
typename B,
typename C,
typename D,
typename E,
typename F>
148 const E& e,
const F&
f) {
150 count & a & b & c & d & e &
f;
156 template <
typename A,
typename B,
typename C,
typename D,
typename E>
160 count & a & b & c & d & e;
166 template <
typename A,
typename B,
typename C,
typename D>
169 count & a & b & c & d;
175 template <
typename A,
typename B,
typename C>
184 template <
typename A,
typename B>
193 template <
typename A>
208 const unsigned char*
const ptr;
209 const std::size_t nbyte;
210 mutable std::size_t i;
214 : ptr((const unsigned char *) ptr), nbyte(nbyte), i(0) {};
220 std::size_t
m = n*
sizeof(
T);
221 MADNESS_ASSERT(m+i <= nbyte);
222 memcpy((
unsigned char*) t, ptr+i, m);
255 #endif // MADNESS_WORLD_BUFAR_H__INCLUDED
Tensor< double > B
Definition: tdse1d.cc:167
NDIM const Function< R, NDIM > & g
Definition: mra.h:2179
size_t bufar_size(const A &a, const B &b, const C &c, const D &d, const E &e, const F &f, const G &g, const H &h, const I &i, const J &j)
Convenience template computing the size of a buffer archive containing the arguments.
Definition: bufar.h:105
static void preamble_load(const BufferInputArchive &)
Definition: bufar.h:250
static void postamble_load(const BufferInputArchive &)
Definition: bufar.h:251
Interface templates for the archives (serialization)
void open(std::size_t)
Definition: bufar.h:89
NDIM & f
Definition: mra.h:2179
Default implementation of pre/postamble.
Definition: archive.h:641
std::size_t size() const
Definition: bufar.h:97
Wraps an archive around a memory buffer for output.
Definition: bufar.h:58
bool count_only() const
Definition: bufar.h:95
JLOOP2 NK jnz KLOOP2 mov C
Definition: mtxm_gen.h:10
pcomplex_operatorT G
Definition: tdse1d.cc:168
const T1 &f1 return GTEST_2_TUPLE_() T(f0, f1)
Base class for output archives classes.
Definition: archive.h:583
static void preamble_store(const BufferOutputArchive &)
Definition: bufar.h:243
FLOAT a(int j, FLOAT z)
Definition: y1.cc:86
BufferOutputArchive()
Definition: bufar.h:65
static void postamble_store(const BufferOutputArchive &)
Definition: bufar.h:244
madness::enable_if< madness::is_serializable< T >, void >::type store(const T *t, long n) const
Definition: bufar.h:74
const double m
Definition: gfit.cc:199
Defines simple templates for printing to std::cout "a la Python".
void close()
Definition: bufar.h:91
void flush()
Definition: bufar.h:93
void print(const A &a)
Print a single item to std::cout terminating with new line.
Definition: print.h:122
enable_if from Boost for conditionally instantiating templates based on type
Definition: enable_if.h:60
Holds machinery to set up Functions/FuncImpls using various Factories and Interfaces.
Definition: chem/atomutil.cc:45
const double c
Definition: gfit.cc:200
BufferOutputArchive(void *ptr, std::size_t nbyte)
Definition: bufar.h:68
FLOAT b(int j, FLOAT z)
Definition: y1.cc:79