Ultra 0.9.4
Loading...
Searching...
No Matches
ultra::integer::mod Class Reference

#include <integer.h>

Inheritance diagram for ultra::integer::mod:
ultra::function ultra::symbol

Public Member Functions

 mod (return_type r=symbol::default_category, const param_data_types &pt={symbol::default_category, symbol::default_category})
std::string to_string (format) const final
value_t eval (const params &pars) const final
Public Member Functions inherited from ultra::function
 function (const std::string &, return_type, param_data_types)
 function (const std::string &, std::size_t)
category_t param_category (std::size_t) const noexcept
const param_data_types & categories () const noexcept
std::size_t arity () const noexcept
bool is_valid () const override
Public Member Functions inherited from ultra::symbol
 symbol (const std::string &, category_t=default_category)
virtual ~symbol ()=default
 Virtual destructor to allow safe polymorphic deletion.
category_t category () const noexcept
opcode_t opcode () const noexcept
const std::string & name () const noexcept
void category (category_t) noexcept

Additional Inherited Members

Public Types inherited from ultra::function
using param_data_types = std::vector<category_t>
using return_type = category_t
 Type used to describe the return category of the function.
Public Types inherited from ultra::symbol
enum  format { c_format , cpp_format , python_format , sup_format }
 Supported rendering formats for symbol stringification.
using category_t = unsigned
using opcode_t = unsigned
Static Public Attributes inherited from ultra::symbol
static constexpr category_t default_category = 0
 Default category assigned when typing is not used.
static constexpr category_t undefined_category
 Sentinel value indicating that the category has not yet been assigned.

Detailed Description

Member Function Documentation

◆ eval()

value_t ultra::integer::mod::eval ( const params & ) const
inlinenodiscardfinalvirtual

Evaluates the function for the given parameters.

Returns
result of the function evaluation
Remarks
Parameters are accessed via the params interface, which supports lazy evaluation and optional referential transparency. Implementations should avoid fetching arguments multiple times unless necessary.
Warning
Implementations must not assume any particular evaluation order of parameters.

Implements ultra::function.

◆ to_string()

std::string ultra::integer::mod::to_string ( format ) const
inlinenodiscardfinalvirtual

Returns a string representation of the function.

Remarks
The base implementation produces a generic functional notation (e.g. ADD({0},{1})). Derived classes may override this method to support alternative syntaxes or formatting conventions.
Note
Format templates should not contain unbalanced parentheses inside comments or string literals, as program rendering checks enclosing parentheses directly on the template.
Returns
the name of the function
Warning
Specific functions have to specialize this method to support different output formats. Format templates should avoid unbalanced parentheses in comments or string literals.

Reimplemented from ultra::function.


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