C++ mpi module for stochmagnet_main Package
EXPR_AffineFunction.h
1 #ifndef EXPR_AffineFunction_H
2 #define EXPR_AffineFunction_H
3 
4 #include "EXPR_Function.h"
5 
6 
7 //numerics functions headers
8 #include "core_numeric.h"
9 
18 
19 
20 private:
21 
22 
23 private:
24  //associations
25 protected:
26  //builders
27 
31  setName("AFFINE");
32  }
33 
34  //deleters
38  }
39 
40 public:
41  //methods
42 
46  static inline CORE_UniquePointer<EXPR_AffineFunction> New() {
47  CORE_UniquePointer<EXPR_AffineFunction> p(new EXPR_AffineFunction(),
49 
50  return p;
51  }
52 
53  //MEMORY
54  //======
62  virtual tMemSize getMemorySize() const override {
63  return sizeof(*this)+getContentsMemorySize();
64  }
65 
74  virtual tMemSize getContentsMemorySize() const override {
76  return mem;
77  }
78 
79 
84  virtual void apply(const std::vector<tString>& args,
85  EXPR_Node& node) const final {
86  std::array<tReal,9> A={1,0,0,0,1,0,0,0,1};//identity
87  std::array<tReal,3> B={0,0,0};//0
88  auto iArgs=args.cbegin();
89  for(auto Ai:A) {
90  Ai=0;
91  core_numeric::parse(*iArgs,Ai);
92  iArgs++;
93  }
94  for(auto Bi:B) {
95  Bi=0;
96  core_numeric::parse(*iArgs,Bi);
97  iArgs++;
98  }
99 
100 
101  node.leftComposition(A,B);
102  }
103 
104 };
105 
106 #endif
107 
108 
class Free introduced for deleting a smart pointer
Definition: CORE_Object.h:113
This class describes.
Definition: EXPR_AffineFunction.h:17
virtual void apply(const std::vector< tString > &args, EXPR_Node &node) const final
apply the function to the environment
Definition: EXPR_AffineFunction.h:84
virtual ~EXPR_AffineFunction()
delete the class
Definition: EXPR_AffineFunction.h:37
EXPR_AffineFunction()
create the class
Definition: EXPR_AffineFunction.h:30
virtual tMemSize getMemorySize() const override
return the memory size of the class
Definition: EXPR_AffineFunction.h:62
virtual tMemSize getContentsMemorySize() const override
return nthe memory size of the included associations
Definition: EXPR_AffineFunction.h:74
static CORE_UniquePointer< EXPR_AffineFunction > New()
return an unique instance of this class
Definition: EXPR_AffineFunction.h:46
This class described a function.
Definition: EXPR_Function.h:15
void setName(const tString &name)
set the name of the function
Definition: EXPR_Function.h:44
This class is a base class of the binary tree.
Definition: EXPR_Node.h:16
virtual tMemSize getContentsMemorySize() const override
return nthe memory size of the included associations
Definition: EXPR_Object.h:70