KIDS  ver-0.0.1
KIDS : Kernel Integrated Dynamics Simulator
Loading...
Searching...
No Matches
RuleEvaluator.h
Go to the documentation of this file.
1
29#ifndef KIDS_RuleEvaluator_H
30#define KIDS_RuleEvaluator_H
31
32#include "kids/DataSet.h"
33#include "kids/Einsum.h"
35
36namespace PROJECT_NS {
37
51 RuleEvaluator(const std::string& rule, std::shared_ptr<DataSet>& DS, //
52 const std::string& mode, const std::string& save, //
53 std::size_t totalFrameNumber);
54
60 void calculateResult(int sampleIndex = 0);
61
62 void collectResult();
63
70 void writeTo(std::ofstream& ofs, void* data, int sampleIndex);
71
72 std::size_t totalTermNumber;
73 std::size_t totalFrameNumber;
74 std::size_t numCollects;
75 std::string rule;
76 std::string mode;
77 std::string save;
78 std::shared_ptr<VariableDescriptor> result;
79 std::shared_ptr<VariableDescriptor> collect;
80 std::shared_ptr<VariableDescriptor> reduced;
81 std::vector<VariableDescriptor> variables;
82 std::vector<std::vector<std::size_t>> inputShapes;
83 std::vector<void*> inputData;
84 std::vector<kids_dtype> inputDataTypes;
85 std::string expressionString;
86 std::shared_ptr<EinsumHelper> einsumHelper;
87 std::string einsumString;
89 size_t expressionId;
91};
92
93}; // namespace PROJECT_NS
94
95#endif // KIDS_RuleEvaluator_H
Declaration of the DataSet class and related classes.
this file provides einsum operation
provide VariableDescriptor class
< http://warp.povusers.org/FunctionParser/fparser.html
Definition Context.h:39
Represents a rule for evaluating an expression.
std::shared_ptr< VariableDescriptor > result
Result of the expression.
void writeTo(std::ofstream &ofs, void *data, int sampleIndex)
Writes the results to a file stream.
std::string rule
The expression rule.
std::vector< kids_dtype > inputDataTypes
Data types of input data.
std::string mode
The mode of evaluation.
std::shared_ptr< EinsumHelper > einsumHelper
Shared pointer to EinsumHelper.
std::vector< void * > inputData
Input data.
std::string expressionString
String representation of the expression.
std::vector< std::vector< std::size_t > > inputShapes
Shapes of input data.
void calculateResult(int sampleIndex=0)
Calculates the expression at a particular time slice.
std::size_t totalTermNumber
Number of terms.
std::shared_ptr< VariableDescriptor > reduced
collect of Result
std::shared_ptr< VariableDescriptor > collect
collect of Result
std::string save
File name to save results.
std::size_t numCollects
Number of Collects.
std::vector< VariableDescriptor > variables
Variables in the expression.
kids_dtype expressionType
Type of the expression.
RuleEvaluator(const std::string &rule, std::shared_ptr< DataSet > &DS, const std::string &mode, const std::string &save, std::size_t totalFrameNumber)
Constructs an RuleEvaluator object.
size_t expressionId
ID of the expression.
std::string einsumString
String representation of expression type.
int expressionCheck
ID of the expression.
std::size_t totalFrameNumber
Number of samples.