Tenncor
data.hpp
Go to the documentation of this file.
1 
9 #include <list>
10 
11 #include "teq/teq.hpp"
12 
13 #include "tag/tag.hpp"
14 
15 #include "pbm/graph.pb.h"
16 
17 #ifndef PBM_COMMON_HPP
18 #define PBM_COMMON_HPP
19 
20 namespace pbm
21 {
22 
24 using TensptrsT = std::vector<teq::TensptrT>;
25 
27 using StringsT = std::list<fmts::string>;
28 
30 struct iSaver
31 {
33  virtual std::string save_leaf (teq::iLeaf* leaf) = 0;
34 
36  virtual std::vector<double> save_shaper (const teq::CoordptrT& mapper) = 0;
37 
39  virtual std::vector<double> save_coorder (const teq::CoordptrT& mapper) = 0;
40 };
41 
43 struct iLoader
44 {
47  virtual teq::TensptrT generate_leaf (const char* data, teq::Shape shape,
48  std::string typelabel, std::string label, bool is_const) = 0;
49 
51  virtual teq::TensptrT generate_func (std::string opname, teq::ArgsT args) = 0;
52 
55  virtual teq::CoordptrT generate_shaper (std::vector<double> coord) = 0;
56 
60  std::string opname, std::vector<double> coord) = 0;
61 };
62 
63 }
64 
65 #endif // PBM_COMMON_HPP
args
Definition: csv_to_png.py:105
std::vector< FuncArg > ArgsT
Type of functor arguments.
Definition: funcarg.hpp:101
Definition: shape.hpp:62
std::shared_ptr< iCoordMap > CoordptrT
Type of iCoordMap smartpointer.
Definition: coord.hpp:106
virtual std::vector< double > save_shaper(const teq::CoordptrT &mapper)=0
Return vector serialization of shape coordinate map.
std::list< fmts::string > StringsT
String list type used for paths.
Definition: data.hpp:27
virtual std::string save_leaf(teq::iLeaf *leaf)=0
Return string serialization of leaf data.
std::shared_ptr< iTensor > TensptrT
Tensor smart pointer.
Definition: itensor.hpp:51
virtual teq::TensptrT generate_leaf(const char *data, teq::Shape shape, std::string typelabel, std::string label, bool is_const)=0
virtual teq::CoordptrT generate_shaper(std::vector< double > coord)=0
Interface for building implementations of leaves, functors, shaper, and coorder.
Definition: data.hpp:43
virtual std::vector< double > save_coorder(const teq::CoordptrT &mapper)=0
Return vector serialization of coordinate map.
Interface for saving implementations of leaves, shaper, and coorder.
Definition: data.hpp:30
std::vector< teq::TensptrT > TensptrsT
Tensptr vector type.
Definition: data.hpp:24
virtual teq::CoordptrT generate_coorder(std::string opname, std::vector< double > coord)=0
Leaf of the graph commonly representing the variable in an equation.
Definition: ileaf.hpp:19
Definition: data.hpp:20
virtual teq::TensptrT generate_func(std::string opname, teq::ArgsT args)=0
Return functor given operator name and TEQ arguments.