FlexELA
Loading...
Searching...
No Matches
Classes | Typedefs | Functions
svec Namespace Reference

For sparse vector containers and operations. More...

Classes

struct  Element
 Contains the label and value of a vector element. More...
 
class  NormalizedSVector
 A normalized SVector. More...
 
class  SVector
 A container for sparse vectors. More...
 

Typedefs

typedef unsigned int Label
 
typedef double Value
 

Functions

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.
 
SVector fma (const SVector &a, const Value &C, const SVector &b)
 Fused Multiply and Add, C*a+b.
 
SVector operator/ (const SVector &a, const Value &C)
 Division, a/C.
 
SVector operator* (const SVector &a, const Value &C)
 Multiplication, a*C.
 

Detailed Description

For sparse vector containers and operations.

Typedef Documentation

◆ Label

typedef unsigned int svec::Label

Type used for storing label (index)

◆ Value

typedef double svec::Value

Type used for value

Function Documentation

◆ fma() [1/2]

constexpr Element svec::fma ( const Element a,
const Value C,
const Element b 
)
constexpr

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

◆ fma() [2/2]

SVector svec::fma ( const SVector a,
const Value C,
const SVector b 
)

Fused Multiply and Add, C*a+b.

For two SVector \(\mathbf{a}\) and \(\mathbf{b}\) and a Value \(C\), returns

\[ \left(C \times \mathbf{a}\right) + \mathbf{b} \]

Parameters
aSVector, \(\mathbf{a}\)
CValue, \(C\)
bSVector, \(\mathbf{b}\)
Returns
SVector

◆ operator*() [1/2]

constexpr Element svec::operator* ( const Element a,
const Value C 
)
constexpr

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*() [2/2]

SVector svec::operator* ( const SVector a,
const Value C 
)

Multiplication, a*C.

For a SVector \(\mathbf{a}\) and a Value \(C\), returns

\[ \mathbf{a} * C \]

Parameters
aSVector, \(\mathbf{a}\)
CValue, \(C\)
Returns
SVector

◆ operator+()

constexpr Element svec::operator+ ( const Element a,
const Element b 
)
constexpr

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 svec::operator- ( const Element a,
const Element b 
)
constexpr

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

◆ operator/()

SVector svec::operator/ ( const SVector a,
const Value C 
)

Division, a/C.

For a SVector \(\mathbf{a}\) and a Value \(C\), returns

\[ \mathbf{a} / C \]

Parameters
aSVector, \(\mathbf{a}\)
CValue, \(C\)
Returns
SVector