Menu

Operation

Nicolas Hainaux
There is a newer version of this page. You can find it here.

This is the mother class of any operation in general. Sum, Product and Quotient all derive from Operation.

An operation has elements (terms in a Sum, factors in a Product...), a neutral element (Item(1) for the Product and Quotient, Item(0) for the Sum), and a symbol ('+' for Sum, '×' for Product, 'like_a_fraction' or 'use_divide_symbol' for a Quotient)

Fields Methods (provided) Methods (must be reimplemented)
element get_element() operator()
neutral get_neutral()
symbol get_symbol()
get_iteration_list()
set_element()
set_symbol()
reset_element()
__get_item__()
__set_item__()
is_expandable()
is_numeric()
is_literal()

operator() has to be redefined in each instanciated Operation. It will make the operation between self and arg.

Check Operation's complete doc

Back


Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.