C++ mpi module for stochmagnet_main Package
EXPR_LinearFunction.h
1 #ifndef EXPR_LinearFunction_H
2 #define EXPR_LinearFunction_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("LINEAR");
32  }
33 
34  //deleters
38  }
39 
40 public:
41  //methods
42 
46  static inline CORE_UniquePointer<EXPR_LinearFunction> New() {
47  CORE_UniquePointer<EXPR_LinearFunction> p(new EXPR_LinearFunction(),
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 
80 
85  virtual void apply(const std::vector<tString>& args,
86  EXPR_Node& node) const final {
87  std::array<tReal,9> x;
88  tReal *iX=&x[0];
89  for(auto& arg:args) {
90  core_numeric::parse(arg,*iX);
91  iX++;
92  }
93 
94  node.leftComposition(x);
95  }
96 
97 };
98 
99 #endif
100 
101 
class Free introduced for deleting a smart pointer
Definition: CORE_Object.h:113
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 describes.
Definition: EXPR_LinearFunction.h:17
static CORE_UniquePointer< EXPR_LinearFunction > New()
return an unique instance of this class
Definition: EXPR_LinearFunction.h:46
virtual tMemSize getContentsMemorySize() const override
return nthe memory size of the included associations
Definition: EXPR_LinearFunction.h:74
virtual void apply(const std::vector< tString > &args, EXPR_Node &node) const final
apply the function to the environment
Definition: EXPR_LinearFunction.h:85
virtual ~EXPR_LinearFunction()
delete the class
Definition: EXPR_LinearFunction.h:37
EXPR_LinearFunction()
create the class
Definition: EXPR_LinearFunction.h:30
virtual tMemSize getMemorySize() const override
return the memory size of the class
Definition: EXPR_LinearFunction.h:62
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