FlexELA
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Friends | Related Symbols | List of all members
svec::Element Struct Reference

Contains the label and value of a vector element. More...

#include <element.h>

Public Member Functions

constexpr operator Value () const
 Conversion to Value.
 
Elementoperator+= (const Value &rhs)
 Addition assignment.
 
Elementoperator+= (const Element &rhs)
 Addition assignment.
 
Elementoperator-= (const Value &rhs)
 Subtraction assignment.
 
Elementoperator-= (const Element &rhs)
 Subtraction assignment.
 
Elementoperator*= (const Value &rhs)
 Multiplication assignment.
 
Elementoperator/= (const Value &rhs)
 Division assignment.
 
bool isEnd () const
 

Public Attributes

Label l
 The label of the vector element.
 
Value v
 The value of the vector element.
 

Friends

constexpr Element operator+ (const Element &a, const Element &b)
 Addition, a+b.
 
constexpr Element operator- (const Element &a, const Element &b)
 Subtraction, a-b.
 
constexpr Element operator* (const Element &a, const Value &C)
 Multiplication, C*a.
 
constexpr Element fma (const Element &a, const Value &C, const Element &b)
 Fused Multiply and Add, C*a+b.
 

Related Symbols

(Note that these are not member symbols.)

constexpr Element END_ELEMENT = {std::numeric_limits<Label>::max(), 0.0}
 

Detailed Description

Contains the label and value of a vector element.

The Element structure is used to store an of a vector in terms of the label \(\ell\) (i.e., index) and the value \(v_\ell\).

Warning
For all operations involving multiple Element objects, it is assumed the labels are the same

Member Function Documentation

◆ isEnd()

bool svec::Element::isEnd ( ) const
inline

True if the element matches END_ELEMENT.

Friends And Related Symbol Documentation

◆ END_ELEMENT

constexpr Element END_ELEMENT = {std::numeric_limits<Label>::max(), 0.0}
related

A special Element for indicating the end of a sequence

◆ fma

constexpr Element fma ( const Element a,
const Value C,
const Element b 
)
friend

Fused Multiply and Add, C*a+b.

For two Element \(a_\ell\) and \(b_\ell\) and a Value \(C\), returns

\[ \left(C \times a_\ell\right) + b_\ell \]

Note
The Label \(\ell\) must be the same in a and b.
Parameters
aFirst Element, \(a_\ell\)
CValue, \(C\)
bSecond Element, \(b_\ell\)
Returns
Element

◆ operator*

constexpr Element operator* ( const Element a,
const Value C 
)
friend

Multiplication, C*a.

For an Element \(a_\ell\) and a Value \(C\), returns

\[ C \times a_\ell \]

Parameters
aFirst Element, \(a_\ell\)
CValue, \(C\)
Returns
Element

◆ operator+

constexpr Element operator+ ( const Element a,
const Element b 
)
friend

Addition, a+b.

For two Element \(a_\ell\) and \(b_\ell\), returns

\[ a_\ell + b_\ell \]

Note
The Label \(\ell\) must be the same in a and b.
Parameters
aFirst Element, \(a_\ell\)
bSecond Element, \(b_\ell\)
Returns
Element

◆ operator-

constexpr Element operator- ( const Element a,
const Element b 
)
friend

Subtraction, a-b.

For two Element \(a_\ell\) and \(b_\ell\), returns

\[ a_\ell - b_\ell \]

Note
The Label \(\ell\) must be the same in a and b.
Parameters
aFirst Element, \(a_\ell\)
bSecond Element, \(b_\ell\)
Returns
Element

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