codac 2.0.0
|
Abstract base class for representing variables in analytic or set functions. More...
#include <codac2_VarBase.h>
Public Member Functions | |
virtual | ~VarBase ()=default |
Virtual destructor for the VarBase class. | |
virtual const ExprID & | unique_id () const =0 |
Returns the unique identifier of the variable. | |
virtual std::shared_ptr< VarBase > | arg_copy () const =0 |
Creates a copy of the argument. | |
virtual Index | size () const =0 |
Returns the mathematical size of the variable. | |
Abstract base class for representing variables in analytic or set functions.
The VarBase
class serves as the abstract base for various types of variable representations, such as scalar, vector, and matrix variables.
|
virtualdefault |
Virtual destructor for the VarBase
class.
The destructor is virtual to ensure proper cleanup of derived classes.
|
pure virtual |
Returns the unique identifier of the variable.
Each instance of a derived class should have a unique identifier to distinguish it from other variables. This ID is used to identify the variable (or any expression) independently of its memory address.
|
pure virtual |
Creates a copy of the argument.
This method should return a deep copy of the variable.
|
pure virtual |
Returns the mathematical size of the variable.
For scalar variables, the size is 1. For vector variables of \(\mathbb{R}^n\), the size is \(n\). For matrix variables of \(r\) rows and \(c\) columns, the size is \(r\times c\).