Class Sum¶
Defined in File sum.hpp
Nested Relationships¶
Nested Types¶
Inheritance Relationships¶
Base Type¶
public sequant::Expr(Class Expr)
Class Documentation¶
-
class Sum : public sequant::Expr¶
sum of zero or more summands
Sum is associative and is flattened automatically.
Public Functions
-
Sum() = default¶
-
virtual ~Sum() = default¶
-
Sum(ExprPtrList summands)¶
construct a Sum out of zero or more summands
- Parameters:
summands – an initializer list of summands
-
template<typename Iterator>
inline Sum(Iterator begin, Iterator end)¶ construct a Sum out of a range of summands
- Parameters:
begin – the begin iterator
end – the end iterator
-
template<typename Range>
inline explicit Sum(Range &&rng)¶ construct a Sum out of a range of summands
- Parameters:
rng – a range
-
explicit Sum(summands_type &&summands, move_only_tag)¶
construct a Sum by moving in the summands, no flattening is performed, but zeros will be omitted and constants added up
- Parameters:
summands – the summands to move in
-
const summands_type &summands() const¶
Summands accessor.
-
const ExprPtr &summand(size_t i) const¶
Summand accessor
- Parameters:
i – summand index
- Returns:
ith summand
-
ExprPtr take_n(size_t offset, size_t count) const¶
Takes the first
countelements of the sum starting with elementoffset
-
template<typename Filter>
inline ExprPtr filter(Filter &&f) const¶ - Template Parameters:
Filter – a boolean predicate type, such
Filter(const ExprPtr&)evaluates to true- Parameters:
f – an object of Filter type Selects elements {
e} for whichf(e)is true
-
bool empty() const¶
- Returns:
true if the number of factors is zero
-
virtual std::wstring to_latex() const override¶
- Returns:
the string representation of
thisin the LaTeX format
-
virtual Expr::type_id_type type_id() const override¶
Computes and returns the derived type identifier
See also
- Returns:
the hash value for this Expr
-
virtual ExprPtr clone() const override¶
- Returns:
a clone of this object, i.e. an object that is equal to
this
-
virtual ExprIterator begin_subexpr() override¶
-
virtual ExprIterator end_subexpr() override¶
-
virtual ConstExprIterator begin_subexpr() const override¶
-
virtual ConstExprIterator end_subexpr() const override¶
-
struct move_only_tag¶
tags ctor to move the summands directly
-
Sum() = default¶