60class Kernel :
public std::enable_shared_from_this<Kernel> {
82 Kernel(
const std::string& customized_name =
"");
108 std::shared_ptr<Param>
getParam()
const;
182 Kernel&
insertAt(std::vector<std::size_t> indexes, std::shared_ptr<Kernel> ker);
199 Kernel&
updateAt(std::vector<std::size_t> indexes, std::shared_ptr<Kernel> ker);
244 int current_layer = 0,
246 int total_align_size = 0);
Declaration of the DataSet class and related classes.
Provide struct and interfaces for input parameters.
this class provides the container and implementation of algorithms
virtual Status & initializeKernel_impl(Status &stat)
Virtual function to initialize the kernel implementation.
static std::shared_ptr< Kernel > deserializeKernel(const std::string &str)
Deserialize a string representation into a Kernel object.
Kernel * _parent_kernel
Pointer to the parent kernel.
std::shared_ptr< DataSet > getDataSet() const
Get the data set associated with the kernel.
Kernel & appendChild(std::shared_ptr< Kernel > ker)
Append a kernel as the last child of the current tree node.
std::shared_ptr< Param > getParam() const
Get the parameter associated with the kernel.
static int mpi_reduce_info(Kernel *ker)
std::vector< std::shared_ptr< Kernel > > _child_kernels
Vector containing shared pointers to the child kernels of this kernel.
virtual Status & finalizeKernel_impl(Status &stat)
Virtual function to finalize the kernel implementation.
static std::vector< Kernel * > & getKernels()
Get the vector of all kernel pointers.
virtual const std::string getName()
Get the name of the kernel.
std::shared_ptr< RuleSet > getRuleSet()
Get RuleSet associated with the Kernel.
static const std::string serializeKernel(const Kernel &ker)
Serialize a Kernel object into a string representation.
int getID() const
Get the ID of the kernel.
Kernel & removeAt(std::vector< std::size_t > indexes)
Remove kernels at specified indexes from the tree.
std::shared_ptr< Param > _param
Shared pointer to the Param object associated with this kernel.
virtual Status & executeKernel_impl(Status &stat)
Virtual function to execute the kernel implementation.
void setInputDataSet(std::shared_ptr< DataSet > &DS)
Set input data set for the kernel and its children.
static std::map< std::string, Kernel * > & getDictOfKernels()
Get the dictionary of kernels (mapping from names to kernel pointers).
virtual ~Kernel()
Destructor.
virtual int getType() const
Get the type of the kernel.
Status & executeKernel(Status &stat)
Execute the kernel's algorithm and those of its children.
virtual void setInputDataSet_impl(std::shared_ptr< DataSet > &DS)
Virtual function to set input data set for the kernel implementation.
virtual void setInputParam_impl(std::shared_ptr< Param > &PM)
Virtual function to set input parameters for the kernel implementation.
std::vector< std::shared_ptr< Kernel > > _all_kernels
Vector containing shared pointers to all descendant kernels of this kernel.
const std::string generateInformationString(double total_time=-1.0f, int current_layer=0, int total_depth=0, int total_align_size=0)
Generate a formatted string containing information about the kernel.
static int dump(Kernel *ker)
std::tuple< Kernel *, std::size_t > getLastParentKernelAndChildOrder()
Retrieve the last parent kernel along with the order of its child kernels, if available.
std::shared_ptr< DataSet > _dataset
Shared pointer to the DataSet object associated with this kernel.
Kernel(const std::string &customized_name="")
Constructor with an optional specified name.
void connectRelatedKernels(std::shared_ptr< Kernel > &ker)
Connect related kernels to this kernel.
Kernel & insertAt(std::vector< std::size_t > indexes, std::shared_ptr< Kernel > ker)
Insert a kernel at specified indexes in the tree.
Status & finalizeKernel(Status &stat)
Finalize the kernel and its children, performing any necessary cleanup.
std::size_t _order_in_parent
Order of this kernel in its parent's children.
bool operator==(const Kernel &ker)
Overloaded equality operator to compare two Kernel objects by their IDs.
Kernel & updateAt(std::vector< std::size_t > indexes, std::shared_ptr< Kernel > ker)
Update the kernel at specified indexes in the tree.
Status & initializeKernel(Status &stat)
Prepare initial conditions for the kernel and its children.
void setInputParam(std::shared_ptr< Param > &PM)
Set input parameters for the kernel and its children.
static int report(Kernel *ker)
std::shared_ptr< RuleSet > _ruleset
Recorded Rules associated with the Kernel.
< http://warp.povusers.org/FunctionParser/fparser.html
std::basic_string< CharT > concat(const separator_t< CharT > &sep, Args &&... seq)