YASK
Yet Another Stencil Kit: a software framework for creating HPC stencil code. Copyright 2014-2023 Intel Corporation.
Loading...
Searching...
No Matches
Public Member Functions | List of all members
yask::yc_commutative_number_node Class Referenceabstract

Base class for commutative numerical operators. More...

#include <yc_node_api.hpp>

+ Inheritance diagram for yask::yc_commutative_number_node:

Public Member Functions

virtual int get_num_operands ()=0
 Get the number of operands.
 
virtual std::vector< yc_number_node_ptrget_operands ()=0
 Get a list of the operands.
 
virtual void add_operand (yc_number_node_ptr node)=0
 Add an operand.
 
- Public Member Functions inherited from yask::yc_number_node
virtual yc_number_node_ptr clone_ast () const =0
 Create a deep copy of AST starting with this node.
 
- Public Member Functions inherited from yask::yc_expr_node
virtual std::string format_simple () const =0
 Create a simple human-readable string.
 
virtual int get_num_nodes () const =0
 Count the size of the AST.
 

Detailed Description

Base class for commutative numerical operators.

This is used for operators whose arguments can be rearranged mathematically, e.g., add and multiply.

Member Function Documentation

◆ get_num_operands()

virtual int yask::yc_commutative_number_node::get_num_operands ( )
pure virtual

Get the number of operands.

If there is just one operand, the operation itself is moot. If there are more than one operand, the operation applies between them. Example: for an add operator, if the operands are a, b, and c, then the expression is a + b + c.

Returns
Number of operands.

◆ get_operands()

virtual std::vector< yc_number_node_ptr > yask::yc_commutative_number_node::get_operands ( )
pure virtual

Get a list of the operands.

Returns
Vector of pointers to all operand nodes.

◆ add_operand()

virtual void yask::yc_commutative_number_node::add_operand ( yc_number_node_ptr  node)
pure virtual

Add an operand.

Parameters
[in]nodeTop node of AST to add.

The documentation for this class was generated from the following file: