Minsky
schema2 Namespace Reference

Classes

struct  Group
 
struct  Item
 
struct  ItemBase
 
struct  Minsky
 
struct  Note
 
struct  RavelState
 
struct  Schema1Layout
 
struct  Slider
 
struct  Wire
 

Functions

void unpack (classdesc::pack_t &b, civita::XVector &a)
 
void unpack (classdesc::pack_t &, civita::TensorVal &)
 unpack a TensorVal from a pack_t buffer. Schema2 encoding. More...
 

Function Documentation

◆ unpack() [1/2]

void schema2::unpack ( classdesc::pack_t &  b,
civita::XVector &  a 
)

Definition at line 26 of file schema2.cc.

Referenced by schema3::Item::convertTensorDataFromSchema2(), and unpack().

27  {
28  size_t size;
29  std::string x;
30  a.clear();
31  b>>a.name>>a.dimension>>size;
32  for (size_t i=0; i<size; ++i)
33  {
34  b>>x;
35  a.push_back(x);
36  }
37  }
Here is the caller graph for this function:

◆ unpack() [2/2]

void schema2::unpack ( classdesc::pack_t &  b,
civita::TensorVal &  a 
)

unpack a TensorVal from a pack_t buffer. Schema2 encoding.

Definition at line 39 of file schema2.cc.

References unpack().

40  {
41  vector<unsigned> dims; // ignored, because info carried with xvectors
42  vector<double> data;
43  b>>dims>>data;
44 
45  civita::Hypercube hc;
46  size_t sz;
47  b>>sz;
48  for (size_t i=0; i<sz; ++i)
49  {
50  civita::XVector xv;
51  unpack(b,xv);
52  hc.xvectors.push_back(xv);
53  }
54 
55  a.hypercube(hc); //dimension data
56  assert(a.size()==data.size());
57  memcpy(a.begin(),data.data(),data.size()*sizeof(data[0]));
58  }
void unpack(classdesc::pack_t &, const classdesc::string &, classdesc::ref< ecolab::urand > &)
Here is the call graph for this function: