37 constexpr operator Value()
const
85 return {a.
l, a.
v + b.
v};
105 return {a.
l, a.
v - b.
v};
122 return {a.
l, a.
v * C};
143 return {a.
l, std::fma(a.
v, C, b.
v)};
152constexpr Element END_ELEMENT = {std::numeric_limits<Label>::max(), 0.0};
161 assert(this->
l == rhs.
l);
172 assert(this->
l == rhs.
l);
190 return this->
l == END_ELEMENT.
l;
For sparse vector containers and operations.
Definition element.h:10
double Value
Definition types.h:21
constexpr Element fma(const Element &a, const Value &C, const Element &b)
Fused Multiply and Add, C*a+b.
Definition element.h:140
unsigned int Label
Definition types.h:15
constexpr Element operator-(const Element &a, const Element &b)
Subtraction, a-b.
Definition element.h:102
constexpr Element operator*(const Element &a, const Value &C)
Multiplication, C*a.
Definition element.h:120
constexpr Element operator+(const Element &a, const Element &b)
Addition, a+b.
Definition element.h:82
Contains the label and value of a vector element.
Definition element.h:23
bool isEnd() const
Definition element.h:187
Element & operator-=(const Value &rhs)
Subtraction assignment.
Definition element.h:165
Element & operator+=(const Value &rhs)
Addition assignment.
Definition element.h:154
friend constexpr Element operator-(const Element &a, const Element &b)
Subtraction, a-b.
Definition element.h:102
Element & operator*=(const Value &rhs)
Multiplication assignment.
Definition element.h:176
friend constexpr Element fma(const Element &a, const Value &C, const Element &b)
Fused Multiply and Add, C*a+b.
Definition element.h:140
Value v
The value of the vector element.
Definition element.h:34
Element & operator/=(const Value &rhs)
Division assignment.
Definition element.h:181
Label l
The label of the vector element.
Definition element.h:28
friend constexpr Element operator*(const Element &a, const Value &C)
Multiplication, C*a.
Definition element.h:120
friend constexpr Element operator+(const Element &a, const Element &b)
Addition, a+b.
Definition element.h:82
Define types used be svec namespace.